From 78d5325dda8eadee8004183314195f2d61ffeb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Sun, 29 Nov 2015 23:39:14 +0100 Subject: [PATCH] Simplify dive list items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace the custom text items with the Components' label - Remove now unneeded properties The goal is to use less different font sizes, as to give the listview a calmer and more uniform look. Signed-off-by: Sebastian Kügler --- qt-mobile/qml/DiveDetails.qml | 14 ++++++------ qt-mobile/qml/DiveList.qml | 43 +++++++++++++---------------------- qt-mobile/qml/main.qml | 2 +- 3 files changed, 24 insertions(+), 35 deletions(-) diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml index 7729e7fa5..a905064d7 100644 --- a/qt-mobile/qml/DiveDetails.qml +++ b/qt-mobile/qml/DiveDetails.qml @@ -89,7 +89,7 @@ MobileComponents.Page { } } } - Label { + MobileComponents.Label { text: "Location:" } TextField { @@ -97,7 +97,7 @@ MobileComponents.Page { Layout.fillWidth: true } - Label { + MobileComponents.Label { text: "Air Temp:" } TextField { @@ -106,7 +106,7 @@ MobileComponents.Page { Layout.fillWidth: true } - Label { + MobileComponents.Label { text: "Water Temp:" } TextField { @@ -115,7 +115,7 @@ MobileComponents.Page { Layout.fillWidth: true } - Label { + MobileComponents.Label { text: "Suit:" } @@ -125,7 +125,7 @@ MobileComponents.Page { Layout.fillWidth: true } - Label { + MobileComponents.Label { text: "Buddy:" } TextField { @@ -134,7 +134,7 @@ MobileComponents.Page { Layout.fillWidth: true } - Label { + MobileComponents.Label { text: "Dive Master:" } TextField { @@ -143,7 +143,7 @@ MobileComponents.Page { Layout.fillWidth: true } - Label { + MobileComponents.Label { text: "Notes:" } TextEdit{ diff --git a/qt-mobile/qml/DiveList.qml b/qt-mobile/qml/DiveList.qml index 75f4f809e..ed75c96f8 100644 --- a/qt-mobile/qml/DiveList.qml +++ b/qt-mobile/qml/DiveList.qml @@ -39,22 +39,15 @@ MobileComponents.Page { stackView.push(detailsWindow) } - //Layout of the page: (mini profile, dive no, date at the top - //And other details at the bottom. Item { - x: MobileComponents.Units.smallSpacing + x: -1 * MobileComponents.Units.smallSpacing width: parent.width - MobileComponents.Units.smallSpacing * 2 - height: childrenRect.height + MobileComponents.Units.smallSpacing * 2 - //spacing: MobileComponents.Units.smallSpacing / 2 - anchors.margins: MobileComponents.Units.smallSpacing + height: childrenRect.height - MobileComponents.Units.smallSpacing - Text { + MobileComponents.Label { id: locationText text: location - color: MobileComponents.Theme.textColor - //font.pointSize: Math.round(MobileComponents.Units.fontMetrics.pointSize * 1.2) // why this doesn't work is a mystery to me, so ... - scale: 1.2 // Let's see how this works, otherwise, we'll need the default point size somewhere - transformOrigin: Item.TopLeft + font.weight: Font.Light elide: Text.ElideRight maximumLineCount: 1 // needed for elide to work at all anchors { @@ -63,16 +56,14 @@ MobileComponents.Page { right: dateLabel.left } } - Text { + MobileComponents.Label { id: dateLabel text: date opacity: 0.6 - color: MobileComponents.Theme.textColor font.pointSize: subsurfaceTheme.smallPointSize anchors { right: parent.right top: parent.top - bottomMargin: MobileComponents.Units.smallSpacing / 2 } } Row { @@ -82,36 +73,34 @@ MobileComponents.Page { right: parent.right bottom: numberText.bottom } - Text { + MobileComponents.Label { text: 'Depth: ' opacity: 0.6 - color: MobileComponents.Theme.textColor + font.pointSize: subsurfaceTheme.smallPointSize } - Text { + MobileComponents.Label { text: depth width: Math.max(MobileComponents.Units.gridUnit * 3, paintedWidth) // helps vertical alignment throughout listview - color: MobileComponents.Theme.textColor + font.pointSize: subsurfaceTheme.smallPointSize } - Text { + MobileComponents.Label { text: 'Duration: ' opacity: 0.6 - color: MobileComponents.Theme.textColor + font.pointSize: subsurfaceTheme.smallPointSize } - Text { + MobileComponents.Label { text: duration - color: MobileComponents.Theme.textColor + font.pointSize: subsurfaceTheme.smallPointSize } } - Text { + MobileComponents.Label { id: numberText text: "#" + diveNumber color: MobileComponents.Theme.textColor - scale: 1.2 - transformOrigin: Item.BottomRight - opacity: 0.4 + font.pointSize: subsurfaceTheme.smallPointSize + opacity: 0.6 anchors { right: parent.right - topMargin: MobileComponents.Units.smallSpacing top: locationText.bottom } } diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml index 26b8ed0e6..dd1999e03 100644 --- a/qt-mobile/qml/main.qml +++ b/qt-mobile/qml/main.qml @@ -111,7 +111,7 @@ MobileComponents.ApplicationWindow { QtObject { id: subsurfaceTheme property int titlePointSize: Math.round(fontMetrics.font.pointSize * 1.5) - property int smallPointSize: Math.round(fontMetrics.font.pointSize * 0.7) + property int smallPointSize: Math.round(fontMetrics.font.pointSize * 0.8) property color accentColor: "#2d5b9a" property color accentTextColor: "#ececec" }