diff options
author | Damian Minkov <damencho@jitsi.org> | 2014-07-11 17:19:02 +0300 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2014-07-11 17:19:02 +0300 |
commit | 53320e1bd09b4b91a478b04790e51093bfd9124d (patch) | |
tree | a9d19d42f27a9212f6df7d6b70f1454c1cb8b13b /src | |
parent | 49b8d61552b04458091c07905af49a02cd0b61f7 (diff) | |
download | jitsi-53320e1bd09b4b91a478b04790e51093bfd9124d.zip jitsi-53320e1bd09b4b91a478b04790e51093bfd9124d.tar.gz jitsi-53320e1bd09b4b91a478b04790e51093bfd9124d.tar.bz2 |
Displays global status message when available.
Diffstat (limited to 'src')
3 files changed, 49 insertions, 6 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java b/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java index 6e80b2f..dc7a5dd 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/AccountStatusPanel.java @@ -60,12 +60,12 @@ public class AccountStatusPanel /** * The desired height of the avatar. */ - private static final int AVATAR_ICON_HEIGHT = 40; + private static final int AVATAR_ICON_HEIGHT = 50; /** * The desired width of the avatar. */ - private static final int AVATAR_ICON_WIDTH = 40; + private static final int AVATAR_ICON_WIDTH = 50; /** * The image object storing the avatar. @@ -123,6 +123,18 @@ public class AccountStatusPanel private final PluginContainer mainToolbarPluginContainer; /** + * When setting global status message, the message will be displayed in this + * label. + */ + private final JLabel statusMessageLabel = new JLabel(); + + /** + * This is the panel that contains display name, status message, status + * selector box and plugins. + */ + private final TransparentPanel rightPanel = new TransparentPanel(); + + /** * Creates an instance of <tt>AccountStatusPanel</tt> by specifying the * main window, where this panel is added. */ @@ -144,7 +156,7 @@ public class AccountStatusPanel accountNameLabel.getFont().deriveFont(12f)); accountNameLabel.setOpaque(false); - statusComboBox = new GlobalStatusSelectorBox(); + statusComboBox = new GlobalStatusSelectorBox(this); // Align status combo box with account name field. statusComboBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); @@ -163,9 +175,14 @@ public class AccountStatusPanel statusToolsPanel.add(toolbarPluginPanel, BorderLayout.EAST); - TransparentPanel rightPanel = new TransparentPanel(); + statusMessageLabel.setFont( + statusMessageLabel.getFont().deriveFont(9f)); + statusMessageLabel.setForeground(Color.GRAY); + + rightPanel.setLayout(new BorderLayout(0, 0)); rightPanel.add(accountNameLabel, BorderLayout.NORTH); + rightPanel.add(statusMessageLabel, BorderLayout.CENTER); rightPanel.add(statusToolsPanel, BorderLayout.SOUTH); this.add(accountImageLabel, BorderLayout.WEST); @@ -197,6 +214,24 @@ public class AccountStatusPanel } /** + * Updates status message. + * @param text + */ + void setStatusMessage(String text) + { + if(text == null) + { + statusMessageLabel.setText(""); + rightPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); + } + else + { + rightPanel.setBorder(null); + statusMessageLabel.setText(text); + } + } + + /** * Adds the account given by <tt>protocolProvider</tt> in the contained * status combo box. * @param protocolProvider the <tt>ProtocolProviderService</tt> diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java index 8b8d889..ee6e029 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/GlobalStatusSelectorBox.java @@ -87,12 +87,19 @@ public class GlobalStatusSelectorBox private final GlobalStatusMessageMenu globalStatusMessageMenu; /** + * The parent panel that creates us. + */ + private final AccountStatusPanel accountStatusPanel; + + /** * Creates an instance of <tt>SimpleStatusSelectorBox</tt>. */ - public GlobalStatusSelectorBox() + public GlobalStatusSelectorBox(AccountStatusPanel accountStatusPanel) { super(); + this.accountStatusPanel = accountStatusPanel; + JLabel titleLabel = new JLabel(GuiActivator.getResources() .getI18NString("service.gui.SET_GLOBAL_STATUS")); titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); @@ -156,10 +163,12 @@ public class GlobalStatusSelectorBox this.setToolTipText("<html><b>" + GuiActivator.getResources() .getI18NString("service.gui.SET_GLOBAL_STATUS") + "</b></html>"); + accountStatusPanel.setStatusMessage(null); } else { this.setToolTipText("<html><b>" + message + "</b></html>"); + accountStatusPanel.setStatusMessage(message); } } diff --git a/src/net/java/sip/communicator/plugin/desktoputil/FramedImageWithMenu.java b/src/net/java/sip/communicator/plugin/desktoputil/FramedImageWithMenu.java index 4262e3b..683d8bd 100644 --- a/src/net/java/sip/communicator/plugin/desktoputil/FramedImageWithMenu.java +++ b/src/net/java/sip/communicator/plugin/desktoputil/FramedImageWithMenu.java @@ -51,7 +51,6 @@ public class FramedImageWithMenu /** * Creates the component. - * @param mainFrame the parent frame. * @param imageIcon the image icon to show as default one. * @param width width of component. * @param height height of component. |