1
0
Fork 0

Make list items align to the top properly

This commit is contained in:
TheFGFSEagle 2023-02-05 18:56:47 +01:00 committed by James Turner
parent 00efa2d01a
commit 8b0da63e7c

View file

@ -20,6 +20,7 @@ gui.widgets.ListItem = {
m.setText(m._text);
m.setSelected(m._selected);
m.setLayoutMaximumSize([m._MAX_SIZE, 24]);
return m;
},
@ -137,6 +138,7 @@ gui.widgets.List = {
var (x, y) = arg;
me._size = [x, y];
me._scroll.setSize(x, y);
me._view.setSize(me, x, y);
return me.update();
},
@ -150,6 +152,7 @@ gui.widgets.List = {
# @return canvas.gui.widgets.List This list to support method chaining.
addItem: func(item) {
item.listen("selection-state-changed", func me._onItemSelectionStateChanged());
item.setAlignment(canvas.AlignTop);
me._scrollLayout.addItem(item);
item.setParent(me);
return me;