style: format
This commit is contained in:
+3
-6
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -29,6 +29,6 @@ Item {
|
||||
}
|
||||
|
||||
function toggleTheme() {
|
||||
darkTheme = !darkTheme
|
||||
darkTheme = !darkTheme;
|
||||
}
|
||||
}
|
||||
|
||||
+14
-6
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user