Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/haxeui/haxeui-core
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Dec 7, 2024
2 parents dbd61ce + 49ab4f4 commit 10480e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions haxe/ui/components/Button.hx
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,15 @@ class ButtonLayout extends DefaultLayout {
var label:Label = component.findComponent(Label, false);
var ucx = usableSize.width;
if (label != null) {
// label mustn't be bigger than usable size
// and label must be resized to auto calculated width if it's bigger than label
// ( don't force multiline into space when a one line can fit)
if (label.width > 0 && _component.componentWidth > 0 && ucx > 0 && label.width >= ucx) {
label.width = ucx;
label.width = ucx;
} else if (label.width > 0 && _component.componentWidth > 0 && ucx > 0) {
// devezas so the label width "recovers" when dynamically (percent wise) we change the width of the button from lower (that has the text wrapped) to higher:
label.width = label.layout.calcAutoWidth();
// When we did label.width, we removed autowidth, so we need to check manually
var autoWidth = label.layout.calcAutoWidth();
if (autoWidth > label.width) label.width = autoWidth;
}
}

Expand Down
6 changes: 6 additions & 0 deletions haxe/ui/components/DropDown.hx
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,14 @@ private class ListDropDownHandler extends DropDownHandler {
} else {
text = Std.string(data);
}
if (_dropdown.text != text) {
dispatchChanged = true;
}
_dropdown.text = text;
} else {
if (itemRenderer.data != data) {
dispatchChanged = true;
}
itemRenderer.data = data;
}
}
Expand Down

0 comments on commit 10480e5

Please sign in to comment.