Skip to content

Commit fe9094d

Browse files
committed
fixed bug with display of buttons on ListSelectorTwoPane
1 parent c61d05e commit fe9094d

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

widgets/+wt/ListSelectorTwoPane.m

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,9 @@ function setup(obj)
115115

116116
% Create the list buttons
117117
obj.ListButtons = wt.ButtonGrid(obj.Grid);
118-
obj.ListButtons.Icon = ["right_24.png", "left_24.png"];
119-
obj.ListButtons.ButtonTag = ["Add", "Remove"];
120118
obj.ListButtons.Layout.Column = 2;
121119
obj.ListButtons.Layout.Row = 1;
122120
obj.ListButtons.Orientation = "vertical";
123-
obj.ListButtons.ButtonHeight = {28 28};
124121

125122
% Create an additional button grid for custom buttons
126123
obj.UserButtons = wt.ButtonGrid(obj.Grid,"Icon",[]);
@@ -159,13 +156,13 @@ function update(obj)
159156

160157
% Is the list sortable?
161158
if obj.Sortable
162-
obj.ListButtons.Icon(3:4) = ["up_24.png", "down_24.png"];
163-
obj.ListButtons.ButtonTag(3:4) = ["Up", "Down"];
164-
obj.ListButtons.ButtonHeight(3:4) = {28};
159+
obj.ListButtons.Icon = ["right_24.png", "left_24.png", "up_24.png", "down_24.png"];
160+
obj.ListButtons.ButtonTag = ["Add", "Remove", "Up", "Down"];
161+
obj.ListButtons.ButtonHeight = {28 28 28 28};
165162
else
166-
obj.ListButtons.Icon(3:end) = [];
167-
obj.ListButtons.ButtonTag(3:end) = [];
168-
obj.ListButtons.ButtonHeight(3:end) = [];
163+
obj.ListButtons.Icon = ["right_24.png", "left_24.png"];
164+
obj.ListButtons.ButtonTag = ["Add", "Remove"];
165+
obj.ListButtons.ButtonHeight = {28 28};
169166
end
170167

171168
% Update the list

0 commit comments

Comments
 (0)