Skip to content

Commit 4b09e42

Browse files
committed
Update button arrow whenever orientation changes
1 parent 9a52e0b commit 4b09e42

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/main/java/org/scijava/ui/swing/script/TextEditorTab.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,8 @@ public void actionPerformed(final ActionEvent ae) {
235235
public void actionPerformed(ActionEvent e) {
236236
if (DOWN_ARROW.equals(switchSplit.getText())) {
237237
TextEditorTab.this.setOrientation(JSplitPane.VERTICAL_SPLIT);
238-
switchSplit.setText(RIGHT_ARROW);
239238
} else {
240239
TextEditorTab.this.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
241-
switchSplit.setText(DOWN_ARROW);
242240
}
243241
// Keep prompt collapsed if not in use
244242
if (!incremental.isSelected()) {
@@ -330,7 +328,14 @@ public void actionPerformed(ActionEvent a) {
330328
JSplitPane getScreenAndPromptSplit() {
331329
return screenAndPromptSplit;
332330
}
333-
331+
332+
@Override
333+
public void setOrientation(final int orientation) {
334+
super.setOrientation(orientation);
335+
switchSplit.setText(orientation == JSplitPane.VERTICAL_SPLIT ? //
336+
RIGHT_ARROW : DOWN_ARROW);
337+
}
338+
334339
// Package private
335340
void destroy() {
336341
dropTarget.removeDropTargetListener(dropTargetListener);

0 commit comments

Comments
 (0)