mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
TabbedPane: no longer add (internal) tab close button component as child to JTabbedPane (issue #219)
This commit is contained in:
10
CHANGELOG.md
10
CHANGELOG.md
@@ -12,14 +12,16 @@ FlatLaf Change Log
|
||||
and "One Dark" themes.
|
||||
- TabbedPane: Support hiding tab area if it contains only one tab. (set client
|
||||
property `JTabbedPane.hideTabAreaWithOneTab` to `true`)
|
||||
- Table: Do not paint last vertical grid line if auto-resize mode is not off.
|
||||
(issue #46)
|
||||
- Table: Fixed unstable grid line thickness when scaled on HiDPI screens. (issue
|
||||
#152)
|
||||
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- Table: Do not paint last vertical grid line if auto-resize mode is not off.
|
||||
(issue #46)
|
||||
- Table: Fixed unstable grid line thickness when scaled on HiDPI screens. (issue
|
||||
#152)
|
||||
- TabbedPane: No longer add (internal) tab close button component as child to
|
||||
`JTabbedPane`. (issue #219)
|
||||
- Custom window decorations: Title bar was not hidden if window is in
|
||||
full-screen mode. (issue #212)
|
||||
|
||||
|
||||
@@ -362,11 +362,6 @@ public class FlatTabbedPaneUI
|
||||
protected void installComponents() {
|
||||
super.installComponents();
|
||||
|
||||
// create tab close button
|
||||
tabCloseButton = new TabCloseButton();
|
||||
tabCloseButton.setVisible( false );
|
||||
tabPane.add( tabCloseButton );
|
||||
|
||||
// find scrollable tab viewport
|
||||
tabViewport = null;
|
||||
if( isScrollTabLayout() ) {
|
||||
@@ -393,11 +388,7 @@ public class FlatTabbedPaneUI
|
||||
|
||||
super.uninstallComponents();
|
||||
|
||||
if( tabCloseButton != null ) {
|
||||
tabPane.remove( tabCloseButton );
|
||||
tabCloseButton = null;
|
||||
}
|
||||
|
||||
tabCloseButton = null;
|
||||
tabViewport = null;
|
||||
}
|
||||
|
||||
@@ -934,6 +925,12 @@ public class FlatTabbedPaneUI
|
||||
}
|
||||
|
||||
protected void paintTabCloseButton( Graphics g, int tabIndex, int x, int y, int w, int h ) {
|
||||
// create tab close button
|
||||
if( tabCloseButton == null ) {
|
||||
tabCloseButton = new TabCloseButton();
|
||||
tabCloseButton.setVisible( false );
|
||||
}
|
||||
|
||||
// update state of tab close button
|
||||
boolean rollover = (tabIndex == getRolloverTab());
|
||||
ButtonModel bm = tabCloseButton.getModel();
|
||||
|
||||
Reference in New Issue
Block a user