Skip to content

Commit

Permalink
Labeled redo, undo icons + other changes.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mohsenD98 committed Jan 10, 2025
1 parent a677695 commit 753b877
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 49 deletions.
1 change: 1 addition & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@
<file>themes/qfield/nodpi/ic_egeniouss_receiver_black_24dp.svg</file>
<file>themes/qfield/nodpi/ic_location_tracking_white_24dp.svg</file>
<file>themes/qfield/nodpi/ic_tune_24dp.svg</file>
<file>themes/qfield/nodpi/ic_expression_24dp.svg</file>
</qresource>
</RCC>
1 change: 1 addition & 0 deletions images/themes/qfield/nodpi/ic_expression_24dp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/qml/DashBoard.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
105 changes: 60 additions & 45 deletions src/qml/qgismobileapp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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")

Expand Down

0 comments on commit 753b877

Please sign in to comment.