From cb8f09c7bdb24ce13e1e4aa98d505f9ae1d118ca Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 4 May 2020 23:43:10 +0200 Subject: [PATCH] small UI tweaks --- src/be/nikiroo/fanfix_swing/gui/PropertiesPanel.java | 6 ++++-- src/be/nikiroo/fanfix_swing/gui/viewer/ViewerNonImages.java | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/be/nikiroo/fanfix_swing/gui/PropertiesPanel.java b/src/be/nikiroo/fanfix_swing/gui/PropertiesPanel.java index ecd4cee5..82c1e873 100644 --- a/src/be/nikiroo/fanfix_swing/gui/PropertiesPanel.java +++ b/src/be/nikiroo/fanfix_swing/gui/PropertiesPanel.java @@ -93,6 +93,7 @@ public class PropertiesPanel extends JPanel { JPanel mainPanelValues = new JPanel(); mainPanelValues .setLayout(new BoxLayout(mainPanelValues, BoxLayout.Y_AXIS)); + mainPanelValues.setBackground(UIManager.getColor("List.background")); mainPanel.add(mainPanelKeys, BorderLayout.WEST); mainPanel.add(UIUtils.scroll(mainPanelValues, true, false), @@ -105,6 +106,7 @@ public class PropertiesPanel extends JPanel { jKey.getFont().getSize())); jKey.setEditable(false); jKey.setLineWrap(false); + jKey.setOpaque(false); jKey.setBackground(trans); listenables.add(jKey); mainPanelKeys.add(jKey); @@ -112,10 +114,10 @@ public class PropertiesPanel extends JPanel { final JTextArea jValue = new JTextArea(desc.get(key)); jValue.setEditable(false); jValue.setLineWrap(false); + jValue.setOpaque(false); + jValue.setBackground(trans); listenables.add(jValue); mainPanelValues.add(jValue); - - mainPanelValues.setBackground(jValue.getBackground()); } // Image diff --git a/src/be/nikiroo/fanfix_swing/gui/viewer/ViewerNonImages.java b/src/be/nikiroo/fanfix_swing/gui/viewer/ViewerNonImages.java index 56015abc..08811146 100644 --- a/src/be/nikiroo/fanfix_swing/gui/viewer/ViewerNonImages.java +++ b/src/be/nikiroo/fanfix_swing/gui/viewer/ViewerNonImages.java @@ -196,6 +196,12 @@ public class ViewerNonImages extends JFrame { area.setCaretPosition(0); area.scrollRectToVisible(new Rectangle()); + // To work around the fact that sometimes the space of the + // descpane is kept and the title bar has to take it + Rectangle pos = getBounds(); + pack(); + setBounds(pos); + // So we can use the keyboard navigation even after a // toolbar click area.requestFocus(); -- 2.27.0