Skip to content

Commit

Permalink
Application: Inflate UI a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadelessFox committed Jul 3, 2024
1 parent bfa0837 commit 9232970
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import javax.swing.*;
import java.awt.*;

@ViewRegistration(id = NavigatorView.ID, label = "Projects", icon = "Node.archiveIcon", keystroke = "alt 1")
@ViewRegistration(id = NavigatorView.ID, label = "Explorer", icon = "Node.archiveIcon", keystroke = "alt 1")
public class NavigatorView extends BaseView<NavigatorTree> {
public static final String ID = "navigator";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public ViewPane(@NotNull ViewRegistration registration, @NotNull Component compo
final JToolBar toolbar = new JToolBar();
toolbar.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(0, 0, 1, 0, UIColor.SHADOW),
BorderFactory.createEmptyBorder(0, 8, 0, 0)
BorderFactory.createEmptyBorder(2, 8, 2, 0)
));
toolbar.add(UIUtils.createBoldLabel(registration.label()));
toolbar.add(Box.createHorizontalGlue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public BreadcrumbBar(@NotNull Tree tree) {
this.tree = tree;
this.tree.addTreeSelectionListener(this);

setLayout(new FlowLayout(FlowLayout.LEADING, 2, 2));
setLayout(new FlowLayout(FlowLayout.LEADING, 4, 4));
setPath(tree.getModel().getTreePathToRoot(tree.getModel().getRoot()), false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.awt.*;

public abstract class ColoredListCellRenderer<T> extends ColoredComponent implements ListCellRenderer<T> {
private static final Insets INSETS_LIST = new Insets(2, 6, 2, 6);
private static final Insets INSETS_LIST = new Insets(3, 6, 3, 6);
private static final Insets INSETS_COMBO = new Insets(0, 6, 0, 6);

private boolean selected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public abstract class ColoredTreeCellRenderer<T> extends ColoredComponent implem

public ColoredTreeCellRenderer() {
updateUI();
setPadding(new Insets(2, 2, 2, 2));
setPadding(new Insets(3, 4, 3, 4));
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

public class ToolTabbedPane extends JTabbedPane {
private static final String LAST_DIVIDER_LOCATION_PROPERTY = "lastDividerLocation";
private static final int TAB_HEADER_SIZE = 24;

public ToolTabbedPane(int tabPlacement, @NotNull JSplitPane parent) {
super(tabPlacement);
Expand All @@ -19,7 +18,7 @@ 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.setDividerLocation(getHeaderSize());
parent.setDividerSize(1);
} else if (index >= 0 && lastDividerLocation != null) {
parent.setDividerLocation((Integer) lastDividerLocation);
Expand Down Expand Up @@ -68,10 +67,14 @@ public void minimizePane() {

private int computeMinimizedDividerLocation(@NotNull JSplitPane pane) {
return switch (tabPlacement) {
case LEFT, TOP -> TAB_HEADER_SIZE;
case RIGHT -> pane.getWidth() - TAB_HEADER_SIZE;
case BOTTOM -> pane.getHeight() - TAB_HEADER_SIZE;
case LEFT, TOP -> getHeaderSize();
case RIGHT -> pane.getWidth() - getHeaderSize();
case BOTTOM -> pane.getHeight() - getHeaderSize();
default -> throw new IllegalArgumentException("Unexpected tab placement: " + tabPlacement);
};
}

private static int getHeaderSize() {
return UIManager.getInt("TabbedPane.tabHeight");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FileChooserUI = com.shade.platform.ui.controls.plaf.FlatFileChooserUI
#General
TitlePane.unifiedBackground = false
TitlePane.buttonSize = 44,28
TabbedPane.tabHeight = 24
TabbedPane.tabHeight = 28
TabbedPane.tabRotation = auto
Component.hideMnemonics = false
Tree.showsRootHandles = true
Expand Down Expand Up @@ -97,4 +97,9 @@ Graph.edgeSelectionBackground = @selectionBackground
# Editor onboarding
Onboarding.font = $h2.regular.font
Onboarding.textForeground = #8a8a8a
Onboarding.descriptionForeground = #393939
Onboarding.descriptionForeground = #393939

[style]ToolBar.inTextField = \
floatable: false; \
opaque: false; \
borderMargins: 0,1,0,1

0 comments on commit 9232970

Please sign in to comment.