feat(StatusGroupBox): Use StatusIcon to gray out label when disabled

This commit is contained in:
Michał Cieślak 2023-04-04 15:53:37 +02:00 committed by Michał
parent a2f5d81f7f
commit 43196d9e31
2 changed files with 17 additions and 6 deletions

View File

@ -44,6 +44,8 @@ SplitView {
icon: Style.png("tokens/SNT")
iconSize: iconSizeSlider.value
label.enabled: labelEnabledCheckBox.checked
width: undefinedSizeCheckBox.checked ? undefined
: widthSlider.value
height: undefinedSizeCheckBox.checked ? undefined
@ -110,10 +112,19 @@ SplitView {
text: "iconSize:"
}
TextField {
id: titleTextEdit
RowLayout {
TextField {
id: titleTextEdit
text: "Some title goes here"
text: "Some title goes here"
}
CheckBox {
id: labelEnabledCheckBox
checked: true
text: "label enabled"
}
}
}
}

View File

@ -41,15 +41,15 @@ GroupBox {
contentItem: RowLayout {
spacing: 8
Image {
StatusIcon {
sourceSize.width: width || undefined
sourceSize.height: height || undefined
fillMode: Image.PreserveAspectFit
mipmap: true
antialiasing: true
width: root.iconSize
height: width
source: root.icon
color: enabled ? "transparent" : Theme.palette.baseColor1
}
StatusBaseText {
@ -57,7 +57,7 @@ GroupBox {
Layout.fillWidth: true
text: root.title
color: Theme.palette.directColor1
color: enabled ? Theme.palette.directColor1 : Theme.palette.baseColor1
font.pixelSize: 17
elide: Text.ElideRight