mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Table: fixed missing upper right corner (e.g. in SwingX JXTable with column control visible)
This commit is contained in:
@@ -12,6 +12,8 @@ FlatLaf Change Log
|
||||
#17)
|
||||
- Button: Hover and pressed background colors are now derived from actual button
|
||||
background color. (issue #21)
|
||||
- Table: Fixed missing upper right corner (e.g. in SwingX JXTable with column
|
||||
control visible).
|
||||
|
||||
|
||||
## 0.16
|
||||
|
||||
@@ -17,10 +17,8 @@
|
||||
package com.formdev.flatlaf.ui;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ContainerEvent;
|
||||
import java.awt.event.ContainerListener;
|
||||
import java.awt.event.FocusEvent;
|
||||
@@ -30,10 +28,8 @@ import javax.swing.JComponent;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JViewport;
|
||||
import javax.swing.LookAndFeel;
|
||||
import javax.swing.ScrollPaneLayout;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.UIResource;
|
||||
import javax.swing.plaf.basic.BasicScrollPaneUI;
|
||||
|
||||
/**
|
||||
@@ -54,9 +50,6 @@ public class FlatScrollPaneUI
|
||||
public void installUI( JComponent c ) {
|
||||
super.installUI( c );
|
||||
|
||||
if( scrollpane.getLayout() instanceof UIResource )
|
||||
scrollpane.setLayout( new FlatScrollPaneLayout() );
|
||||
|
||||
int focusWidth = UIManager.getInt( "Component.focusWidth" );
|
||||
LookAndFeel.installProperty( c, "opaque", focusWidth == 0 );
|
||||
|
||||
@@ -65,9 +58,6 @@ public class FlatScrollPaneUI
|
||||
|
||||
@Override
|
||||
public void uninstallUI( JComponent c ) {
|
||||
if( scrollpane.getLayout() instanceof FlatScrollPaneLayout )
|
||||
scrollpane.setLayout( new ScrollPaneLayout.UIResource() );
|
||||
|
||||
MigLayoutVisualPadding.uninstall( scrollpane );
|
||||
|
||||
super.uninstallUI( c );
|
||||
@@ -173,27 +163,4 @@ public class FlatScrollPaneUI
|
||||
scrollpane.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
//---- class FlatScrollPaneLayout -----------------------------------------
|
||||
|
||||
private static class FlatScrollPaneLayout
|
||||
extends ScrollPaneLayout
|
||||
{
|
||||
@Override
|
||||
public void layoutContainer( Container parent ) {
|
||||
super.layoutContainer( parent );
|
||||
|
||||
// increase height of vertical scroll bar so that it also fills the upper right corner
|
||||
if( colHead != null && vsb != null && colHead.isVisible() && vsb.isVisible() ) {
|
||||
Rectangle colHeadBounds = colHead.getBounds();
|
||||
Rectangle vsbBounds = vsb.getBounds();
|
||||
|
||||
if( vsbBounds.y > colHeadBounds.y ) {
|
||||
vsbBounds.height += (vsbBounds.y - colHeadBounds.y);
|
||||
vsbBounds.y = colHeadBounds.y;
|
||||
vsb.setBounds( vsbBounds );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,6 +278,7 @@ ScrollBar.width=10
|
||||
|
||||
ScrollPane.border=com.formdev.flatlaf.ui.FlatBorder
|
||||
ScrollPane.background=@@ScrollBar.track
|
||||
ScrollPane.fillUpperCorner=true
|
||||
|
||||
|
||||
#---- Separator ----
|
||||
|
||||
Reference in New Issue
Block a user