From: Niki Roo Date: Thu, 7 May 2020 20:18:26 +0000 (+0200) Subject: small ui enhencements X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=bf1feb1bce9bf7248c7bf7e29c133dfa23a97d32;p=fanfix-swing.git small ui enhencements --- diff --git a/src/be/nikiroo/utils/ui/BreadCrumbsBar.java b/src/be/nikiroo/utils/ui/BreadCrumbsBar.java index da382f9c..ed7e0bb0 100644 --- a/src/be/nikiroo/utils/ui/BreadCrumbsBar.java +++ b/src/be/nikiroo/utils/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/src/be/nikiroo/utils/ui/UIUtils.java b/src/be/nikiroo/utils/ui/UIUtils.java index c7fcf623..6c403897 100644 --- a/src/be/nikiroo/utils/ui/UIUtils.java +++ b/src/be/nikiroo/utils/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/src/be/nikiroo/utils/ui/ZoomBox.java b/src/be/nikiroo/utils/ui/ZoomBox.java index c2a7e13d..a8f96095 100644 --- a/src/be/nikiroo/utils/ui/ZoomBox.java +++ b/src/be/nikiroo/utils/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);