Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add topological editing toggle button (in edit mode) #939

Merged
merged 5 commits into from
Apr 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@
<file>themes/qfield/xhdpi/ic_settings_white_24dp.png</file>
<file>themes/qfield/xxhdpi/ic_settings_white_24dp.png</file>
<file>themes/qfield/xxxhdpi/ic_settings_white_24dp.png</file>
<file>themes/qfield/hdpi/ic_topology_green_24dp.png</file>
<file>themes/qfield/mdpi/ic_topology_green_24dp.png</file>
<file>themes/qfield/xhdpi/ic_topology_green_24dp.png</file>
<file>themes/qfield/xxhdpi/ic_topology_green_24dp.png</file>
<file>themes/qfield/xxxhdpi/ic_topology_green_24dp.png</file>
<file>themes/qfield/hdpi/ic_topology_white_24dp.png</file>
<file>themes/qfield/mdpi/ic_topology_white_24dp.png</file>
<file>themes/qfield/xhdpi/ic_topology_white_24dp.png</file>
<file>themes/qfield/xxhdpi/ic_topology_white_24dp.png</file>
<file>themes/qfield/xxxhdpi/ic_topology_white_24dp.png</file>
<file>themes/qfield/hdpi/ic_clear_black_18dp.png</file>
<file>themes/qfield/mdpi/ic_clear_black_18dp.png</file>
<file>themes/qfield/xhdpi/ic_clear_black_18dp.png</file>
Expand Down
Binary file added images/themes/qfield/hdpi/ic_topology_green_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/qfield/hdpi/ic_topology_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/qfield/mdpi/ic_topology_green_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/qfield/mdpi/ic_topology_white_24dp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion sdk.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
osgeo4a_version=20200318
osgeo4a_version=20200416
48 changes: 46 additions & 2 deletions src/qml/qgismobileapp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,51 @@ ApplicationWindow {
}

Column {
id: mainToolBar
id: mainToolbar
anchors.left: mainMenuBar.left
anchors.top: mainMenuBar.bottom
anchors.leftMargin: 4 * dp
spacing: 4 * dp

Button {
id: topologyButton
round: true
visible: stateMachine.state === "digitize" && ( dashBoard.currentLayer.geometryType() === QgsWkbTypes.PolygonGeometry || dashBoard.currentLayer.geometryType() === QgsWkbTypes.LineGeometry )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand this, it doesn't concern the selected layer but still is only visible when a layer is selected?
Shouldn't it be visible as soon as there are at least two layers with geometry line or polygon in the project - no matter if they are selected or not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@signedav , Matthias wants to avoid obscuring the canvas as much as possible, hence hiding when possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does it not concern the selected layer?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First - in browsing mode - it's not visible. Then with enable digitizing mode, it's still not visible. Then I select a layer and it becomes visible. I activate it, and because it popped out by selecting the layer, I expect, that I turn it on only for this layer. But it does not concern (only) this layer. It concerns all the polygon and line layers.

If I have e.g. several point layers. And I click on one, the + appears to digitize. I expect that this + concerns only this layer. There is not an option that I can select the layer after pressing + where to add a feature. This is QGIS behavior. And so I think the activation of the topological editing should be QGIS behavior as well. Means, not appearing on selecting a specific layer.

I suggest to make it visible all the time (as soon as there are polygon or line layers) or put it somewhere else (like e.g. in the menu like the measure tool).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I activate it, and because it popped out by selecting the layer, I expect, that I turn it on only for this layer.

I understand this assumption. But I also think it's obvious that when you change the layer and it stays the way it is it will be quite quickly visible to someone that it's not only for this layer.

For me, topological editing is an edge case. Interesting for some, a miracle for many. So it should take away users attention as little as possible.
It also will not do anything when editing a point layer, hence it doesn't make sense to show it there.

If it was for me, I'd even make it opt-in in the configuration of QField or the project to keep it hidden from the large portion of QField users that will never ever use it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm -1 to adding a setting here, that's just an extra layer of complexity that's not worth it really IMHO.

I think hiding it as much as we can, like it's done ATM, is a good balance.

Arguably, the bonus of having it show up in the narrow circumstances we have atm does provide a collateral benefit: educating users about the presence of this feature.

state: qgisProject.topologicalEditing ? "On" : "Off"
iconSource: Theme.getThemeIcon( "ic_topology_white_24dp" )

bgcolor: Theme.darkGray

states: [
State {

name: "Off"
PropertyChanges {
target: topologyButton
iconSource: Theme.getThemeIcon( "ic_topology_white_24dp" )
bgcolor: "#88212121"
}
},

State {
name: "On"
PropertyChanges {
target: topologyButton
iconSource: Theme.getThemeIcon( "ic_topology_green_24dp" )
bgcolor: Theme.darkGray
}
}
]

onClicked: {
qgisProject.topologicalEditing = !qgisProject.topologicalEditing;
displayToast( qgisProject.topologicalEditing ? qsTr( "Topological editing turned on" ) : qsTr( "Topological editing turned off" ) );
}
}
}

Column {
id: locationToolbar
anchors.right: mapCanvas.right
anchors.rightMargin: 4 * dp
anchors.bottom: mapCanvas.bottom
Expand Down Expand Up @@ -1365,7 +1409,7 @@ ApplicationWindow {
toast.open()
toastContent.visible = true
toast.opacity = 1
toastTimer.start()
toastTimer.restart()
}

Behavior on opacity {
Expand Down