Skip to content

Commit

Permalink
Material SpinBox: Fix binding loop in some layout
Browse files Browse the repository at this point in the history
Having the width depending on the height is asking for trouble because
usually it is the height that depends on the width, so if the SpinBox is
getting in a complex layout, it causes a binding loop.
Workaround the problem by using the computed height.

This should fix the gallery build with the material style
(which is currently making the nightly build fail)
  • Loading branch information
ogoffart committed Feb 9, 2025
1 parent 94c6557 commit aa234c2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/compiler/widgets/material/spinbox.slint
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ component SpinBoxButton inherits Rectangle {

callback clicked <=> touch-area.clicked;

width: root.height;

states [
disabled when !root.enabled : {
background.background: MaterialPalette.control-foreground;
Expand Down Expand Up @@ -125,6 +123,7 @@ export component SpinBox {

VerticalLayout {
spacing: 4px;
width: (base.min-height.max(56px - layout.padding-top - layout.padding-bottom) - self.spacing) / 2;

SpinBoxButton {
enabled: root.enabled;
Expand Down

0 comments on commit aa234c2

Please sign in to comment.