mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
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:
parent
76ca2eed6b
commit
d5a969f804
2 changed files with 22 additions and 22 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue