Skip to content

Commit 6156234

Browse files
committed
Mobile UI improvements
1 parent b164337 commit 6156234

3 files changed

Lines changed: 28 additions & 13 deletions

File tree

‎qml/MobileApplication.qml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import QtQuick
2-
import QtQuick.Controls
32
import QtQuick.Window
3+
import QtQuick.Controls
44

55
import ComponentLibrary
66
import WatchFlower
@@ -125,7 +125,7 @@ Window {
125125
screenPaddingNavbar = 0
126126
}
127127
if (appWindow.flags & Qt.MaximizeUsingFullscreenGeometryHint) {
128-
if (mobileUI.isPhone) {
128+
if (appWindow.isPhone) {
129129
if (Screen.orientation === Qt.LandscapeOrientation) {
130130
screenPaddingLeft = screenPaddingStatusbar
131131
screenPaddingRight = screenPaddingNavbar

‎qml/MobileHeader.qml‎

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import QtQuick
22
import QtQuick.Layouts
33

44
import ComponentLibrary
5-
import WatchFlower
65

76
Rectangle {
87
id: appHeader
@@ -11,16 +10,20 @@ Rectangle {
1110
anchors.left: parent.left
1211
anchors.right: parent.right
1312

14-
height: headerHeight + Math.max(screenPaddingStatusbar, screenPaddingTop)
13+
height: headerFullHeight
1514
color: Theme.colorHeader
1615
clip: true
1716
z: 10
1817

19-
property int headerHeight: 52
18+
property int headerFullHeight: headerHeight + Math.max(screenPaddingStatusbar, screenPaddingTop) - (headerUnicolor ? 12 : 0)
19+
20+
property bool headerUnicolor: (Theme.colorHeader === Theme.colorStatusbar)
21+
22+
property int headerHeight: 56 // vertical
2023

2124
property int headerPosition: 56 // horizontal
2225

23-
property string headerTitle: "WatchFlower"
26+
property string headerTitle: utilsApp.appName()
2427

2528
property string headerSubTitle: ""
2629

@@ -32,11 +35,11 @@ Rectangle {
3235
property string rightMenuMode: "off" // on / off
3336
signal rightMenuClicked()
3437

35-
////////////////////////////////////////////////////////////////////////////
36-
3738
function rightMenuIsOpen() { return actionMenu.visible; }
3839
function rightMenuClose() { actionMenu.close(); }
3940

41+
////////////////////////////////////////////////////////////////////////////
42+
4043
signal deviceRebootButtonClicked()
4144
signal deviceCalibrateButtonClicked()
4245
signal deviceWateringButtonClicked()
@@ -72,13 +75,18 @@ Rectangle {
7275

7376
height: Math.max(screenPaddingStatusbar, screenPaddingTop)
7477
color: Theme.colorStatusbar
78+
visible: !appHeader.headerUnicolor
7579
}
7680

7781
Item {
78-
anchors.fill: parent
79-
anchors.topMargin: Math.max(screenPaddingStatusbar, screenPaddingTop)
82+
anchors.left: parent.left
8083
anchors.leftMargin: screenPaddingLeft
84+
anchors.right: parent.right
8185
anchors.rightMargin: screenPaddingRight
86+
anchors.bottom: parent.bottom
87+
anchors.bottomMargin: appHeader.headerUnicolor ? -4 : 0
88+
89+
height: appHeader.headerHeight
8290

8391
////////////
8492

@@ -167,6 +175,8 @@ Rectangle {
167175

168176
spacing: 4
169177

178+
////
179+
170180
Item { // right indicator
171181
width: appHeader.headerHeight
172182
height: appHeader.headerHeight
@@ -178,8 +188,8 @@ Rectangle {
178188

179189
IconSvg {
180190
id: workingIndicator
181-
width: 24; height: 24;
182191
anchors.centerIn: parent
192+
width: 24; height: 24;
183193

184194
source: {
185195
if (deviceManager.scanning)
@@ -216,6 +226,8 @@ Rectangle {
216226
}
217227
}
218228

229+
////
230+
219231
MouseArea { // right button
220232
width: appHeader.headerHeight
221233
height: appHeader.headerHeight
@@ -226,7 +238,7 @@ Rectangle {
226238
appContent.state === "DeviceEnvironmental"))
227239

228240
onClicked: {
229-
rightMenuClicked()
241+
appHeader.rightMenuClicked()
230242
actionMenu.open()
231243
}
232244

@@ -248,6 +260,8 @@ Rectangle {
248260
color: Theme.colorHeaderContent
249261
}
250262
}
263+
264+
////
251265
}
252266

253267
////////////

‎qml/ScreenAbout.qml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ Loader {
277277

278278
text: qsTr("Rate the application")
279279
source: "qrc:/IconLibrary/material-symbols/stars-fill.svg"
280+
sourceSize: 28
280281
indicatorSource: "qrc:/IconLibrary/material-icons/duotone/launch.svg"
281282

282283
onClicked: {
@@ -341,7 +342,7 @@ Loader {
341342

342343
text: qsTr("About app permissions")
343344
source: "qrc:/IconLibrary/material-symbols/flaky.svg"
344-
sourceSize: 24
345+
sourceSize: 26
345346
indicatorSource: "qrc:/IconLibrary/material-symbols/chevron_right.svg"
346347

347348
onClicked: screenAboutPermissions.loadScreenFrom("ScreenAbout")

0 commit comments

Comments
 (0)