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.
This commit is contained in:
Simon Hausmann 2021-08-19 09:40:22 +02:00
parent 76ca2eed6b
commit d5a969f804
2 changed files with 22 additions and 22 deletions

View file

@ -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);
}
}
}

View file

@ -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;
}
}
}
}
}