-
Notifications
You must be signed in to change notification settings - Fork 76
Fixed color selection for map sketching #4274
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
base: master
Are you sure you want to change the base?
Conversation
Withalion
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's probably a good time to create component out of the solutions in MMSketchesDrawer.qml and MMFormPhotoSketchingPageDialog.qml.
📦 Build Artifacts Ready
|
Withalion
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some additional work that needs to be done before we can proceed further
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer calling it MMColorPicker, it sounds more descriptive and we don't use it for just photos.
| ScrollView { | ||
| id: root | ||
|
|
||
| required property var colors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| required property var colors | |
| required property list<color> colors |
it would be nice to specify fully what we want there
| id: root | ||
|
|
||
| required property var colors | ||
| required property var controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't couple controller tightly with this component. Using signals is preferred here
| anchors.centerIn: parent | ||
|
|
||
| Repeater { | ||
| model: colors ?? null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be always specified and never null
| } | ||
|
|
||
| background: Rectangle { | ||
| property bool isActive: modelData.toLowerCase() === controller.activeColor.toString().toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activeColor will become the components property (read only preferably) and the component which uses this component will specify onActiveColorChanged to update controller
| drawerContent: ColumnLayout { | ||
| anchors { | ||
| left: parent.left | ||
| right: parent.right | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you have to specify ColumnLayout here if you have just one element
| Repeater { | ||
| model: colors ?? null | ||
|
|
||
| MMRoundButton { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it would be also nice to make component out of this button too MMColorButton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to use the more explicit notation required property color modelData
| text: qsTr("Eraser") | ||
| iconSourceLeft: __style.editIcon | ||
| // in some instances the erase button is not needed, because there is an "undo" feature already implemented | ||
| visible: showEraseButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| visible: showEraseButton | |
| visible: root.showEraseButton |
|
|
||
| ScrollView { | ||
| MMComponents.MMPhotoColorPicker{ | ||
| colors: ["#FFFFFF", "#12181F", "#5E9EE4", "#57B46F", "#FDCB2A", "#FF9C40", "#FF8F93"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have done this before, but please define these colors in MMStyle
| } | ||
|
|
||
| background: Rectangle { | ||
| property bool isActive: modelData.toLowerCase() === controller.activeColor.toString().toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In map sketching no color is selected anymore by default, while in photo sketching it is
Modified the components inside the MMSKetchesDrawer.
Below there is the fixed UI:
ScreenRecording_12-22-2025.16-00-28_1.MP4