From 7b98aaefb5aeff2f73538cd97156796bee023a07 Mon Sep 17 00:00:00 2001 From: Tomas Mizera Date: Tue, 19 Dec 2023 00:30:13 +0100 Subject: [PATCH 1/3] Add map toolbar icons --- app/icons/Add.svg | 4 ++++ app/icons/Home.svg | 3 +++ app/icons/Layers.svg | 5 +++++ app/icons/LocalChanges.svg | 7 +++++++ app/icons/MapThemes.svg | 5 +++++ app/icons/PositionTracking.svg | 6 ++++++ app/icons/Settings.svg | 4 ++++ app/icons/Sync.svg | 8 ++++---- app/icons/SyncGreen.svg | 6 ++++++ app/icons/ZoomToProject.svg | 9 +++++++++ app/icons/icons.qrc | 11 ++++++++++- app/mmstyle.h | 18 ++++++++++++++++++ 12 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 app/icons/Add.svg create mode 100644 app/icons/Home.svg create mode 100644 app/icons/Layers.svg create mode 100644 app/icons/LocalChanges.svg create mode 100644 app/icons/MapThemes.svg create mode 100644 app/icons/PositionTracking.svg create mode 100644 app/icons/Settings.svg create mode 100644 app/icons/SyncGreen.svg create mode 100644 app/icons/ZoomToProject.svg diff --git a/app/icons/Add.svg b/app/icons/Add.svg new file mode 100644 index 000000000..827098740 --- /dev/null +++ b/app/icons/Add.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/icons/Home.svg b/app/icons/Home.svg new file mode 100644 index 000000000..7326bb2b1 --- /dev/null +++ b/app/icons/Home.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/icons/Layers.svg b/app/icons/Layers.svg new file mode 100644 index 000000000..d43d4c4c1 --- /dev/null +++ b/app/icons/Layers.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/app/icons/LocalChanges.svg b/app/icons/LocalChanges.svg new file mode 100644 index 000000000..2a270a01a --- /dev/null +++ b/app/icons/LocalChanges.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app/icons/MapThemes.svg b/app/icons/MapThemes.svg new file mode 100644 index 000000000..9d77b4047 --- /dev/null +++ b/app/icons/MapThemes.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/app/icons/PositionTracking.svg b/app/icons/PositionTracking.svg new file mode 100644 index 000000000..3cfeaf406 --- /dev/null +++ b/app/icons/PositionTracking.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/icons/Settings.svg b/app/icons/Settings.svg new file mode 100644 index 000000000..d18a770eb --- /dev/null +++ b/app/icons/Settings.svg @@ -0,0 +1,4 @@ + + + + diff --git a/app/icons/Sync.svg b/app/icons/Sync.svg index 9fa37fa99..e90c9b81d 100644 --- a/app/icons/Sync.svg +++ b/app/icons/Sync.svg @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/app/icons/SyncGreen.svg b/app/icons/SyncGreen.svg new file mode 100644 index 000000000..9fa37fa99 --- /dev/null +++ b/app/icons/SyncGreen.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/icons/ZoomToProject.svg b/app/icons/ZoomToProject.svg new file mode 100644 index 000000000..7053c71ae --- /dev/null +++ b/app/icons/ZoomToProject.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/app/icons/icons.qrc b/app/icons/icons.qrc index 567c5a10c..37ac51f4c 100644 --- a/app/icons/icons.qrc +++ b/app/icons/icons.qrc @@ -2,6 +2,7 @@ AcceptInvitationImage.svg AcceptInvitationLogoImage.svg + Add.svg Archaeology.svg ArrowDown.svg ArrowLinkRight.svg @@ -22,16 +23,22 @@ Environmental.svg Error.svg Facebook.svg + Globe.svg Hide.svg + Home.svg Info.svg + Layers.svg Linkedin.svg + LocalChanges.svg Mastodon.svg + MapThemes.svg More.svg MorePhotos.svg Mouth.svg NaturalResources.svg Other.svg Others.svg + PositionTracking.svg ProjectButtonMore.svg QGIS.svg QRCode.svg @@ -40,10 +47,12 @@ Search.svg Show.svg SocialMedia.svg + Settings.svg StateAndLocal.svg Stop.svg Subscriptions.svg Sync.svg + SyncGreen.svg Teacher.svg Telecommunication.svg Terms.svg @@ -55,6 +64,6 @@ XMark.svg XTwitter.svg Youtube.svg - Globe.svg + ZoomToProject.svg diff --git a/app/mmstyle.h b/app/mmstyle.h index e8f0d414e..51a60e91c 100644 --- a/app/mmstyle.h +++ b/app/mmstyle.h @@ -80,6 +80,14 @@ class MMStyle: public QObject Q_PROPERTY( QColor shadowColor READ shadowColor CONSTANT ) // Icons + Q_PROPERTY( QUrl addIcon READ addIcon CONSTANT ) + Q_PROPERTY( QUrl homeIcon READ homeIcon CONSTANT ) + Q_PROPERTY( QUrl layersIcon READ layersIcon CONSTANT ) + Q_PROPERTY( QUrl localChangesIcon READ localChangesIcon CONSTANT ) + Q_PROPERTY( QUrl mapThemesIcon READ mapThemesIcon CONSTANT ) + Q_PROPERTY( QUrl positionTrackingIcon READ positionTrackingIcon CONSTANT ) + Q_PROPERTY( QUrl zoomToProjectIcon READ zoomToProjectIcon CONSTANT ) + Q_PROPERTY( QUrl settingsIcon READ settingsIcon CONSTANT ) Q_PROPERTY( QUrl archaeologyIcon READ archaeologyIcon CONSTANT ) Q_PROPERTY( QUrl arrowDownIcon READ arrowDownIcon CONSTANT ) Q_PROPERTY( QUrl arrowLinkRightIcon READ arrowLinkRightIcon CONSTANT ) @@ -121,6 +129,7 @@ class MMStyle: public QObject Q_PROPERTY( QUrl stopIcon READ stopIcon CONSTANT ) Q_PROPERTY( QUrl subscriptionsIcon READ subscriptionsIcon CONSTANT ) Q_PROPERTY( QUrl syncIcon READ syncIcon CONSTANT ) + Q_PROPERTY( QUrl syncGreenIcon READ syncGreenIcon CONSTANT ) Q_PROPERTY( QUrl teacherIcon READ teacherIcon CONSTANT ) Q_PROPERTY( QUrl telecommunicationIcon READ telecommunicationIcon CONSTANT ) Q_PROPERTY( QUrl termsIcon READ termsIcon CONSTANT ) @@ -204,6 +213,14 @@ class MMStyle: public QObject QColor errorBgInputColor() {return QColor::fromString( "#FEFAF9" );} QColor shadowColor() {return QColor::fromString( "#66777777" );} + QUrl addIcon() {return QUrl( "qrc:/Add.svg" );} + QUrl layersIcon() {return QUrl( "qrc:/Layers.svg" );} + QUrl homeIcon() {return QUrl( "qrc:/Home.svg" );} + QUrl localChangesIcon() {return QUrl( "qrc:/LocalChanges.svg" );} + QUrl mapThemesIcon() {return QUrl( "qrc:/MapThemes.svg" );} + QUrl positionTrackingIcon() {return QUrl( "qrc:/PositionTracking.svg" );} + QUrl settingsIcon() {return QUrl( "qrc:/Settings.svg" );} + QUrl zoomToProjectIcon() {return QUrl( "qrc:/ZoomToProject.svg" );} QUrl archaeologyIcon() {return QUrl( "qrc:/Archaeology.svg" );} QUrl arrowDownIcon() {return QUrl( "qrc:/ArrowDown.svg" );} QUrl arrowLinkRightIcon() {return QUrl( "qrc:/ArrowLinkRight.svg" );} @@ -246,6 +263,7 @@ class MMStyle: public QObject QUrl stopIcon() {return QUrl( "qrc:/Stop.svg" );} QUrl subscriptionsIcon() {return QUrl( "qrc:/Subscriptions.svg" );} QUrl syncIcon() {return QUrl( "qrc:/Sync.svg" );} + QUrl syncGreenIcon() {return QUrl( "qrc:/SyncGreen.svg" );} QUrl teacherIcon() {return QUrl( "qrc:/Teacher.svg" );} QUrl telecommunicationIcon() {return QUrl( "qrc:/Telecommunication.svg" );} QUrl termsIcon() {return QUrl( "qrc:/Terms.svg" );} From 5ced56e44e948af088c286280f2914b022dc7ec4 Mon Sep 17 00:00:00 2001 From: Tomas Mizera Date: Tue, 19 Dec 2023 00:30:37 +0100 Subject: [PATCH 2/3] Replace old mainPanel with map toolbar --- app/qml/CMakeLists.txt | 1 - app/qml/MainPanel.qml | 483 --------------------------- app/qml/components/MMProjectItem.qml | 2 +- app/qml/main.qml | 149 +++++---- app/qml/map/MapWrapper.qml | 6 +- 5 files changed, 92 insertions(+), 549 deletions(-) delete mode 100644 app/qml/MainPanel.qml diff --git a/app/qml/CMakeLists.txt b/app/qml/CMakeLists.txt index 90530fae1..aff569746 100644 --- a/app/qml/CMakeLists.txt +++ b/app/qml/CMakeLists.txt @@ -153,7 +153,6 @@ set(MM_QML InputStyle.qml LogPanel.qml LoginForm.qml - MainPanel.qml ManageInvitationsPage.qml MapThemePanel.qml Notification.qml diff --git a/app/qml/MainPanel.qml b/app/qml/MainPanel.qml deleted file mode 100644 index f351e4a42..000000000 --- a/app/qml/MainPanel.qml +++ /dev/null @@ -1,483 +0,0 @@ -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -import QtQuick -import QtQuick.Controls -import QtQuick.Dialogs -import QtQuick.Layouts - -import "." // import InputStyle singleton -import "./components" - -Item { - signal openProjectClicked() - signal myLocationClicked() - signal myLocationHold() - signal recordClicked() - signal openMapThemesClicked() - signal openSettingsClicked() - signal zoomToProject() - signal localChangesClicked() - signal layersClicked() - signal positionTrackingClicked() - - property real itemSize: mainPanel.height * 0.8 - property color gpsIndicatorColor: InputStyle.softRed - - id: mainPanel - focus: true - - Rectangle { - anchors.fill: parent - color: InputStyle.clrPanelBackground - opacity: InputStyle.panelOpacity - } - - Row { - id: panelRow - anchors.fill: parent - height: mainPanel.itemSize - property real itemWidth: mainPanel.height * 1.2 - property int minItemNumber: 4 - property int itemsToShow: { - var possibleItems = Math.min((width / panelRow.itemWidth), children.length) - 1 - - if ( minItemNumber >= possibleItems ) - { - return minItemNumber - } - - // subtract invisible dynamic buttons (e.g. when tracking is not supported ) - - if ( !__activeProject.positionTrackingSupported ) - { - // and if there is enough size to show the button - if ( possibleItems > trackingItem.positionInPanel ) - { - possibleItems -= 1 - } - } - - return possibleItems - } - property real calculatedItemWidth: itemsToShow ? parent.width/itemsToShow : parent.width - - Item { - id: openProjectsItem - height: parent.height - visible: panelRow.itemsToShow > 1 - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - id: openProjectBtn - width: mainPanel.itemSize - text: qsTr("Projects") - imageSource: InputStyle.projectIcon - - onActivated: { - rootMenu.close() - mainPanel.openProjectClicked() - } - } - } - - Item { - id: myLocationItem - height: parent.height - visible: panelRow.itemsToShow > 2 - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - id: myLocationBtn - width: mainPanel.itemSize - - text: qsTr("GPS") - imageSource: InputStyle.gpsFixedIcon - imageSource2: InputStyle.gpsNotFixedIcon - imageSourceCondition: __appSettings.autoCenterMapChecked - - onActivated: { - rootMenu.close() - mainPanel.myLocationClicked() - } - - onActivatedOnHold: { - rootMenu.close() - mainPanel.myLocationHold() - } - - RoundIndicator { - width: parent.height/4 - height: width - anchors.right: parent.right - anchors.top: parent.top - color: gpsIndicatorColor - } - } - } - - Item { - id: recItem - height: parent.height - visible: panelRow.itemsToShow > 3 - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - id: recBtn - - width: mainPanel.itemSize - text: qsTr("Record") - imageSource: InputStyle.recordIcon - - onActivated: { - rootMenu.close() - mainPanel.recordClicked() - } - } - } - - Item { - id: zoomToProjectItem - height: parent.height - visible: panelRow.itemsToShow > 4 - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - - id: zoomToProjectBtn - width: mainPanel.itemSize - text: qsTr("Zoom to project") - imageSource: InputStyle.zoomToProjectIcon - - onActivated: { - rootMenu.close() - mainPanel.zoomToProject() - } - } - } - - Item { - id: localChangesItem - height: parent.height - visible: panelRow.itemsToShow > 5 - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - id: localChangesBtn - width: mainPanel.itemSize - text: qsTr("Local changes") - imageSource: InputStyle.projectIcon - - onActivated: { - rootMenu.close() - mainPanel.localChangesClicked() - } - } - } - - Item { - id: layersItem - height: parent.height - visible: panelRow.itemsToShow > 6 - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - id: layersBtn - width: mainPanel.itemSize - text: qsTr("Layers") - imageSource: InputStyle.mapSearchIcon - - onActivated: { - rootMenu.close() - mainPanel.layersClicked() - } - } - } - - Item { - id: mapThemesItem - height: parent.height - visible: panelRow.itemsToShow > 7 - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - - id: mapThemesBtn - width: mainPanel.itemSize - text: qsTr("Map themes") - imageSource: InputStyle.mapThemesIcon - onActivated: { - rootMenu.close() - mainPanel.openMapThemesClicked() - } - } - } - - Item { - id: trackingItem - - property int positionInPanel: 8 - - height: parent.height - visible: panelRow.itemsToShow > positionInPanel && __activeProject.positionTrackingSupported - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - id: trackingItemBtn - - width: mainPanel.itemSize - text: qsTr("Position tracking") - imageSource: InputStyle.trackingIcon - onActivated: { - rootMenu.close() - mainPanel.positionTrackingClicked() - } - } - } - - // Last item - Item { - id: settingsItem - height: parent.height - visible: panelRow.itemsToShow > 9 - width: visible ? panelRow.calculatedItemWidth : 0 - - MainPanelButton { - - id: settingsBtn - width: mainPanel.itemSize - text: qsTr("Settings") - imageSource: InputStyle.settingsIcon - onActivated: { - rootMenu.close() - mainPanel.openSettingsClicked() - } - } - } - - Item { - width: panelRow.calculatedItemWidth - height: parent.height - visible: !settingsItem.visible - - MainPanelButton { - id: menuBtn - width: mainPanel.itemSize - text: qsTr("More") - imageSource: InputStyle.moreMenuIcon - - onActivated: { - if ( !rootMenu.visible ) rootMenu.open() - else rootMenu.close() - } - } - } - } - - Menu { - id: rootMenu - title: qsTr("Menu") - x:parent.width - rootMenu.width - y: -rootMenu.height - width: parent.width < 300 * __dp ? parent.width : 300 * __dp - closePolicy: Popup.CloseOnReleaseOutsideParent | Popup.CloseOnEscape - - MenuItem { - width: parent.width - visible: !openProjectsItem.visible - height: visible ? mainPanel.itemSize : 0 - - ExtendedMenuItem { - height: mainPanel.itemSize - rowHeight: height - width: parent.width - contentText: qsTr("Projects") - imageSource: InputStyle.projectIcon - } - - onClicked: { - openProjectBtn.activated() - rootMenu.close() - } - } - - MenuItem { - width: parent.width - visible: !myLocationItem.visible - height: visible ? mainPanel.itemSize : 0 - - ExtendedMenuItem { - height: mainPanel.itemSize - rowHeight: height - width: parent.width - contentText: qsTr("GPS") - imageSource: __appSettings.autoCenterMapChecked ? InputStyle.gpsFixedIcon : InputStyle.gpsNotFixedIcon - - RoundIndicator { - width: parent.height/4 - height: width - anchors.left: parent.left - anchors.top: parent.top - anchors.margins : parent.height/8 - color: gpsIndicatorColor - } - } - - onClicked: { - myLocationBtn.activated() - rootMenu.close() - } - onPressAndHold: mainPanel.myLocationHold() - } - - MenuItem { - width: parent.width - visible: !recItem.visible - height: visible ? mainPanel.itemSize : 0 - - ExtendedMenuItem { - height: mainPanel.itemSize - rowHeight: height - width: parent.width - contentText: qsTr("Record") - imageSource: InputStyle.recordIcon - } - - onClicked: { - recBtn.activated() - rootMenu.close() - } - } - - MenuItem { - width: parent.width - visible: !zoomToProjectItem.visible - height: visible ? mainPanel.itemSize : 0 - - ExtendedMenuItem { - height: mainPanel.itemSize - rowHeight: height - width: parent.width - contentText: qsTr("Zoom to project") - imageSource: InputStyle.zoomToProjectIcon - } - - onClicked: { - zoomToProjectBtn.activated() - rootMenu.close() - } - } - - MenuItem { - width: parent.width - visible: !localChangesItem.visible - height: visible ? mainPanel.itemSize : 0 - - ExtendedMenuItem { - height: mainPanel.itemSize - rowHeight: height - width: parent.width - contentText: qsTr("Local changes") - imageSource: InputStyle.projectIcon - } - - onClicked: { - localChangesBtn.activated() - rootMenu.close() - } - } - - MenuItem { - width: parent.width - visible: !layersItem.visible - height: visible ? mainPanel.itemSize : 0 - - ExtendedMenuItem { - height: mainPanel.itemSize - rowHeight: height - width: parent.width - contentText: qsTr("Layers") - imageSource: InputStyle.mapSearchIcon - } - - onClicked: { - layersBtn.activated() - rootMenu.close() - } - } - - MenuItem { - width: parent.width - visible: !mapThemesItem.visible - height: visible ? mainPanel.itemSize : 0 - - ExtendedMenuItem { - height: mainPanel.itemSize - rowHeight: height - width: parent.width - contentText: qsTr("Map themes") - imageSource: InputStyle.mapThemesIcon - } - - onClicked: { - mapThemesBtn.activated() - rootMenu.close() - } - } - - MenuItem { - width: parent.width - visible: !trackingItem.visible && __activeProject.positionTrackingSupported - height: visible ? mainPanel.itemSize : 0 - - ExtendedMenuItem { - height: mainPanel.itemSize - rowHeight: height - width: parent.width - contentText: qsTr("Position tracking") - imageSource: InputStyle.trackingIcon - } - - onClicked: { - mainPanel.positionTrackingClicked() - rootMenu.close() - } - } - - MenuItem { - visible: !settingsItem.visible - height: visible ? mainPanel.itemSize : 0 - width: parent.width - - ExtendedMenuItem { - anchors.fill: parent - rowHeight: parent.height - width: parent.width - contentText: qsTr("Settings") - imageSource: InputStyle.settingsIcon - } - - onClicked: { - settingsBtn.activated() - rootMenu.close() - } - } - } - - // Menu shadow - Rectangle { - x: rootMenu.x - y: rootMenu.y - width: rootMenu.width - height: rootMenu.height - layer.enabled: true - layer.effect: Shadow {} - visible: rootMenu.opened - } -} diff --git a/app/qml/components/MMProjectItem.qml b/app/qml/components/MMProjectItem.qml index 126394590..c5d1c4b5f 100644 --- a/app/qml/components/MMProjectItem.qml +++ b/app/qml/components/MMProjectItem.qml @@ -230,7 +230,7 @@ Rectangle { }, "sync": { "name": qsTr("Synchronize project"), - "iconSource": __style.syncIcon + "iconSource": __style.syncGreenIcon }, "changes": { "name": qsTr("Local changes"), diff --git a/app/qml/main.qml b/app/qml/main.qml index 2d38c9185..514e569c9 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -110,11 +110,6 @@ ApplicationWindow { stateManager.state = "projects" } - // get focus when any project is active, otherwise let focus to project panel - if ( __appSettings.activeProject ) - mainPanel.forceActiveFocus() - - // Catch back button click (if no other component catched it so far) // to prevent QT from quitting the APP immediately contentItem.Keys.released.connect( function( event ) { @@ -130,23 +125,23 @@ ApplicationWindow { MapWrapper { id: map - height: window.height - mainPanel.height + height: window.height - mapToolbar.height width: window.width mapExtentOffset: { // offset depends on what panels are visible. - // we need to subtract mainPanel (toolbar)'s height from any visible panel + // we need to subtract mapToolbar's height from any visible panel // because panels start at the bottom of the screen, but map canvas's height is lowered - // by mainPanels's height. + // by mapToolbar's height. if ( stakeoutPanelLoader.active ) { // if stakeout panel is opened - return stakeoutPanelLoader.item.panelHeight - mainPanel.height + return stakeoutPanelLoader.item.panelHeight - mapToolbar.height } else if ( formsStackManager.takenVerticalSpace > 0 ) { // if feature preview panel is opened - return formsStackManager.takenVerticalSpace - mainPanel.height + return formsStackManager.takenVerticalSpace - mapToolbar.height } return 0 @@ -252,69 +247,106 @@ ApplicationWindow { } } - MainPanel { - id: mainPanel + MMToolbar { + id: mapToolbar - width: window.width - height: InputStyle.rowHeightHeader - - y: window.height - height + anchors { + left: parent.left + bottom: parent.bottom + right: parent.right + } - visible: map.state === "view" + visible: map.state === "view" - gpsIndicatorColor: map.gpsIndicatorColor + model: ObjectModel { - onOpenProjectClicked: stateManager.state = "projects" - onOpenMapThemesClicked: { - mapThemesPanel.visible = true - stateManager.state = "misc" - } - onMyLocationClicked: { - if ( locationPermission.requestPermissionAsync() ) { - map.centerToPosition() + MMToolbarButton { + text: qsTr("Sync") + iconSource: __style.syncIcon + onClicked: { + __activeProject.requestSync() } } - onMyLocationHold: { - if ( locationPermission.requestPermissionAsync() ) { - __appSettings.autoCenterMapChecked = !__appSettings.autoCenterMapChecked - showMessage( __appSettings.autoCenterMapChecked ? qsTr("GPS auto-center mode on") : qsTr("GPS auto-center mode off") ) - } - } - onOpenSettingsClicked: settingsPanel.visible = true - onZoomToProject: { - if ( __appSettings.autoCenterMapChecked ) { - mainPanel.myLocationHold() - } - __inputUtils.zoomToProject( __activeProject.qgsProject, map.mapSettings ) - } - onRecordClicked: { + MMToolbarButton { + text: qsTr("Add") + iconSource: __style.addIcon + onClicked: { if ( __recordingLayersModel.rowCount() > 0 ) { stateManager.state = "map" map.record() - } else { - showMessage( qsTr( "No editable layers found." ) ) } + else { + showMessage( qsTr( "No editable layers found." ) ) + } + } } - onLocalChangesClicked: { - if ( __merginProjectStatusModel.loadProjectInfo( __activeProject.projectFullName() ) ) - { + + MMToolbarButton { + text: qsTr("Layers") + iconSource: __style.layersIcon + onClicked: { + stateManager.state = "misc" + let layerspanel = mapPanelsStackView.push( layersPanelComponent, {}, StackView.PushTransition ) + } + } + + MMToolbarButton { + text: qsTr("Back home") + iconSource: __style.homeIcon + onClicked: { stateManager.state = "projects" - projectPanel.openChangesPanel() } - else - { - __inputUtils.showNotification( qsTr( "No Changes" ) ) + } + + MMToolbarButton { + text: qsTr("Zoom to project") + iconSource: __style.zoomToProjectIcon + onClicked: { + __inputUtils.zoomToProject( __activeProject.qgsProject, map.mapSettings ) } } - onLayersClicked: { - stateManager.state = "misc" - let layerspanel = mapPanelsStackView.push( layersPanelComponent, {}, StackView.PushTransition ) + + MMToolbarButton { + text: qsTr("Map themes") + iconSource: __style.mapThemesIcon + onClicked: { + mapThemesPanel.visible = true + stateManager.state = "misc" + } + } + + MMToolbarButton { + text: qsTr("Position tracking") + iconSource: __style.positionTrackingIcon + onClicked: { + trackingPanelLoader.active = true + } + } + + MMToolbarButton { + text: qsTr("Local changes") + iconSource: __style.localChangesIcon + onClicked: { + if ( __merginProjectStatusModel.loadProjectInfo( __activeProject.projectFullName() ) ) + { + stateManager.state = "projects" + projectPanel.openChangesPanel() + } + else { + __inputUtils.showNotification( qsTr( "No Changes" ) ) + } + } } - onPositionTrackingClicked: { - trackingPanelLoader.active = true + MMToolbarButton { + text: qsTr("Settings") + iconSource: __style.settingsIcon + onClicked: { + settingsPanel.visible = true + } } + } } NotificationBanner { @@ -342,7 +374,6 @@ ApplicationWindow { stateManager.state = "misc" } else { - mainPanel.focus = true; // pass focus back to main panel stateManager.state = "map" } } @@ -362,9 +393,6 @@ ApplicationWindow { if ( projectPanel.visible ) { projectPanel.forceActiveFocus() } - else { - mainPanel.forceActiveFocus() - } } onOpenProjectRequested: function( projectPath ) { @@ -413,7 +441,6 @@ ApplicationWindow { LayersPanelV2 { onClose: function() { - mainPanel.forceActiveFocus() mapPanelsStackView.clear( StackView.PopTransition ) stateManager.state = "map" } @@ -445,7 +472,6 @@ ApplicationWindow { id: gpsDataPage onBack: { - mainPanel.focus = true gpsDataPageLoader.active = false } @@ -569,8 +595,6 @@ ApplicationWindow { onVisibleChanged: { if (projectIssuesPanel.visible) projectIssuesPanel.focus = true; // get focus - else - mainPanel.focus = true; // pass focus back to main panel } } @@ -719,7 +743,6 @@ ApplicationWindow { } else { stateManager.state = "map" - mainPanel.focus = true } map.hideHighlight() diff --git a/app/qml/map/MapWrapper.qml b/app/qml/map/MapWrapper.qml index a66a01904..25009a71f 100644 --- a/app/qml/map/MapWrapper.qml +++ b/app/qml/map/MapWrapper.qml @@ -573,6 +573,10 @@ Item { // Find out if sync would collide with acc button // based on distance between them + + // TODO: Change to GPS button + design + visible: false + function wouldCollideWithAccBtn() { let accBtnRightMostX = accuracyButton.x + accuracyButton.width @@ -592,7 +596,7 @@ Item { anchors.right: parent.right anchors.rightMargin: InputStyle.smallGap - visible: root.state === "view" +// visible: root.state === "view" content: Item { From 7d1009baa17557642edf57af4165198bebab1c09 Mon Sep 17 00:00:00 2001 From: Tomas Mizera Date: Tue, 19 Dec 2023 00:30:50 +0100 Subject: [PATCH 3/3] Fix naming of property in MMIcon --- app/qml/components/MMIcon.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/qml/components/MMIcon.qml b/app/qml/components/MMIcon.qml index eb8c24de1..959364411 100644 --- a/app/qml/components/MMIcon.qml +++ b/app/qml/components/MMIcon.qml @@ -14,7 +14,7 @@ Item { id: control property alias source: icon.source - property alias color: color.color + property alias color: overlay.color width: icon.implicitWidth height: icon.implicitHeight @@ -27,7 +27,7 @@ Item { } ColorOverlay { - id: color + id: overlay anchors.fill: icon source: icon