Skip to content

Conversation

@gabriel-bolbotina
Copy link
Contributor

@gabriel-bolbotina gabriel-bolbotina commented Dec 22, 2025

Modified the components inside the MMSKetchesDrawer.

Below there is the fixed UI:

ScreenRecording_12-22-2025.16-00-28_1.MP4

Copy link
Contributor

@Withalion Withalion left a 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.

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

📦 Build Artifacts Ready

OS Status Build Info Workflow run
macOS Build 📬 Mergin Maps 61741 dmg Expires: 02/04/2026 #6174
linux Build 📭 Build not yet complete or failed.
win64 Build 📬 Mergin Maps 53671 win64 Expires: 02/04/2026 #5367
Android Build 📬 Mergin Maps 748411 APK [armeabi-v7a] Expires: 02/04/2026 #7484
Android Build 📬 Mergin Maps 748451 APK [arm64-v8a] Expires: 02/04/2026 #7484
iOS Build 📬 Build number: 26.01.842511 #8425

Copy link
Contributor

@Withalion Withalion left a 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

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

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
Copy link
Contributor

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()
Copy link
Contributor

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

Comment on lines +57 to +61
drawerContent: ColumnLayout {
anchors {
left: parent.left
right: parent.right
}
Copy link
Contributor

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 {
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
visible: showEraseButton
visible: root.showEraseButton


ScrollView {
MMComponents.MMPhotoColorPicker{
colors: ["#FFFFFF", "#12181F", "#5E9EE4", "#57B46F", "#FDCB2A", "#FF9C40", "#FF8F93"]
Copy link
Contributor

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()
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map sketching color buttons do not show which one is selected

3 participants