Files
glassMxrph/quickshell/components/GlassComboBox.qml
T
mxandClaude Opus 5.5 99e64a7713 Add glassMxrph shell sources
Initial commit of the Quickshell desktop suite: bar, dock, launcher,
settings, Control Center, dashboard, OSD, lock screen, desktop widgets,
plugin host with the vendored Noctalia/Omarchy compatibility layer,
helpers, packaging, tests and phase documentation.

Includes the optimization work so far: usage widgets and dashboard
gauges no longer animate continuously, desktop widgets pause while
covered, system controls stop flickering on background polls, dock app
matching uses an indexed catalog, and workspace ghosts are created only
for occupied slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:36:17 +02:00

67 lines
2.0 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import "../theme"
ComboBox {
id: root
implicitWidth: 180
implicitHeight: 38
leftPadding: 12
rightPadding: 30
background: Rectangle {
radius: 10
color: root.hovered ? Theme.hover : Theme.surfaceVariant
border.color: root.activeFocus ? Theme.accent : Theme.border
}
contentItem: Text {
text: root.displayText
color: Theme.text
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
font: root.font
}
indicator: Text {
text: "⌄"
color: Theme.textSecondary
anchors.right: parent.right
anchors.rightMargin: 12
anchors.verticalCenter: parent.verticalCenter
}
delegate: ItemDelegate {
id: entry
required property var modelData
required property int index
width: root.width - 16
highlighted: root.highlightedIndex === index
contentItem: Text {
text: root.textRole ? entry.modelData[root.textRole] : entry.modelData
color: Theme.text
elide: Text.ElideRight
font: root.font
}
background: Rectangle {
radius: 8
color: entry.highlighted ? Qt.alpha(Theme.accent, 0.2) : Theme.transparent
}
}
popup: Popup {
y: root.height + 6
// Stay inside the window: panel-sized layer surfaces clip anything outside.
margins: 6
width: root.width
padding: 8
implicitHeight: Math.min(contentItem.implicitHeight + 16, 300)
contentItem: ListView {
clip: true
implicitHeight: contentHeight
model: root.popup.visible ? root.delegateModel : null
currentIndex: root.highlightedIndex
ScrollIndicator.vertical: ScrollIndicator {}
}
background: GlassPanel {
surfaceOpacity: Math.max(Theme.panelOpacity, 0.85)
}
}
}