From fa85642107e57195dd3a71e4b755f2474cf61649 Mon Sep 17 00:00:00 2001 From: "Brian P. Hinz" Date: Thu, 20 Aug 2015 00:44:57 -0400 Subject: [PATCH] Java viewer UI updates Make the layout of the options dialog more consistent with the native viewer. --- .../com/tigervnc/vncviewer/OptionsDialog.java | 24 +++++++++---------- java/com/tigervnc/vncviewer/VncViewer.java | 1 - 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/java/com/tigervnc/vncviewer/OptionsDialog.java b/java/com/tigervnc/vncviewer/OptionsDialog.java index a47ec395..8c9542cb 100644 --- a/java/com/tigervnc/vncviewer/OptionsDialog.java +++ b/java/com/tigervnc/vncviewer/OptionsDialog.java @@ -81,6 +81,7 @@ class OptionsDialog extends Dialog implements new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS)); JTabbedPane tabPane = new JTabbedPane(); + tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); ButtonGroup encodingGroup = new ButtonGroup(); ButtonGroup colourGroup = new ButtonGroup(); @@ -202,9 +203,9 @@ class OptionsDialog extends Dialog implements scalingFactor.setEditable(true); scalingFactor.addItemListener(this); scalingFactor.setEnabled(!cc.viewer.embed.getValue()); - addGBComponent(desktopSize,ScreenPanel, 0, 1, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,5,0,5)); - addGBComponent(desktopSizePanel,ScreenPanel, 0, 2, 2, 1, 2, 2, 1, 0, GridBagConstraints.REMAINDER, GridBagConstraints.LINE_START, new Insets(0,20,0,0)); - addGBComponent(fullScreen,ScreenPanel, 0, 3, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(0,5,0,5)); + addGBComponent(desktopSize,ScreenPanel, 0, 0, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,5,0,5)); + addGBComponent(desktopSizePanel,ScreenPanel, 0, 1, 2, 1, 2, 2, 1, 0, GridBagConstraints.REMAINDER, GridBagConstraints.LINE_START, new Insets(0,20,0,0)); + addGBComponent(fullScreen,ScreenPanel, 0, 2, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(0,5,0,5)); addGBComponent(scalingFactorLabel,ScreenPanel, 0, 4, 1, GridBagConstraints.REMAINDER, 2, 2, 1, 1, GridBagConstraints.NONE, GridBagConstraints.FIRST_LINE_START, new Insets(8,8,0,5)); addGBComponent(scalingFactor,ScreenPanel, 1, 4, 1, GridBagConstraints.REMAINDER, 2, 2, 25, 1, GridBagConstraints.NONE, GridBagConstraints.FIRST_LINE_START, new Insets(4,5,0,5)); @@ -217,9 +218,9 @@ class OptionsDialog extends Dialog implements useLocalCursor.addItemListener(this); acceptBell = new JCheckBox("Beep when requested by the server"); acceptBell.addItemListener(this); - addGBComponent(shared,MiscPanel, 0, 1, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,5,0,5)); - addGBComponent(useLocalCursor,MiscPanel, 0, 2, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,5,0,5)); - addGBComponent(acceptBell,MiscPanel, 0, 3, 2, 1, 2, 2, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.FIRST_LINE_START, new Insets(4,5,0,5)); + addGBComponent(shared,MiscPanel, 0, 0, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,5,0,5)); + addGBComponent(useLocalCursor,MiscPanel, 0, 1, 2, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(4,5,0,5)); + addGBComponent(acceptBell,MiscPanel, 0, 2, 2, 1, 2, 2, 1, 1, GridBagConstraints.HORIZONTAL, GridBagConstraints.FIRST_LINE_START, new Insets(4,5,0,5)); // load/save tab DefaultsPanel=new JPanel(new GridBagLayout()); @@ -252,19 +253,17 @@ class OptionsDialog extends Dialog implements SecPanel=new JPanel(new GridBagLayout()); JPanel encryptionPanel = new JPanel(new GridBagLayout()); - encryptionPanel.setBorder(BorderFactory.createTitledBorder("Session Encryption")); + encryptionPanel.setBorder(BorderFactory.createTitledBorder("Encryption")); encNone = addCheckbox("None", null, encryptionPanel); encTLS = addCheckbox("Anonymous TLS", null, encryptionPanel); - encX509 = addJCheckBox("TLS with X.509 certificates", null, encryptionPanel, new GridBagConstraints(0,2,1,1,1,1,GridBagConstraints.LINE_START,GridBagConstraints.REMAINDER,new Insets(0,0,0,60),0,0)); + encX509 = addJCheckBox("TLS with X.509 certificates", null, encryptionPanel, new GridBagConstraints(0,2,3,1,1,1,GridBagConstraints.LINE_START,GridBagConstraints.REMAINDER,new Insets(0,0,0,0),0,0)); - JPanel x509Panel = new JPanel(new GridBagLayout()); - x509Panel.setBorder(BorderFactory.createTitledBorder("X.509 certificates")); ca = new JButton("Load CA certificate"); ca.addActionListener(this); crl = new JButton("Load CRL certificate"); crl.addActionListener(this); - addGBComponent(ca, x509Panel, 0, 0, 1, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.FIRST_LINE_START, new Insets(2,2,2,2)); - addGBComponent(crl, x509Panel, 1, 0, 1, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.LINE_START, new Insets(2,2,2,2)); + addGBComponent(ca, encryptionPanel, 0, 3, 1, 1, 2, 2, 1, 0, GridBagConstraints.NONE, GridBagConstraints.LINE_START, new Insets(2,20,2,2)); + addGBComponent(crl, encryptionPanel, 1, 3, 1, 1, 2, 2, 1, 0, GridBagConstraints.NONE, GridBagConstraints.LINE_START, new Insets(2,2,2,2)); JPanel authPanel = new JPanel(new GridBagLayout()); authPanel.setBorder(BorderFactory.createTitledBorder("Authentication")); @@ -280,7 +279,6 @@ class OptionsDialog extends Dialog implements secVeNCrypt.addItemListener(this); addGBComponent(secVeNCrypt,SecPanel, 0, 0, 1, 1, 2, 2, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.FIRST_LINE_START, new Insets(4,5,0,30)); addGBComponent(encryptionPanel,SecPanel, 0, 1, 1, 1, 2, 2, 1, 0, GridBagConstraints.NONE, GridBagConstraints.LINE_START, new Insets(0,10,2,5)); - addGBComponent(x509Panel,SecPanel, 0, 2, 1, 1, 2, 2, 1, 0, GridBagConstraints.NONE, GridBagConstraints.LINE_START, new Insets(2,10,2,5)); addGBComponent(authPanel,SecPanel, 0, 3, 1, 1, 2, 2, 1, 1, GridBagConstraints.NONE, GridBagConstraints.FIRST_LINE_START, new Insets(2,10,2,5)); tabPane.add(FormatPanel); diff --git a/java/com/tigervnc/vncviewer/VncViewer.java b/java/com/tigervnc/vncviewer/VncViewer.java index cc21c2e1..1a49d009 100644 --- a/java/com/tigervnc/vncviewer/VncViewer.java +++ b/java/com/tigervnc/vncviewer/VncViewer.java @@ -100,7 +100,6 @@ public class VncViewer extends javax.swing.JApplet UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } UIManager.setLookAndFeel(laf); - UIManager.put("TitledBorder.titleColor",Color.blue); if (UIManager.getLookAndFeel().getName().equals("Metal")) { UIManager.put("swing.boldMetal", Boolean.FALSE); Enumeration keys = UIManager.getDefaults().keys(); -- 2.39.5