74 lines
2.2 KiB
QML
74 lines
2.2 KiB
QML
|
|
import QtQuick
|
||
|
|
import QtQuick.Controls 2.15
|
||
|
|
|
||
|
|
// Комбобокс в общем тёмном стиле окна.
|
||
|
|
ComboBox {
|
||
|
|
id: darkCombo
|
||
|
|
|
||
|
|
// Та же стрелка, что у комбобоксов профиля и версии на главном окне,
|
||
|
|
// вместо двойного шеврона Basic-стиля.
|
||
|
|
indicator: Image {
|
||
|
|
width: 10; height: 10
|
||
|
|
x: darkCombo.width - width - 12
|
||
|
|
y: (darkCombo.height - height) / 2
|
||
|
|
source: darkCombo.down ? "images/Profile_Box/Asset_23.svg"
|
||
|
|
: "images/Profile_Box/Asset_24.svg"
|
||
|
|
rotation: 180
|
||
|
|
sourceSize.width: 10; sourceSize.height: 10
|
||
|
|
fillMode: Image.PreserveAspectFit
|
||
|
|
}
|
||
|
|
|
||
|
|
contentItem: Text {
|
||
|
|
leftPadding: 10
|
||
|
|
rightPadding: darkCombo.indicator.width + 22
|
||
|
|
text: darkCombo.displayText
|
||
|
|
color: "#ffffff"
|
||
|
|
font: darkCombo.font
|
||
|
|
verticalAlignment: Text.AlignVCenter
|
||
|
|
elide: Text.ElideRight
|
||
|
|
}
|
||
|
|
|
||
|
|
background: Rectangle {
|
||
|
|
color: "#2a2a2a"
|
||
|
|
radius: 6
|
||
|
|
border.color: darkCombo.activeFocus ? "#91B315" : "#444444"
|
||
|
|
border.width: 1
|
||
|
|
}
|
||
|
|
|
||
|
|
delegate: ItemDelegate {
|
||
|
|
required property var modelData
|
||
|
|
required property int index
|
||
|
|
|
||
|
|
width: darkCombo.width
|
||
|
|
highlighted: darkCombo.highlightedIndex === index
|
||
|
|
contentItem: Text {
|
||
|
|
text: modelData
|
||
|
|
color: "#ffffff"
|
||
|
|
elide: Text.ElideRight
|
||
|
|
verticalAlignment: Text.AlignVCenter
|
||
|
|
}
|
||
|
|
background: Rectangle { color: highlighted ? "#3a3a3a" : "#2a2a2a" }
|
||
|
|
}
|
||
|
|
|
||
|
|
popup: Popup {
|
||
|
|
y: darkCombo.height
|
||
|
|
width: darkCombo.width
|
||
|
|
implicitHeight: Math.min(contentItem.implicitHeight, 220)
|
||
|
|
padding: 1
|
||
|
|
|
||
|
|
contentItem: ListView {
|
||
|
|
clip: true
|
||
|
|
implicitHeight: contentHeight
|
||
|
|
model: darkCombo.delegateModel
|
||
|
|
currentIndex: darkCombo.highlightedIndex
|
||
|
|
ScrollIndicator.vertical: ScrollIndicator {}
|
||
|
|
}
|
||
|
|
background: Rectangle {
|
||
|
|
color: "#2a2a2a"
|
||
|
|
radius: 6
|
||
|
|
border.color: "#444444"
|
||
|
|
border.width: 1
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|