mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
Demo: fixed too large gap between themes list and control bar
This commit is contained in:
@@ -30,6 +30,9 @@ import com.formdev.flatlaf.*;
|
|||||||
import com.formdev.flatlaf.extras.FlatAnimatedLafChange;
|
import com.formdev.flatlaf.extras.FlatAnimatedLafChange;
|
||||||
import com.formdev.flatlaf.util.SystemInfo;
|
import com.formdev.flatlaf.util.SystemInfo;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
import net.miginfocom.layout.ConstraintParser;
|
||||||
|
import net.miginfocom.layout.LC;
|
||||||
|
import net.miginfocom.layout.UnitValue;
|
||||||
import net.miginfocom.swing.*;
|
import net.miginfocom.swing.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,6 +47,18 @@ class ControlBar
|
|||||||
ControlBar() {
|
ControlBar() {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
|
// remove top insets
|
||||||
|
MigLayout layout = (MigLayout) getLayout();
|
||||||
|
LC lc = ConstraintParser.parseLayoutConstraint( (String) layout.getLayoutConstraints() );
|
||||||
|
UnitValue[] insets = lc.getInsets();
|
||||||
|
lc.setInsets( new UnitValue[] {
|
||||||
|
new UnitValue( 0, UnitValue.PIXEL, null ),
|
||||||
|
insets[1],
|
||||||
|
insets[2],
|
||||||
|
insets[3]
|
||||||
|
} );
|
||||||
|
layout.setLayoutConstraints( lc );
|
||||||
|
|
||||||
// initialize look and feels combo box
|
// initialize look and feels combo box
|
||||||
DefaultComboBoxModel<LookAndFeelInfo> lafModel = new DefaultComboBoxModel<>();
|
DefaultComboBoxModel<LookAndFeelInfo> lafModel = new DefaultComboBoxModel<>();
|
||||||
lafModel.addElement( new LookAndFeelInfo( "Flat Light (F1)", FlatLightLaf.class.getName() ) );
|
lafModel.addElement( new LookAndFeelInfo( "Flat Light (F1)", FlatLightLaf.class.getName() ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user