Compare commits

..

3 Commits

Author SHA256 Message Date
495252c408 commit problems 2025-03-20 10:42:49 +01:00
5b7e364c20 merge main 2025-03-20 09:42:00 +01:00
Yuri Becker
13416edd25 Make ComboBoxes work a bit more 2025-03-19 13:28:31 +01:00
2 changed files with 3559 additions and 48 deletions

View File

@@ -2,84 +2,89 @@ import QtQuick
import QtQuick.Templates as T import QtQuick.Templates as T
import QtQuick.Controls import QtQuick.Controls
T.ComboBox T.ComboBox {
{
id: control id: control
font: Typography.body font: Typography.body
implicitHeight: background.height implicitHeight: background.height
padding: Dimensions.m padding: Dimensions.m
background: Rectangle background: Rectangle {
{
border.color: Colors.interactive border.color: Colors.interactive
border.width: 1 border.width: 1
color: Colors.mantle color: Colors.mantle
height: 47 height: 47
radius: Dimensions.radius radius: Dimensions.radius
} }
contentItem: T.TextField {
delegate: T.ItemDelegate autoScroll: control.editable
{ color: Colors.foreground
width: control.width enabled: control.editable
height: implicitContentHeight + topPadding + bottomPadding font: Typography.body
padding: Dimensions.s inputMethodHints: control.inputMethodHints
leftPadding: control.leftPadding readOnly: control.down
contentItem: Label selectByMouse: control.selectTextByMouse
{ text: control.editable ? control.editText : control.displayText
text: control.textRole ? model[control.textRole] : modelData validator: control.validator
color: Colors.foreground
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
highlighted: control.highlightedIndex === index
} }
indicator: Label delegate: MenuItem {
{ id: menuItem
x: control.width - width
required property int index
required property var model
highlighted: control.highlightedIndex === index
hoverEnabled: control.hoverEnabled
text: model[control.textRole]
width: control.width
background: Rectangle {
color: menuItem.down || menuItem.highlighted ? Colors.primary : "transparent"
height: menuItem.height
width: menuItem.width
}
}
indicator: Label {
height: control.height height: control.height
width: contentWidth + Dimensions.s * 2
text: "▼"
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
padding: Dimensions.s padding: Dimensions.s
text: "▼"
verticalAlignment: Text.AlignVCenter
width: contentWidth + Dimensions.s * 2
x: control.width - width
background: Rectangle background: Rectangle {
{
anchors.fill: parent anchors.fill: parent
border.color: Colors.interactive
bottomRightRadius: Dimensions.radius
color: Colors.primary color: Colors.primary
topRightRadius: Dimensions.radius topRightRadius: Dimensions.radius
bottomRightRadius: Dimensions.radius
border.color: Colors.interactive
} }
} }
popup: T.Popup {
popup: T.Popup
{
y: control.height
z: 2
width: control.width width: control.width
contentItem: ListView height: Math.min(contentItem.implicitHeight + 2, control.Window.height - topMargin - bottomMargin)
{ topMargin: 6
bottomMargin: 6
padding: 1
background: Rectangle {
border.color: Colors.interactive
color: Colors.mantle
radius: Dimensions.radius
}
contentItem: ListView {
clip: true clip: true
currentIndex: control.highlightedIndex
implicitHeight: contentHeight implicitHeight: contentHeight
model: control.popup.visible ? control.delegateModel : null model: control.popup.visible ? control.delegateModel : null
currentIndex: control.highlightedIndex
T.ScrollBar.vertical: ScrollBar { }
highlight: Rectangle highlight: Rectangle {
{
color: Colors.primary color: Colors.primary
opacity: Colors.highlightOpacity opacity: Colors.highlightOpacity
} }
ScrollIndicator.vertical: ScrollIndicator {}
}
background: Rectangle
{
color: Colors.mantle
border.color: Colors.interactive
radius: Dimensions.radius
} }
} }
} }

3506
doc/.$datenbank.drawio.dtmp Normal file

File diff suppressed because it is too large Load Diff