diff --git a/src/main/java/mpo/dayon/assistant/gui/AssistantFrame.java b/src/main/java/mpo/dayon/assistant/gui/AssistantFrame.java index 534834c8..6fdd2c5f 100644 --- a/src/main/java/mpo/dayon/assistant/gui/AssistantFrame.java +++ b/src/main/java/mpo/dayon/assistant/gui/AssistantFrame.java @@ -257,6 +257,7 @@ private JTabbedPane createTabbedPane() { tabbedPane.addTab(translate("connection"), connectionPanel); tabbedPane.addTab(translate("session"), sessionPanel); tabbedPane.addTab(translate("settings"), settingsPanel); + tabbedPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // must not be focusable or the key listener won't work tabbedPane.setFocusable(false); tabbedPane.setBorder(null); diff --git a/src/main/java/mpo/dayon/assisted/gui/AssistedFrame.java b/src/main/java/mpo/dayon/assisted/gui/AssistedFrame.java index 63cd3283..5e274b33 100755 --- a/src/main/java/mpo/dayon/assisted/gui/AssistedFrame.java +++ b/src/main/java/mpo/dayon/assisted/gui/AssistedFrame.java @@ -40,8 +40,6 @@ class AssistedFrame extends BaseFrame { private ToolBar createToolBar() { ToolBar toolbar = new ToolBar(); - // i'd prefer to use the DEFAULT_SPACER but... - toolbar.add(Box.createHorizontalStrut(10)); toolbar.add(startButton); toolbar.add(stopButton); if (ScreenUtilities.getNumberOfScreens() > 1 || File.separatorChar == '\\') { diff --git a/src/main/java/mpo/dayon/common/gui/common/BaseFrame.java b/src/main/java/mpo/dayon/common/gui/common/BaseFrame.java index 039d17cb..0c5bc0be 100644 --- a/src/main/java/mpo/dayon/common/gui/common/BaseFrame.java +++ b/src/main/java/mpo/dayon/common/gui/common/BaseFrame.java @@ -86,7 +86,6 @@ protected void setFrameType(FrameType frameType) { protected void setupToolBar(ToolBar toolBar) { float alignmentY = frameType.equals(FrameType.ASSISTANT) ? Component.BOTTOM_ALIGNMENT : Component.CENTER_ALIGNMENT; - toolBar.add(DEFAULT_SPACER); if (FrameType.ASSISTANT.equals(frameType)) { // poor man's vertical align top fingerprints.setBorder(BorderFactory.createEmptyBorder(0, 10, 35, 0)); @@ -95,9 +94,11 @@ protected void setupToolBar(ToolBar toolBar) { toolBar.addAction(createShowInfoAction(), alignmentY); toolBar.addAction(createShowHelpAction(), alignmentY); toolBar.addAction(createExitAction(), alignmentY); - toolBar.add(DEFAULT_SPACER); + if (FrameType.ASSISTANT.equals(frameType)) { + toolBar.add(DEFAULT_SPACER); + } add(toolBar, BorderLayout.NORTH); - toolBar.setBorder(null); + toolBar.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); this.toolBar = toolBar; } diff --git a/src/main/java/mpo/dayon/common/gui/toolbar/ToolBar.java b/src/main/java/mpo/dayon/common/gui/toolbar/ToolBar.java index 306123ed..f17348ea 100644 --- a/src/main/java/mpo/dayon/common/gui/toolbar/ToolBar.java +++ b/src/main/java/mpo/dayon/common/gui/toolbar/ToolBar.java @@ -9,12 +9,12 @@ public class ToolBar extends JToolBar { public static final Font DEFAULT_FONT = new Font("Sans Serif", Font.PLAIN, 16); - public static final Component DEFAULT_SPACER = Box.createHorizontalStrut(10); + public static final Component DEFAULT_SPACER = Box.createHorizontalStrut(8); public ToolBar() { setFloatable(false); setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); - setBorder(null); + setBorder(BorderFactory.createEmptyBorder()); } public void addAction(Action action) {