From e12c784db44de46ec7454c4471e8da12ec84b147 Mon Sep 17 00:00:00 2001 From: Sebastian Kügler Date: Mon, 30 Nov 2015 01:04:09 +0100 Subject: Smaller topbar, no button in it anymore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change makes the top bar a information/decorational item, not interactive anymore. - The menu at the top-right is redundant, it is provided by the left-hand-side drawer and visually present through the botom-centered control button. - The back button is already provided on Android by default, swiping back in the UI also works, so this button provides a third method to go back -- that's overkill. Less is more. Less top bar means more screen estate for the meat. Signed-off-by: Sebastian Kügler --- qt-mobile/qml/TopBar.qml | 44 +++++++------------------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) (limited to 'qt-mobile/qml/TopBar.qml') diff --git a/qt-mobile/qml/TopBar.qml b/qt-mobile/qml/TopBar.qml index f07a88e47..0dd9751a1 100644 --- a/qt-mobile/qml/TopBar.qml +++ b/qt-mobile/qml/TopBar.qml @@ -14,29 +14,31 @@ Rectangle { property bool goBack: (stackView.depth > 1) color: subsurfaceTheme.accentColor - Layout.minimumHeight: MobileComponents.Units.gridUnit * 2 + MobileComponents.Units.largeSpacing + Layout.minimumHeight: MobileComponents.Units.gridUnit * 2 Layout.fillWidth: true Layout.margins: 0 RowLayout { anchors.bottom: topPart.bottom - anchors.bottomMargin: MobileComponents.Units.largeSpacing / 2 + anchors.bottomMargin: MobileComponents.Units.smallSpacing anchors.left: topPart.left anchors.leftMargin: MobileComponents.Units.largeSpacing / 2 anchors.right: topPart.right anchors.rightMargin: MobileComponents.Units.largeSpacing / 2 Item { Layout.preferredHeight: subsurfaceLogo.height + Rectangle { color: "green"; anchors.fill: parent; } Image { id: subsurfaceLogo source: "qrc:/qml/subsurface-mobile-icon.png" anchors { top: parent.top + topMargin: MobileComponents.Units.smallSpacing * -1 left: parent.left } - width: MobileComponents.Units.gridUnit * 2 + width: MobileComponents.Units.gridUnit height: width } - Text { + MobileComponents.Label { text: qsTr("Subsurface") height: subsurfaceLogo.height anchors { @@ -44,7 +46,7 @@ Rectangle { bottom: subsurfaceLogo.bottom leftMargin: MobileComponents.Units.gridUnit / 2 } - font.pointSize: MobileComponents.Units.fontMetrics.font.pointSize * 1.5 + font.weight: Font.Light verticalAlignment: Text.AlignBottom Layout.fillWidth: false color: subsurfaceTheme.accentTextColor @@ -53,37 +55,5 @@ Rectangle { Item { Layout.fillWidth: true } - Button { - id: prefsButton - // Display back arrow or menu button - text: topPart.goBack ? "\u2190" : "\u22ee" - anchors.right: parent.right - Layout.preferredWidth: MobileComponents.Units.gridUnit * 2 - Layout.preferredHeight: parent.height - style: ButtonStyle { - background: Rectangle { - implicitWidth: MobileComponents.Units.gridUnit * 2 - color: subsurfaceTheme.accentColor - } - label: Text { - id: txt - color: subsurfaceTheme.accentTextColor - font.pointSize: MobileComponents.Units.fontMetrics.font.pointSize * 2 - font.bold: true - text: control.text - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - onClicked: { - if (topPart.goBack) { - stackView.pop() - } else { - prefsMenu.popup() - } - } - } - } - } -- cgit v1.2.3-70-g09d2 From 52b3c68b24d5c874b6b15dd90a3421d393520120 Mon Sep 17 00:00:00 2001 From: Sebastian Kügler Date: Mon, 30 Nov 2015 01:13:51 +0100 Subject: Align subsurface logo correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The right hand side of the logo was slightly off of the left orientation line for the rest of the layout. This changes it to Units.smallSpacing, which is used for this kind of spacing. Signed-off-by: Sebastian Kügler --- qt-mobile/qml/TopBar.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-mobile/qml/TopBar.qml') diff --git a/qt-mobile/qml/TopBar.qml b/qt-mobile/qml/TopBar.qml index 0dd9751a1..27fa00604 100644 --- a/qt-mobile/qml/TopBar.qml +++ b/qt-mobile/qml/TopBar.qml @@ -21,9 +21,9 @@ Rectangle { anchors.bottom: topPart.bottom anchors.bottomMargin: MobileComponents.Units.smallSpacing anchors.left: topPart.left - anchors.leftMargin: MobileComponents.Units.largeSpacing / 2 + anchors.leftMargin: MobileComponents.Units.smallSpacing anchors.right: topPart.right - anchors.rightMargin: MobileComponents.Units.largeSpacing / 2 + anchors.rightMargin: MobileComponents.Units.smallSpacing Item { Layout.preferredHeight: subsurfaceLogo.height Rectangle { color: "green"; anchors.fill: parent; } -- cgit v1.2.3-70-g09d2