mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 09:28:58 +08:00
Add combobox popup styling
This commit is contained in:
parent
9488c39f68
commit
428dfeaed7
@ -86,13 +86,34 @@ SettingItem
|
|||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
popup: Popup {
|
||||||
|
y: control.height - UM.Theme.getSize("default_lining").height
|
||||||
|
width: control.width
|
||||||
|
implicitHeight: contentItem.implicitHeight
|
||||||
|
padding: UM.Theme.getSize("default_lining").width
|
||||||
|
|
||||||
|
contentItem: ListView {
|
||||||
|
clip: true
|
||||||
|
implicitHeight: contentHeight
|
||||||
|
model: control.popup.visible ? control.delegateModel : null
|
||||||
|
currentIndex: control.highlightedIndex
|
||||||
|
|
||||||
|
ScrollIndicator.vertical: ScrollIndicator { }
|
||||||
|
}
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: UM.Theme.getColor("setting_control")
|
||||||
|
border.color: UM.Theme.getColor("setting_control_border")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delegate: ItemDelegate
|
delegate: ItemDelegate
|
||||||
{
|
{
|
||||||
width: control.width
|
width: control.width - 2 * UM.Theme.getSize("default_lining").width
|
||||||
height: control.height
|
height: control.height
|
||||||
highlighted: control.highlightedIndex == index
|
highlighted: control.highlightedIndex == index
|
||||||
|
|
||||||
contentItem: Text
|
contentItem: Label
|
||||||
{
|
{
|
||||||
text: modelData.value
|
text: modelData.value
|
||||||
color: control.contentItem.color
|
color: control.contentItem.color
|
||||||
@ -100,6 +121,12 @@ SettingItem
|
|||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
background: Rectangle
|
||||||
|
{
|
||||||
|
color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent"
|
||||||
|
border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivated:
|
onActivated:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user