fix time combo box interaction #LINQT-1913

fix arrow indicator on combobox #LINQT-1954
This commit is contained in:
gaelle 2025-09-16 16:16:09 +02:00
parent 23234bafc4
commit 4fca0a4140
5 changed files with 13 additions and 10 deletions

View file

@ -17,6 +17,10 @@ Control.ComboBox {
property bool oneLine: false
property bool shadowEnabled: mainItem.activeFocus || mainItem.hovered
property string flagRole// Specific case if flag is shown (special font)
property var indicatorColor: DefaultStyle.main2_600
property int indicatorRightMargin: Math.round(20 * DefaultStyle.dp)
leftPadding: Math.round(10 * DefaultStyle.dp)
rightPadding: indicImage.width + indicatorRightMargin
onConstantImageSourceChanged: if (constantImageSource) selectedItemImg.imageSource = constantImageSource
onCurrentIndexChanged: {
@ -70,9 +74,6 @@ Control.ComboBox {
}
}
contentItem: RowLayout {
anchors.fill: parent
anchors.leftMargin: mainItem.leftMargin
anchors.rightMargin: indicImage.width + Math.round(10 * DefaultStyle.dp)
spacing: Math.round(5 * DefaultStyle.dp)
EffectImage {
id: selectedItemImg
@ -119,11 +120,13 @@ Control.ComboBox {
id: indicImage
z: 1
anchors.right: parent.right
anchors.rightMargin: Math.round(10 * DefaultStyle.dp)
anchors.rightMargin: mainItem.indicatorRightMargin
anchors.verticalCenter: parent.verticalCenter
imageSource: AppIcons.downArrow
width: Math.round(14 * DefaultStyle.dp)
width: Math.round(15 * DefaultStyle.dp)
height: Math.round(15 * DefaultStyle.dp)
fillMode: Image.PreserveAspectFit
colorizationColor: mainItem.indicatorColor
}
popup: Control.Popup {
@ -132,7 +135,6 @@ Control.ComboBox {
width: mainItem.width
implicitHeight: Math.min(contentItem.implicitHeight, mainWindow.height)
padding: Math.max(Math.round(1 * DefaultStyle.dp), 1)
//height: Math.min(implicitHeight, 300)
onOpened: {
listView.positionViewAtIndex(listView.currentIndex, ListView.Center)

View file

@ -43,7 +43,6 @@ ColumnLayout {
: "transparent"
}
contentItem: Item {
anchors.fill: parent
readonly property var currentItem: combobox.model.getAt(combobox.currentIndex)
anchors.leftMargin: Math.round(15 * DefaultStyle.dp)
Text {

View file

@ -12,6 +12,7 @@ Control.TabBar {
: 0
property real pixelSize: Typography.h3.pixelSize
property real textWeight: Typography.h3.weight
property int capitalization: Font.Capitalize
wheelEnabled: true
background: Item {
id: tabBarBackground
@ -93,7 +94,7 @@ Control.TabBar {
font {
pixelSize: mainItem.pixelSize
weight: mainItem.textWeight
capitalization: Font.Capitalize
capitalization: mainItem.capitalization
}
color: mainItem.currentIndex === index ? DefaultStyle.main2_600 : DefaultStyle.main2_400
elide: Text.ElideRight

View file

@ -4,6 +4,7 @@ import UtilsCpp 1.0
ComboBox {
id: mainItem
indicatorRightMargin: Math.round(10 * DefaultStyle.dp)
property var selectedDateTime
onSelectedDateTimeChanged: {
if (minTime != undefined) {
@ -31,9 +32,9 @@ ComboBox {
popup.onOpened: {
input.forceActiveFocus()
}
contentItem: TextInput {
id: input
anchors.right: indicator.left
validator: IntValidator{}
// activeFocusOnPress: false
inputMask: "00:00"
@ -45,7 +46,6 @@ ComboBox {
onActiveFocusChanged: {
if (activeFocus) {
selectAll()
mainItem.popup.open()
} else {
listView.currentIndex = -1
mainItem.selectedDateTime = UtilsCpp.createDateTime(mainItem.selectedDateTime, hour, min)

View file

@ -104,6 +104,7 @@ LoginLayout {
model: [qsTr("assistant_account_register_with_phone_number"),
// "S'inscrire avec un email"
qsTr("assistant_account_register_with_email")]
capitalization: Font.MixedCase
}
Flickable {
Layout.fillWidth: true