mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 07:17: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.
|
and "One Dark" themes.
|
||||||
- TabbedPane: Support hiding tab area if it contains only one tab. (set client
|
- TabbedPane: Support hiding tab area if it contains only one tab. (set client
|
||||||
property `JTabbedPane.hideTabAreaWithOneTab` to `true`)
|
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
|
#### 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
|
- Custom window decorations: Title bar was not hidden if window is in
|
||||||
full-screen mode. (issue #212)
|
full-screen mode. (issue #212)
|
||||||
|
|
||||||
|
|||||||
@@ -362,11 +362,6 @@ public class FlatTabbedPaneUI
|
|||||||
protected void installComponents() {
|
protected void installComponents() {
|
||||||
super.installComponents();
|
super.installComponents();
|
||||||
|
|
||||||
// create tab close button
|
|
||||||
tabCloseButton = new TabCloseButton();
|
|
||||||
tabCloseButton.setVisible( false );
|
|
||||||
tabPane.add( tabCloseButton );
|
|
||||||
|
|
||||||
// find scrollable tab viewport
|
// find scrollable tab viewport
|
||||||
tabViewport = null;
|
tabViewport = null;
|
||||||
if( isScrollTabLayout() ) {
|
if( isScrollTabLayout() ) {
|
||||||
@@ -393,11 +388,7 @@ public class FlatTabbedPaneUI
|
|||||||
|
|
||||||
super.uninstallComponents();
|
super.uninstallComponents();
|
||||||
|
|
||||||
if( tabCloseButton != null ) {
|
tabCloseButton = null;
|
||||||
tabPane.remove( tabCloseButton );
|
|
||||||
tabCloseButton = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
tabViewport = 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 ) {
|
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
|
// update state of tab close button
|
||||||
boolean rollover = (tabIndex == getRolloverTab());
|
boolean rollover = (tabIndex == getRolloverTab());
|
||||||
ButtonModel bm = tabCloseButton.getModel();
|
ButtonModel bm = tabCloseButton.getModel();
|
||||||
|
|||||||
Reference in New Issue
Block a user