1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

Updated welcome page to work better on small screen

if the buttons grid overlaps vertically with wizard buttons,
move it left to use only the space left to wizard buttons;

Hide the OpenPilot Logo when workspace buttons don't
fir the screen;

Limit the size of community panel on small screen
This commit is contained in:
Dmytro Poplavskiy 2012-08-14 22:54:08 +10:00
parent 31cb4b7ea5
commit 81d4fd3740
2 changed files with 13 additions and 2 deletions

View File

@ -2,7 +2,8 @@
import QtQuick 1.1
Item {
width: background.sourceSize.width
property alias sourceSize: background.sourceSize
width: sourceSize.width
height: 300
BorderImage {

View File

@ -47,6 +47,7 @@ Rectangle {
Column {
id: buttonsGrid
anchors.horizontalCenter: parent.horizontalCenter
// distribute a vertical space between the icons blocks an community widget as:
// top - 48% - Icons - 27% - CommunityWidget - 25% - bottom
@ -55,13 +56,20 @@ Rectangle {
spacing: (parent.height - buttons.height - communityPanel.height) * 0.27
Row {
anchors.horizontalCenter: parent.horizontalCenter
//if the buttons grid overlaps vertically with the wizard buttons,
//move it left to use only the space left to wizard buttons
property real availableWidth: buttonsGrid.y > wizarButtonsColumn.y+wizarButtonsColumn.height ?
container.width : wizarButtonsColumn.x
x: (availableWidth-width)/2
spacing: 16
Image {
source: "images/welcome-op-logo.png"
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -2 //it looks better aligned to icons grid
//hide the logo on the very small screen to fit the buttons
visible: parent.availableWidth > width + parent.spacing + buttons.width
}
Grid {
@ -111,6 +119,8 @@ Rectangle {
CommunityPanel {
id: communityPanel
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(sourceSize.width, container.width)
height: Math.min(300, container.height*0.5)
}
}
}