Skip to content

Commit 2642a71

Browse files
committed
Cupertino ComboBox: remove height-for-height dependency
Fixes #9219
1 parent 3d6aba5 commit 2642a71

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

internal/compiler/widgets/cupertino/combobox.slint

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,16 @@ export component ComboBox {
105105
accessible-role: none;
106106
}
107107

108-
VerticalLayout {
109-
alignment: center;
108+
Rectangle {
109+
min-width: 16px;
110+
preferred-width: button-layout.preferred-width;
111+
min-height: 16px;
112+
horizontal-stretch: 0;
110113

111114
Rectangle {
112-
horizontal-stretch: 0;
113-
min-width: 16px;
114-
min-height: max(self.min-width, button-layout.min-height);
115+
x: 0px;
116+
width: 100%;
117+
y: (parent.height - self.height) / 2;
115118

116119
if root.enabled : Rectangle {
117120
width: 100%;

tests/cases/widgets/combobox.slint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ export component TestCase inherits Window {
2121
}
2222
}
2323

24+
if false : Rectangle {
25+
test-no-loop := ComboBox {
26+
width: 10 * self.height; // Test that there is no height for width dependency (loop)
27+
}
28+
}
29+
2430
public function unfocus() {
2531
box.clear-focus();
2632
}

0 commit comments

Comments
 (0)