From d5a969f804adf45283b11b2dafc0ece8af30cffc Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 19 Aug 2021 09:40:22 +0200 Subject: [PATCH] fluent style: make combobox selection slightly more intuitive Highlight (and select) items when hovering into the background, not just over the text. This is done by making sure the touch area covers the entire item. The same change is applied to the ugly style, which however isn't directly affected as it has not padding. --- .../widgets/fluent/sixtyfps_widgets.60 | 20 ++++++++-------- .../widgets/ugly/sixtyfps_widgets.60 | 24 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sixtyfps_compiler/widgets/fluent/sixtyfps_widgets.60 b/sixtyfps_compiler/widgets/fluent/sixtyfps_widgets.60 index d5a6539e9..e9fb7d732 100644 --- a/sixtyfps_compiler/widgets/fluent/sixtyfps_widgets.60 +++ b/sixtyfps_compiler/widgets/fluent/sixtyfps_widgets.60 @@ -639,16 +639,16 @@ export ComboBox := FocusScope { padding: 10px; Text { text: value; - item-area := TouchArea { - width: 100%; - height: 100%; - clicked => { - if (root.enabled) { - root.current-index = idx; - root.current-value = value; - root.selected(root.current-value); - } - } + } + } + item-area := TouchArea { + width: 100%; + height: 100%; + clicked => { + if (root.enabled) { + root.current-index = idx; + root.current-value = value; + root.selected(root.current-value); } } } diff --git a/sixtyfps_compiler/widgets/ugly/sixtyfps_widgets.60 b/sixtyfps_compiler/widgets/ugly/sixtyfps_widgets.60 index 212f30015..adca2ead6 100644 --- a/sixtyfps_compiler/widgets/ugly/sixtyfps_widgets.60 +++ b/sixtyfps_compiler/widgets/ugly/sixtyfps_widgets.60 @@ -583,20 +583,20 @@ export ComboBox := Rectangle { VerticalLayout { // FIXME: ideally this layout shouldn't be required Text { text: value; - item-area := TouchArea { - width: 100%; - height: 100%; - clicked => { - if (root.enabled) { - root.current-index = idx; - root.current-value = value; - root.selected(root.current-value); - } - //is-open = false; - } - } } } + item-area := TouchArea { + width: 100%; + height: 100%; + clicked => { + if (root.enabled) { + root.current-index = idx; + root.current-value = value; + root.selected(root.current-value); + } + //is-open = false; + } + } } } }