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
+2 -5
View File
@@ -7,11 +7,8 @@ import DesignSystem
T.ComboBox { T.ComboBox {
id: control id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding)
implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding, implicitIndicatorHeight + topPadding + bottomPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
+2 -1
View File
@@ -18,7 +18,8 @@ Item {
color: "transparent" color: "transparent"
} }
// FIX: onClicked doesn't work // FIX: onClicked doesn't work
onClicked: if (item.onClicked) item.onClicked() onClicked: if (item.onClicked)
item.onClicked()
icon.source: item.source icon.source: item.source
icon.width: item.iconWidth icon.width: item.iconWidth
icon.height: item.iconHeight icon.height: item.iconHeight
+1 -2
View File
@@ -24,8 +24,7 @@ Button {
implicitWidth: 100 implicitWidth: 100
implicitHeight: 40 implicitHeight: 40
visible: !control.flat || control.down || control.checked || control.highlighted visible: !control.flat || control.down || control.checked || control.highlighted
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, control.palette.mid, control.down ? 0.5 : 0.0)
control.palette.mid, control.down ? 0.5 : 0.0)
border.color: control.palette.highlight border.color: control.palette.highlight
border.width: control.visualFocus ? 2 : 0 border.width: control.visualFocus ? 2 : 0
// custom // custom
+1 -1
View File
@@ -29,6 +29,6 @@ Item {
} }
function toggleTheme() { function toggleTheme() {
darkTheme = !darkTheme darkTheme = !darkTheme;
} }
} }
+14 -6
View File
@@ -27,7 +27,7 @@ AppWindow {
AppPrimaryButton { AppPrimaryButton {
text: "Toggle theme" text: "Toggle theme"
onClicked: { onClicked: {
Theme.toggleTheme() Theme.toggleTheme();
} }
} }
AppSecondaryButton { AppSecondaryButton {
@@ -71,7 +71,7 @@ AppWindow {
AppSecondaryButton { AppSecondaryButton {
text: "Open message dialog" text: "Open message dialog"
onClicked: { onClicked: {
messageDialog.open() messageDialog.open();
} }
} }
@@ -84,13 +84,21 @@ AppWindow {
AppComboBox { AppComboBox {
model: ListModel { model: ListModel {
id: model id: model
ListElement { text: "Banana" } ListElement {
ListElement { text: "Apple" } text: "Banana"
ListElement { text: "Coconut" } }
ListElement {
text: "Apple"
}
ListElement {
text: "Coconut"
}
} }
onAccepted: { onAccepted: {
if (find(editText) === -1) if (find(editText) === -1)
model.append({text: editText}) model.append({
text: editText
});
} }
} }