diff --git a/modules/decima-ext-model-exporter/src/main/java/com/shade/decima/ui/data/viewer/model/ModelViewerPanel.java b/modules/decima-ext-model-exporter/src/main/java/com/shade/decima/ui/data/viewer/model/ModelViewerPanel.java index f06337d87..fd3730a82 100644 --- a/modules/decima-ext-model-exporter/src/main/java/com/shade/decima/ui/data/viewer/model/ModelViewerPanel.java +++ b/modules/decima-ext-model-exporter/src/main/java/com/shade/decima/ui/data/viewer/model/ModelViewerPanel.java @@ -54,7 +54,7 @@ public ModelViewerPanel() { try { viewport = new ModelViewport(new Camera()); - viewport.setPreferredSize(new Dimension(400, 400)); + viewport.setPreferredSize(new Dimension(800, 800)); viewport.setMinimumSize(new Dimension(100, 100)); viewport.addPropertyChangeListener(this); } catch (Throwable e) { diff --git a/modules/decima-ui/src/main/java/com/shade/decima/ui/views/ViewManagerImpl.java b/modules/decima-ui/src/main/java/com/shade/decima/ui/views/ViewManagerImpl.java index c0c462de3..b35fd8145 100644 --- a/modules/decima-ui/src/main/java/com/shade/decima/ui/views/ViewManagerImpl.java +++ b/modules/decima-ui/src/main/java/com/shade/decima/ui/views/ViewManagerImpl.java @@ -7,7 +7,6 @@ import com.shade.platform.model.persistence.PersistableComponent; import com.shade.platform.model.persistence.Persistent; import com.shade.platform.ui.UIColor; -import com.shade.platform.ui.controls.ThinSplitPane; import com.shade.platform.ui.controls.ToolTabbedPane; import com.shade.platform.ui.editors.Editor; import com.shade.platform.ui.editors.EditorManager; @@ -152,7 +151,7 @@ private JComponent createViewPanel(@NotNull JComponent root, @NotNull Anchor anc return root; } - final JSplitPane splitPane = new ThinSplitPane(); + final JSplitPane splitPane = new JSplitPane(); final ToolTabbedPane tabbedPane = new ToolTabbedPane(anchor.toSwingConstant(), splitPane); for (var view : views) { diff --git a/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/ThinSplitPane.java b/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/ThinSplitPane.java deleted file mode 100644 index 0e76e310b..000000000 --- a/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/ThinSplitPane.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.shade.platform.ui.controls; - -import javax.swing.*; - -public class ThinSplitPane extends JSplitPane { - public ThinSplitPane() { - } - - public ThinSplitPane(int newOrientation) { - super(newOrientation); - } - - @Override - public String getUIClassID() { - return "ThinSplitPaneUI"; - } -} diff --git a/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/ToolTabbedPane.java b/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/ToolTabbedPane.java index 848043717..091a8f868 100644 --- a/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/ToolTabbedPane.java +++ b/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/ToolTabbedPane.java @@ -12,6 +12,7 @@ public class ToolTabbedPane extends JTabbedPane { public ToolTabbedPane(int tabPlacement, @NotNull JSplitPane parent) { super(tabPlacement); + // FIXME: Please replace this faulty implementation with something else getModel().addChangeListener(ev -> { final int index = getSelectedIndex(); final Object lastDividerLocation = parent.getClientProperty(LAST_DIVIDER_LOCATION_PROPERTY); @@ -19,9 +20,11 @@ public ToolTabbedPane(int tabPlacement, @NotNull JSplitPane parent) { if (index < 0 && lastDividerLocation == null) { parent.putClientProperty(LAST_DIVIDER_LOCATION_PROPERTY, parent.getDividerLocation()); parent.setDividerLocation(TAB_HEADER_SIZE); + parent.setDividerSize(1); } else if (index >= 0 && lastDividerLocation != null) { parent.setDividerLocation((Integer) lastDividerLocation); parent.putClientProperty(LAST_DIVIDER_LOCATION_PROPERTY, null); + parent.setDividerSize(UIManager.getInt("SplitPane.dividerSize")); } }); diff --git a/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/plaf/FlatThinSplitPaneUI.java b/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/plaf/FlatThinSplitPaneUI.java deleted file mode 100644 index bce955c35..000000000 --- a/modules/platform-ui/src/main/java/com/shade/platform/ui/controls/plaf/FlatThinSplitPaneUI.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.shade.platform.ui.controls.plaf; - -import com.formdev.flatlaf.ui.FlatSplitPaneUI; -import com.shade.platform.ui.UIColor; -import com.shade.util.NotNull; - -import javax.swing.*; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.basic.BasicSplitPaneDivider; -import javax.swing.plaf.basic.BasicSplitPaneUI; -import java.awt.*; - -public class FlatThinSplitPaneUI extends FlatSplitPaneUI { - @NotNull - public static ComponentUI createUI(@NotNull JComponent c) { - return new FlatThinSplitPaneUI(); - } - - @Override - public BasicSplitPaneDivider createDefaultDivider() { - return new ThinFlatSplitPaneDivider(this); - } - - @Override - protected void installDefaults() { - super.installDefaults(); - - splitPane.setDividerSize(1); - divider.setDividerSize(1); - dividerSize = 1; - } - - private class ThinFlatSplitPaneDivider extends FlatSplitPaneDivider { - private static final int DRAG_SIZE = 4; - private static final int DRAG_OFFSET = DRAG_SIZE * 2; - - protected ThinFlatSplitPaneDivider(BasicSplitPaneUI ui) { - super(ui); - setBackground(UIColor.SHADOW); - setLayout(new ThinFlatDividerLayout()); - } - - @Override - public void paint(Graphics g) { - g.setColor(getBackground()); - - if (orientation == JSplitPane.HORIZONTAL_SPLIT) { - g.drawLine(DRAG_SIZE, 0, DRAG_SIZE, getHeight() - 1); - } else { - g.drawLine(0, DRAG_SIZE, getWidth() - 1, DRAG_SIZE); - } - } - - @Override - protected void dragDividerTo(int location) { - super.dragDividerTo(location + DRAG_SIZE); - } - - @Override - protected void finishDraggingTo(int location) { - super.finishDraggingTo(location + DRAG_SIZE); - } - - private class ThinFlatDividerLayout extends FlatDividerLayout { - @Override - public void layoutContainer(Container c) { - super.layoutContainer(c); - - final Rectangle bounds = c.getBounds(); - - if (orientation == JSplitPane.HORIZONTAL_SPLIT) { - bounds.x -= DRAG_SIZE; - bounds.width += DRAG_OFFSET; - } else { - bounds.y -= DRAG_SIZE; - bounds.height += DRAG_OFFSET; - } - - setBounds(bounds); - } - } - } -} diff --git a/modules/platform-ui/src/main/java/com/shade/platform/ui/editors/stack/EditorStackContainer.java b/modules/platform-ui/src/main/java/com/shade/platform/ui/editors/stack/EditorStackContainer.java index eee1ff684..d2763c034 100644 --- a/modules/platform-ui/src/main/java/com/shade/platform/ui/editors/stack/EditorStackContainer.java +++ b/modules/platform-ui/src/main/java/com/shade/platform/ui/editors/stack/EditorStackContainer.java @@ -1,7 +1,6 @@ package com.shade.platform.ui.editors.stack; import com.shade.platform.model.messages.MessageBus; -import com.shade.platform.ui.controls.ThinSplitPane; import com.shade.platform.ui.editors.EditorManager; import com.shade.util.NotNull; import com.shade.util.Nullable; @@ -34,7 +33,7 @@ public SplitResult split(int orientation, double position, boolean leading) { final var first = new EditorStackContainer(manager, getComponent(0)); final var second = new EditorStackContainer(manager, null); - final JSplitPane pane = new ThinSplitPane(orientation); + final JSplitPane pane = new JSplitPane(orientation); pane.setLeftComponent(leading ? second : first); pane.setRightComponent(leading ? first : second); diff --git a/modules/platform-ui/src/main/resources/themes/FlatLaf.properties b/modules/platform-ui/src/main/resources/themes/FlatLaf.properties index 291e29238..f660ed1ea 100644 --- a/modules/platform-ui/src/main/resources/themes/FlatLaf.properties +++ b/modules/platform-ui/src/main/resources/themes/FlatLaf.properties @@ -16,7 +16,6 @@ TreeUI = com.shade.platform.ui.controls.tree.TreeUI ToolTipUI = com.shade.platform.ui.controls.plaf.FlatOutlineToolTipUI ToolTabbedPaneUI = com.shade.platform.ui.controls.plaf.FlatToolTabbedPaneUI LabeledSeparatorUI = com.shade.platform.ui.controls.plaf.LabeledSeparatorUI -ThinSplitPaneUI = com.shade.platform.ui.controls.plaf.FlatThinSplitPaneUI FileChooserUI = com.shade.platform.ui.controls.plaf.FlatFileChooserUI #General @@ -25,9 +24,9 @@ TitlePane.buttonSize = 44,28 TabbedPane.tabHeight = 24 TabbedPane.tabRotation = auto Component.hideMnemonics = false -Tree.showsRootHandles = true SplitPane.dividerSize = 7 SplitPaneDivider.border = com.shade.decima.ui.controls.SplitPaneDividerBorder +SplitPaneDivider.style = plain OptionPane.showIcon = true Button.toolbar.spacingInsets = 2,2,2,2 Button.toolbar.margin = 2,2,2,2