import QtQuick 2.15 import QtQuick.Controls 2.15 import "." ComboBox { id: valaszto implicitHeight: 44 font.family: Stilus.font font.pixelSize: 14 background: Rectangle { color: Stilus.felulet border.width: 1 border.color: valaszto.activeFocus || valaszto.hovered ? Stilus.zold : Stilus.keretErosebb } contentItem: Text { leftPadding: 12 rightPadding: 32 text: valaszto.displayText color: Stilus.szoveg font: valaszto.font elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } indicator: Image { x: valaszto.width - width - 12 y: (valaszto.height - height) / 2 width: 12 height: 12 source: "../arrow-down.svg" sourceSize.width: 24 sourceSize.height: 24 } delegate: ItemDelegate { width: valaszto.width height: 36 highlighted: valaszto.highlightedIndex === index background: Rectangle { color: highlighted ? Stilus.aktiv : Stilus.felulet } contentItem: Text { leftPadding: 12 text: valaszto.textAt(index) color: Stilus.szoveg font: valaszto.font elide: Text.ElideRight verticalAlignment: Text.AlignVCenter } } popup: Popup { y: valaszto.height width: valaszto.width implicitHeight: Math.min(contentItem.implicitHeight + 2, 320) padding: 1 background: Rectangle { color: Stilus.felulet border.width: 1 border.color: Stilus.keretErosebb } contentItem: ListView { clip: true implicitHeight: contentHeight model: valaszto.popup.visible ? valaszto.delegateModel : null currentIndex: valaszto.highlightedIndex ScrollIndicator.vertical: ScrollIndicator {} } } }