MalisisCore

48M Downloads

UISelect#calcOptionsSize not called on setSize

Barteks2x opened this issue ยท 0 comments

commented

Resizing the component doesn't change the size of the list. But recalculating the list size after setting size makes it >= width of the component.

My current workaround:

    public static <T> UISelect<T> makeUISelect(MalisisGui gui, Iterable<T> values) {
        UISelect<T> select = new UISelect<T>(gui, 100, values);
        select.register(new Object() {
            @Subscribe
            public void onResize(SpaceChangeEvent.SizeChangeEvent evt) {
                select.setMaxExpandedWidth(evt.getNewWidth());
            }
        });
        return select;
    }