minor fixess
This commit is contained in:
+11
-7
@@ -6,7 +6,6 @@ Item {
|
||||
id: delegateRoot
|
||||
|
||||
property bool showLabel: true
|
||||
property bool darkMode: settingsContainer.darkMode
|
||||
|
||||
// Per-button trigger config (from the model). Default: hold-to-activate.
|
||||
readonly property string triggerModeResolved: (typeof triggerMode !== "undefined" && triggerMode) ? triggerMode : "hold"
|
||||
@@ -16,11 +15,15 @@ Item {
|
||||
// Resolved feedback colour/width for the current status (ok / error).
|
||||
readonly property color okColor: settingsContainer.feedbackOkColor
|
||||
readonly property color errorColor: settingsContainer.feedbackErrorColor
|
||||
readonly property color holdColor: settingsContainer.feedbackHoldColor
|
||||
readonly property color pendingColor: settingsContainer.feedbackPendingColor
|
||||
readonly property color feedbackColor: status === 1 ? okColor
|
||||
: status === 2 ? errorColor
|
||||
: status === 3 ? pendingColor
|
||||
: "#ffffff"
|
||||
readonly property int feedbackWidth: status === 1 ? settingsContainer.feedbackOkWidth
|
||||
: status === 2 ? settingsContainer.feedbackErrorWidth
|
||||
: status === 3 ? settingsContainer.feedbackPendingWidth
|
||||
: 2
|
||||
|
||||
// Glow: white=in-progress, ok/error use configured colours
|
||||
@@ -69,8 +72,9 @@ Item {
|
||||
color: btnColor || "#7b007b"
|
||||
border.color: status === 1 ? delegateRoot.okColor
|
||||
: status === 2 ? delegateRoot.errorColor
|
||||
: status === 3 ? delegateRoot.pendingColor
|
||||
: Qt.lighter(btnColor || "#7b007b", 1.5)
|
||||
border.width: status === 1 || status === 2 ? delegateRoot.feedbackWidth : 1
|
||||
border.width: status === 1 || status === 2 || status === 3 ? delegateRoot.feedbackWidth : 1
|
||||
Behavior on border.width { NumberAnimation { duration: 200 } }
|
||||
Behavior on border.color { ColorAnimation { duration: 200 } }
|
||||
|
||||
@@ -100,9 +104,9 @@ Item {
|
||||
visible: circle.holdProgress > 0.001
|
||||
antialiasing: true
|
||||
renderStrategy: Canvas.Threaded
|
||||
// Ring colour derived from the button colour for a cohesive look.
|
||||
property color baseColor: Qt.lighter(btnColor || "#7b007b", 1.9)
|
||||
property color headColor: "#ffffff"
|
||||
// Ring colour from global hold feedback settings.
|
||||
property color baseColor: Qt.lighter(delegateRoot.holdColor, 1.2)
|
||||
property color headColor: delegateRoot.holdColor
|
||||
function mix(c1, c2, t) {
|
||||
return Qt.rgba(c1.r + (c2.r - c1.r) * t,
|
||||
c1.g + (c2.g - c1.g) * t,
|
||||
@@ -172,7 +176,7 @@ Item {
|
||||
radius: 14
|
||||
samples: 25
|
||||
spread: 0.2
|
||||
color: Qt.lighter(btnColor || "#7b007b", 1.7)
|
||||
color: Qt.lighter(delegateRoot.holdColor, 1.7)
|
||||
transparentBorder: true
|
||||
}
|
||||
Connections {
|
||||
@@ -252,7 +256,7 @@ Item {
|
||||
width: parent.width
|
||||
visible: showLabel
|
||||
text: statusText !== "" ? statusText : label
|
||||
color: darkMode ? "white" : "black"
|
||||
color: settingsContainer.labelColor
|
||||
font.pixelSize: Math.max(10, parent.width * 0.1)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideRight
|
||||
|
||||
Reference in New Issue
Block a user