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

View file

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

View file

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

View file

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

View file

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