From 7ce18848c8327967ce27b90abf2e280953530b5f Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Thu, 7 May 2020 22:18:26 +0200 Subject: [PATCH] small ui enhencements --- ui/BreadCrumbsBar.java | 12 +++++++++--- ui/UIUtils.java | 4 ++-- ui/ZoomBox.java | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ui/BreadCrumbsBar.java b/ui/BreadCrumbsBar.java index da382f9c..ed7e0bb0 100644 --- a/ui/BreadCrumbsBar.java +++ b/ui/BreadCrumbsBar.java @@ -39,11 +39,12 @@ public class BreadCrumbsBar extends ListenerPanel { } } }); - + this.add(button, BorderLayout.CENTER); } - if (!node.getChildren().isEmpty()) { + if ((node.isRoot() && node.getChildren().isEmpty()) + || !node.getChildren().isEmpty()) { // TODO allow an image or ">", viewer down = new JToggleButton(">"); final JPopupMenu popup = new JPopupMenu(); @@ -112,6 +113,8 @@ public class BreadCrumbsBar extends ListenerPanel { } }); + setSelectedNode(new DataNode(null, null)); + new SwingWorker, Void>() { @Override protected DataNode doInBackground() throws Exception { @@ -122,7 +125,10 @@ public class BreadCrumbsBar extends ListenerPanel { @Override protected void done() { try { - node = get(); + DataNode node = get(); + + setSelectedNode(null); + BreadCrumbsBar.this.node = node; addCrumb(node); // TODO: option? diff --git a/ui/UIUtils.java b/ui/UIUtils.java index c7fcf623..6c403897 100644 --- a/ui/UIUtils.java +++ b/ui/UIUtils.java @@ -107,9 +107,9 @@ public class UIUtils { * @param color * the base colour * @param x - * the X coordinate + * the X coordinate of the upper left corner * @param y - * the Y coordinate + * the Y coordinate of the upper left corner * @param width * the width radius * @param height diff --git a/ui/ZoomBox.java b/ui/ZoomBox.java index c2a7e13d..a8f96095 100644 --- a/ui/ZoomBox.java +++ b/ui/ZoomBox.java @@ -179,7 +179,7 @@ public class ZoomBox extends ListenerPanel { }); zoomLabel = new JLabel(); - zoomLabel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + zoomLabel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); setIcons(null, null, null, null); setOrientation(vertical); -- 2.27.0