From 753b8776d65da91e3aee346264f3a6e2ad9acaab Mon Sep 17 00:00:00 2001 From: Mohsen Date: Fri, 10 Jan 2025 14:18:58 +0330 Subject: [PATCH] Labeled redo, undo icons + other changes. Rename project variables to variables. Move the separator to sit above about QField. Move the lock screen to sit below message log. Add icons for message log and variables. Add a undo/redo label before the undo/redo buttons. Modify digitizing switch background color. --- images/images.qrc | 1 + .../qfield/nodpi/ic_expression_24dp.svg | 1 + src/qml/DashBoard.qml | 8 +- src/qml/qgismobileapp.qml | 105 ++++++++++-------- 4 files changed, 66 insertions(+), 49 deletions(-) create mode 100644 images/themes/qfield/nodpi/ic_expression_24dp.svg diff --git a/images/images.qrc b/images/images.qrc index 00905f2776..6449dd6214 100644 --- a/images/images.qrc +++ b/images/images.qrc @@ -172,5 +172,6 @@ themes/qfield/nodpi/ic_egeniouss_receiver_black_24dp.svg themes/qfield/nodpi/ic_location_tracking_white_24dp.svg themes/qfield/nodpi/ic_tune_24dp.svg + themes/qfield/nodpi/ic_expression_24dp.svg diff --git a/images/themes/qfield/nodpi/ic_expression_24dp.svg b/images/themes/qfield/nodpi/ic_expression_24dp.svg new file mode 100644 index 0000000000..65ebe80b22 --- /dev/null +++ b/images/themes/qfield/nodpi/ic_expression_24dp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/qml/DashBoard.qml b/src/qml/DashBoard.qml index 8e5d751e26..f4c6aa462e 100644 --- a/src/qml/DashBoard.qml +++ b/src/qml/DashBoard.qml @@ -374,8 +374,8 @@ Drawer { implicitWidth: 36 * 2 x: modeSwitch.leftPadding radius: 4 - color: "#66212121" - border.color: "#44FFFFFF" + color: "#24212121" + border.color: "#14FFFFFF" anchors.verticalCenter: parent.verticalCenter Image { width: 28 @@ -386,7 +386,7 @@ Drawer { source: Theme.getThemeVectorIcon('ic_map_white_24dp') sourceSize.width: parent.height * screen.devicePixelRatio sourceSize.height: parent.width * screen.devicePixelRatio - opacity: 0.4 + opacity: 0.6 } Image { width: 28 @@ -397,7 +397,7 @@ Drawer { source: Theme.getThemeVectorIcon('ic_create_white_24dp') sourceSize.width: parent.height * screen.devicePixelRatio sourceSize.height: parent.width * screen.devicePixelRatio - opacity: 0.4 + opacity: 0.6 } Rectangle { x: modeSwitch.checked ? parent.width - width : 0 diff --git a/src/qml/qgismobileapp.qml b/src/qml/qgismobileapp.qml index 5998cfb6be..2c656475d0 100644 --- a/src/qml/qgismobileapp.qml +++ b/src/qml/qgismobileapp.qml @@ -17,7 +17,9 @@ import QtCore import QtQuick import QtQuick.Controls +import QtQuick.Controls.impl import QtQuick.Controls.Material +import QtQuick.Controls.Material.impl import QtQuick.Effects import QtQuick.Shapes import QtQuick.Window @@ -2419,46 +2421,25 @@ ApplicationWindow { return Math.max(toolbarWidth, result + padding); } - Row { + Item { id: mainMenuActionsToolbar objectName: "mainMenuActionsToolbar" - leftPadding: 2 - rightPadding: 2 - spacing: 2 height: 40 clip: true property color hoveredColor: Qt.hsla(Theme.mainTextColor.hslHue, Theme.mainTextColor.hslSaturation, Theme.mainTextColor.hslLightness, 0.2) - QfToolButton { - anchors.verticalCenter: parent.verticalCenter - height: 48 - width: 48 - round: true - iconSource: Theme.getThemeVectorIcon("ic_lock_black_24dp") - iconColor: Theme.mainTextColor - bgcolor: hovered ? parent.hoveredColor : "#00ffffff" - - onClicked: { - mainMenu.close(); - dashBoard.close(); - screenLocker.enabled = true; - } - } - - QfToolButton { + MenuItem { id: undoButton - property bool isEnabled: featureHistory && featureHistory.isUndoAvailable - anchors.verticalCenter: parent.verticalCenter + enabled: featureHistory && featureHistory.isUndoAvailable height: 48 - width: 48 - round: true - iconSource: Theme.getThemeVectorIcon("ic_undo_black_24dp") - iconColor: isEnabled ? Theme.mainTextColor : Theme.mainTextDisabledColor - bgcolor: isEnabled && hovered ? parent.hoveredColor : "#00ffffff" + width: parent.width / 2 + anchors.left: parent.left + text: "Undo" + icon.source: Theme.getThemeVectorIcon("ic_undo_black_24dp") onClicked: { - if (isEnabled) { + if (enabled) { const msg = featureHistory.undoMessage(); if (featureHistory.undo()) { displayToast(msg); @@ -2469,19 +2450,35 @@ ApplicationWindow { } } - QfToolButton { + MenuSeparator { + width: 1 + height: parent.height + anchors.left: undoButton.right + } + + MenuItem { id: redoButton - property bool isEnabled: featureHistory && featureHistory.isRedoAvailable - anchors.verticalCenter: parent.verticalCenter + enabled: featureHistory && featureHistory.isRedoAvailable height: 48 - width: 48 - round: true - iconSource: Theme.getThemeVectorIcon("ic_redo_black_24dp") - iconColor: isEnabled ? Theme.mainTextColor : Theme.mainTextDisabledColor - bgcolor: isEnabled && hovered ? parent.hoveredColor : "#00ffffff" + width: parent.width / 2 + anchors.right: parent.right + text: "Redo" + icon.source: Theme.getThemeVectorIcon("ic_redo_black_24dp") + + contentItem: IconLabel { + leftPadding: 22 + spacing: redoButton.spacing + mirrored: true + display: redoButton.display + icon: redoButton.icon + text: redoButton.text + font: redoButton.font + color: Theme.mainTextColor + opacity: redoButton.enabled ? 1 : .35 + } onClicked: { - if (isEnabled) { + if (enabled) { const msg = featureHistory.redoMessage(); if (featureHistory.redo()) { displayToast(msg); @@ -2537,16 +2534,13 @@ ApplicationWindow { } } - MenuSeparator { - width: parent.width - } - MenuItem { - text: qsTr("Project Variables") + text: qsTr("Variables") font: Theme.defaultFont + icon.source: Theme.getThemeVectorIcon("ic_expression_24dp") height: 48 - leftPadding: Theme.menuItemIconlessLeftPadding + leftPadding: Theme.menuItemLeftPadding onTriggered: { dashBoard.close(); @@ -2562,7 +2556,8 @@ ApplicationWindow { font: Theme.defaultFont height: 48 - leftPadding: Theme.menuItemIconlessLeftPadding + icon.source: Theme.getThemeVectorIcon("ic_alert_black_24dp") + leftPadding: Theme.menuItemLeftPadding onTriggered: { dashBoard.close(); @@ -2571,6 +2566,26 @@ ApplicationWindow { } } + MenuSeparator { + width: parent.width + } + + MenuItem { + text: qsTr("Lock Screen") + + font: Theme.defaultFont + icon.source: Theme.getThemeVectorIcon("ic_lock_black_24dp") + height: 48 + leftPadding: Theme.menuItemLeftPadding + rightPadding: 40 + + onTriggered: { + mainMenu.close(); + dashBoard.close(); + screenLocker.enabled = true; + } + } + MenuItem { text: qsTr("About QField")