mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
JIDE: JideTabbedPane: fixed close button in tab area, which was visible even if shown on tabs (regression in previous commit)
This commit is contained in:
@@ -709,7 +709,7 @@ public class FlatJideTabbedPaneUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateArrowButtons() {
|
private void updateArrowButtons() {
|
||||||
if( !scrollableTabLayoutEnabled() )
|
if( !scrollableTabLayoutEnabled() || !_tabPane.isTabShown() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Insets insets = _tabPane.getInsets();
|
Insets insets = _tabPane.getInsets();
|
||||||
@@ -739,7 +739,8 @@ public class FlatJideTabbedPaneUI
|
|||||||
y += tabAreaInsets.top;
|
y += tabAreaInsets.top;
|
||||||
|
|
||||||
// layout buttons
|
// layout buttons
|
||||||
x = layoutButtonHorizontal( _tabScroller.closeButton, 16, x, y, h, leftToRight );
|
if( !isShowCloseButtonOnTab() )
|
||||||
|
x = layoutButtonHorizontal( _tabScroller.closeButton, 16, x, y, h, leftToRight );
|
||||||
x = layoutButtonHorizontal( _tabScroller.listButton, 24, x, y, h, leftToRight );
|
x = layoutButtonHorizontal( _tabScroller.listButton, 24, x, y, h, leftToRight );
|
||||||
x = layoutButtonHorizontal( _tabScroller.scrollForwardButton, 16, x, y, h, leftToRight );
|
x = layoutButtonHorizontal( _tabScroller.scrollForwardButton, 16, x, y, h, leftToRight );
|
||||||
x = layoutButtonHorizontal( _tabScroller.scrollBackwardButton, 16, x, y, h, leftToRight );
|
x = layoutButtonHorizontal( _tabScroller.scrollBackwardButton, 16, x, y, h, leftToRight );
|
||||||
@@ -770,7 +771,8 @@ public class FlatJideTabbedPaneUI
|
|||||||
x += tabAreaInsets.left;
|
x += tabAreaInsets.left;
|
||||||
|
|
||||||
// layout buttons
|
// layout buttons
|
||||||
y = layoutButtonVertical( _tabScroller.closeButton, 16, x, y, w );
|
if( !isShowCloseButtonOnTab() )
|
||||||
|
y = layoutButtonVertical( _tabScroller.closeButton, 16, x, y, w );
|
||||||
y = layoutButtonVertical( _tabScroller.listButton, 24, x, y, w );
|
y = layoutButtonVertical( _tabScroller.listButton, 24, x, y, w );
|
||||||
y = layoutButtonVertical( _tabScroller.scrollForwardButton, 16, x, y, w );
|
y = layoutButtonVertical( _tabScroller.scrollForwardButton, 16, x, y, w );
|
||||||
y = layoutButtonVertical( _tabScroller.scrollBackwardButton, 16, x, y, w );
|
y = layoutButtonVertical( _tabScroller.scrollBackwardButton, 16, x, y, w );
|
||||||
|
|||||||
@@ -308,11 +308,11 @@ public class FlatJideOssContainerTest
|
|||||||
|
|
||||||
private void tabsClosableChanged() {
|
private void tabsClosableChanged() {
|
||||||
boolean closable = tabsClosableCheckBox.isSelected() && tabScrollCheckBox.isSelected();
|
boolean closable = tabsClosableCheckBox.isSelected() && tabScrollCheckBox.isSelected();
|
||||||
boolean onTab = showCloseButtonOnTabCheckBox.isSelected();
|
boolean onTab = closable && showCloseButtonOnTabCheckBox.isSelected();
|
||||||
|
|
||||||
for( JideTabbedPane tabbedPane : allTabbedPanes ) {
|
for( JideTabbedPane tabbedPane : allTabbedPanes ) {
|
||||||
tabbedPane.setShowCloseButton( closable );
|
|
||||||
tabbedPane.setShowCloseButtonOnTab( onTab );
|
tabbedPane.setShowCloseButtonOnTab( onTab );
|
||||||
|
tabbedPane.setShowCloseButton( closable );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,13 +325,6 @@ public class FlatJideOssContainerTest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showCloseButtonOnTabChanged() {
|
|
||||||
boolean onTab = showCloseButtonOnTabCheckBox.isSelected();
|
|
||||||
|
|
||||||
for( JideTabbedPane tabbedPane : allTabbedPanes )
|
|
||||||
tabbedPane.setShowCloseButtonOnTab( onTab );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showCloseButtonOnSelectedTabChanged() {
|
private void showCloseButtonOnSelectedTabChanged() {
|
||||||
boolean onSelected = showCloseButtonOnSelectedTabCheckBox.isSelected();
|
boolean onSelected = showCloseButtonOnSelectedTabCheckBox.isSelected();
|
||||||
|
|
||||||
@@ -554,7 +547,7 @@ public class FlatJideOssContainerTest
|
|||||||
//---- showCloseButtonOnTabCheckBox ----
|
//---- showCloseButtonOnTabCheckBox ----
|
||||||
showCloseButtonOnTabCheckBox.setText("on tab");
|
showCloseButtonOnTabCheckBox.setText("on tab");
|
||||||
showCloseButtonOnTabCheckBox.setSelected(true);
|
showCloseButtonOnTabCheckBox.setSelected(true);
|
||||||
showCloseButtonOnTabCheckBox.addActionListener(e -> showCloseButtonOnTabChanged());
|
showCloseButtonOnTabCheckBox.addActionListener(e -> tabsClosableChanged());
|
||||||
tabbedPaneControlPanel.add(showCloseButtonOnTabCheckBox, "cell 2 3");
|
tabbedPaneControlPanel.add(showCloseButtonOnTabCheckBox, "cell 2 3");
|
||||||
|
|
||||||
//---- showCloseButtonOnSelectedTabCheckBox ----
|
//---- showCloseButtonOnSelectedTabCheckBox ----
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ new FormModel {
|
|||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showCloseButtonOnTabChanged", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabsClosableChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 3"
|
"value": "cell 2 3"
|
||||||
} )
|
} )
|
||||||
|
|||||||
Reference in New Issue
Block a user