small UI tweaks
authorNiki Roo <niki@nikiroo.be>
Mon, 4 May 2020 21:43:10 +0000 (23:43 +0200)
committerNiki Roo <niki@nikiroo.be>
Mon, 4 May 2020 21:43:10 +0000 (23:43 +0200)
src/be/nikiroo/fanfix_swing/gui/PropertiesPanel.java
src/be/nikiroo/fanfix_swing/gui/viewer/ViewerNonImages.java

index ecd4cee50003aa88bfab181387f1ca0510b10c6a..82c1e873a857c0ba23e55b9e2c692d60d914cdd2 100644 (file)
@@ -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
index 56015abca5ce1a462e93163c4deb42468c91578e..088111462ea35d4a516e8944b947d5244fe2358c 100644 (file)
@@ -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();