Skip to content

Commit

Permalink
fix: color picker now works as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
Prayag2 committed Mar 7, 2024
1 parent 2ebb8e5 commit 464376c
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions package/contents/ui/ColorField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,24 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kquickcontrols 2.0 as KQControls

RowLayout {
id: colorfield
property alias text: label.text
property alias color: rect.color
property alias color: colorbutton.color

Label {
id: label
}
Button {
id: button
padding: 5
contentItem: Rectangle {
id: rect
}
onClicked: {
dialog.open()
}
}
ColorDialog {
id: dialog
title: "Select a color"
KQControls.ColorButton {
id: colorbutton
color: root.color
showAlphaChannel: false

onAccepted: {
colorfield.color = dialog.color
colorfield.color = color
}
}
}

0 comments on commit 464376c

Please sign in to comment.