Bug 13199 fixed: There was a thin blue line around ack button in about box 73/13973/2
Calixte DENIZET [Tue, 11 Mar 2014 13:16:15 +0000 (14:16 +0100)]
Change-Id: Ia2b8be358e022d52a29e602fab100c917bde0645

scilab/CHANGES_5.5.X
scilab/modules/gui/src/java/org/scilab/modules/gui/utils/ScilabAboutBox.java

index 837cc2b..2940b3c 100644 (file)
@@ -708,6 +708,8 @@ Scilab Bug Fixes
 
 * Bug #13194 fixed - part help page improved.
 
+* Bug #13199 fixed - There was a thin blue line around acknowledgements button in about box.
+
 * Bug #13200 fixed - about() ACKNOWLEDGEMENTS did not render utf-8 characters.
 
 * Bug #13201 fixed - x_mdialog entries had no margin.
index 5869f9f..7461f63 100644 (file)
@@ -68,14 +68,24 @@ public class ScilabAboutBox {
      * Display the about box
      */
     public static void displayAndWait() {
-
         String filename = SCIDIR + "/ACKNOWLEDGEMENTS"; // Source version
         if (!new File(filename).exists()) {
             filename = SCIDIR + "/../../ACKNOWLEDGEMENTS"; // Linux binary
             // version
         }
 
-        createAboutBox(Messages.gettext("About Scilab..."), filename);
+        if (SwingUtilities.isEventDispatchThread()) {
+            createAboutBox(Messages.gettext("About Scilab..."), filename);
+        } else {
+            final String fname = filename;
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+                    public void run() {
+                        createAboutBox(Messages.gettext("About Scilab..."), fname);
+                    }
+                });
+            } catch (Exception e) { }
+        }
     }
 
     /**
@@ -101,7 +111,8 @@ public class ScilabAboutBox {
 
         ScilabSwingUtilities.closeOnEscape(aboutBox);
 
-        aboutBox.setContentPane(new AboutPanel(aboutBox, ackFile));
+        AboutPanel ap = new AboutPanel(aboutBox, ackFile);
+        aboutBox.setContentPane(ap);
         aboutBox.setResizable(false);
 
         /*
@@ -116,6 +127,7 @@ public class ScilabAboutBox {
                                  / 2 - (aboutBox.getHeight() / 2));
         }
         aboutBox.setVisible(true);
+        ap.close.requestFocus();
     }
 
     @SuppressWarnings("serial")
@@ -268,7 +280,7 @@ public class ScilabAboutBox {
         private JScrollPane ackScrollPane;
         private JTextPane ackText;
         private JToggleButton acknowledgements;
-        private JButton close;
+        JButton close;
         private JPanel topPane;
     }
 }