style: format

This commit is contained in:
talksik
2025-04-12 12:47:38 -07:00
parent 4ae90f906b
commit 6e6e81dbb6
10 changed files with 253 additions and 248 deletions
+3 -6
View File
@@ -7,11 +7,8 @@ import DesignSystem
T.ComboBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding, implicitIndicatorHeight + topPadding + bottomPadding)
leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
@@ -101,7 +98,7 @@ T.ComboBox {
border.color: control.palette.mid
}
T.ScrollIndicator.vertical: ScrollIndicator { }
T.ScrollIndicator.vertical: ScrollIndicator {}
}
background: Rectangle {
+2 -1
View File
@@ -18,7 +18,8 @@ Item {
color: "transparent"
}
// FIX: onClicked doesn't work
onClicked: if (item.onClicked) item.onClicked()
onClicked: if (item.onClicked)
item.onClicked()
icon.source: item.source
icon.width: item.iconWidth
icon.height: item.iconHeight
+1 -2
View File
@@ -24,8 +24,7 @@ Button {
implicitWidth: 100
implicitHeight: 40
visible: !control.flat || control.down || control.checked || control.highlighted
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button,
control.palette.mid, control.down ? 0.5 : 0.0)
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, control.palette.mid, control.down ? 0.5 : 0.0)
border.color: control.palette.highlight
border.width: control.visualFocus ? 2 : 0
// custom
+1 -1
View File
@@ -29,6 +29,6 @@ Item {
}
function toggleTheme() {
darkTheme = !darkTheme
darkTheme = !darkTheme;
}
}
+14 -6
View File
@@ -27,7 +27,7 @@ AppWindow {
AppPrimaryButton {
text: "Toggle theme"
onClicked: {
Theme.toggleTheme()
Theme.toggleTheme();
}
}
AppSecondaryButton {
@@ -71,7 +71,7 @@ AppWindow {
AppSecondaryButton {
text: "Open message dialog"
onClicked: {
messageDialog.open()
messageDialog.open();
}
}
@@ -84,13 +84,21 @@ AppWindow {
AppComboBox {
model: ListModel {
id: model
ListElement { text: "Banana" }
ListElement { text: "Apple" }
ListElement { text: "Coconut" }
ListElement {
text: "Banana"
}
ListElement {
text: "Apple"
}
ListElement {
text: "Coconut"
}
}
onAccepted: {
if (find(editText) === -1)
model.append({text: editText})
model.append({
text: editText
});
}
}