aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2010-06-11 09:51:21 +0000
committerYana Stamcheva <yana@jitsi.org>2010-06-11 09:51:21 +0000
commite8767ee8810bef918d023c0557346d63270c1798 (patch)
treed7b79265f22418fafa5dfde424a2f6c43e2afc56
parentd7d11b433ecc3703f9b6bd88c507727b74e7f55f (diff)
downloadjitsi-e8767ee8810bef918d023c0557346d63270c1798.zip
jitsi-e8767ee8810bef918d023c0557346d63270c1798.tar.gz
jitsi-e8767ee8810bef918d023c0557346d63270c1798.tar.bz2
Fixes calls status bar layout (both in one-to-one and conference calls).
-rw-r--r--resources/images/impl/gui/common/holdStatusIcon.pngbin233 -> 258 bytes
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java28
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/conference/BasicConferenceParticipantPanel.java46
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/call/conference/CallPeerMenu.java4
-rw-r--r--src/net/java/sip/communicator/util/swing/SIPCommMenu.java11
-rw-r--r--src/net/java/sip/communicator/util/swing/SIPCommMenuBar.java2
6 files changed, 66 insertions, 25 deletions
diff --git a/resources/images/impl/gui/common/holdStatusIcon.png b/resources/images/impl/gui/common/holdStatusIcon.png
index fb4a265..a244968 100644
--- a/resources/images/impl/gui/common/holdStatusIcon.png
+++ b/resources/images/impl/gui/common/holdStatusIcon.png
Binary files differ
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java
index 4fae776..61204bf 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java
@@ -286,14 +286,26 @@ public class OneToOneCallPeerPanel
dtmfLabel.setForeground(Color.WHITE);
callStatusLabel.setText(callPeer.getState().getStateString());
- PeerStatusPanel statusPanel = new PeerStatusPanel(
- new FlowLayout(FlowLayout.CENTER, 5, 0));
-
- statusPanel.add(securityStatusLabel);
- statusPanel.add(holdStatusLabel);
- statusPanel.add(muteStatusLabel);
- statusPanel.add(callStatusLabel);
- statusPanel.add(dtmfLabel);
+ PeerStatusPanel statusPanel = new PeerStatusPanel(new GridBagLayout());
+
+ GridBagConstraints constraints = new GridBagConstraints();
+
+ constraints.gridx = 0;
+ constraints.gridy = 0;
+ statusPanel.add(securityStatusLabel, constraints);
+
+ constraints.gridx++;
+ statusPanel.add(holdStatusLabel, constraints);
+
+ constraints.gridx++;
+ statusPanel.add(muteStatusLabel, constraints);
+
+ constraints.gridx++;
+ statusPanel.add(callStatusLabel, constraints);
+
+ constraints.gridx++;
+ constraints.weightx = 1f;
+ statusPanel.add(dtmfLabel, constraints);
return statusPanel;
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/conference/BasicConferenceParticipantPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/conference/BasicConferenceParticipantPanel.java
index 6070b47..34f04ae 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/conference/BasicConferenceParticipantPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/conference/BasicConferenceParticipantPanel.java
@@ -45,7 +45,7 @@ public class BasicConferenceParticipantPanel
/**
* The panel containing the title of the participant.
*/
- private final JPanel titleBar = new CallTitlePanel(new BorderLayout());
+ private final JPanel titleBar = new CallTitlePanel(new GridBagLayout());
/**
* The label showing the image of the participant.
@@ -58,10 +58,16 @@ public class BasicConferenceParticipantPanel
private final JLabel callStatusLabel = new JLabel();
private final JPanel statusBar
- = new TransparentPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
+ = new TransparentPanel(new GridBagLayout());
+
+ private final GridBagConstraints statusBarConstraints
+ = new GridBagConstraints();
private final JPanel nameBar
- = new TransparentPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
+ = new TransparentPanel(new GridBagLayout());
+
+ private final GridBagConstraints nameBarConstraints
+ = new GridBagConstraints();
private final TransparentPanel peerDetailsPanel = new TransparentPanel();
@@ -277,7 +283,9 @@ public class BasicConferenceParticipantPanel
*/
public void addToStatusBar(Component component)
{
- this.statusBar.add(component);
+ statusBarConstraints.gridx = statusBarConstraints.gridx + 1;
+ statusBarConstraints.weightx = 0f;
+ this.statusBar.add(component, statusBarConstraints);
}
/**
@@ -286,7 +294,9 @@ public class BasicConferenceParticipantPanel
*/
public void addToNameBar(Component component)
{
- this.nameBar.add(component);
+ nameBarConstraints.gridx = nameBarConstraints.gridx + 1;
+ nameBarConstraints.weightx = 0f;
+ this.nameBar.add(component, nameBarConstraints);
}
/**
@@ -315,13 +325,31 @@ public class BasicConferenceParticipantPanel
{
titleBar.setBorder(BorderFactory.createEmptyBorder(2, 8, 2, 8));
- nameBar.add(nameLabel);
+ nameBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+ nameBarConstraints.gridx = 0;
+ nameBarConstraints.gridy = 0;
+ nameBarConstraints.weightx = 1f;
+ nameBar.add(nameLabel, nameBarConstraints);
statusBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
- statusBar.add(callStatusLabel);
+ statusBarConstraints.gridx = 0;
+ statusBarConstraints.gridy = 0;
+ statusBarConstraints.weightx = 1f;
+ statusBar.add(callStatusLabel, statusBarConstraints);
+
+ GridBagConstraints constraints = new GridBagConstraints();
+
+ constraints.gridx = 0;
+ constraints.gridy = 0;
+ constraints.weightx = 1f;
+ constraints.anchor = GridBagConstraints.WEST;
+ titleBar.add(nameBar, constraints);
- titleBar.add(nameBar, BorderLayout.WEST);
- titleBar.add(statusBar, BorderLayout.EAST);
+ constraints.gridx = 1;
+ constraints.gridy = 0;
+ constraints.weightx = 1f;
+ constraints.anchor = GridBagConstraints.EAST;
+ titleBar.add(statusBar, constraints);
}
/**
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/conference/CallPeerMenu.java b/src/net/java/sip/communicator/impl/gui/main/call/conference/CallPeerMenu.java
index 7f8a87c..3d895c5 100644
--- a/src/net/java/sip/communicator/impl/gui/main/call/conference/CallPeerMenu.java
+++ b/src/net/java/sip/communicator/impl/gui/main/call/conference/CallPeerMenu.java
@@ -57,11 +57,13 @@ public class CallPeerMenu
this.callPeer = peer;
this.setOpaque(false);
- this.setPreferredSize(new Dimension(20, 20));
// Should explicitly remove any border in order to align correctly the
// icon.
this.setBorder(BorderFactory.createEmptyBorder());
+ this.setPreferredSize(new Dimension(16, 16));
+ this.setHorizontalAlignment(SwingConstants.CENTER);
+
this.setIcon(new ImageIcon(ImageLoader
.getImage(ImageLoader.CALL_PEER_TOOLS)));
this.setIconTextGap(0);
diff --git a/src/net/java/sip/communicator/util/swing/SIPCommMenu.java b/src/net/java/sip/communicator/util/swing/SIPCommMenu.java
index 417c996..f225cfa 100644
--- a/src/net/java/sip/communicator/util/swing/SIPCommMenu.java
+++ b/src/net/java/sip/communicator/util/swing/SIPCommMenu.java
@@ -40,6 +40,8 @@ public class SIPCommMenu
/**
* Creates an instance of <tt>SIPCommMenu</tt> by specifying
* the text and the icon.
+ * @param text the text of the menu
+ * @param defaultIcon the menu icon
*/
public SIPCommMenu(String text, Icon defaultIcon)
{
@@ -140,15 +142,16 @@ public class SIPCommMenu
*/
public void paintComponent(Graphics g)
{
- g = g.create();
+ Graphics g2 = g.create();
try
{
- internalPaintComponent(g);
+ internalPaintComponent(g2);
}
finally
{
- g.dispose();
+ g2.dispose();
}
+ super.paintComponent(g);
}
/**
@@ -175,8 +178,6 @@ public class SIPCommMenu
g.fillRoundRect(0, 0, this.getWidth(), this.getHeight(), 20, 20);
g.setColor(UIManager.getColor("Menu.foreground"));
-
- super.paintComponent(g);
}
/**
diff --git a/src/net/java/sip/communicator/util/swing/SIPCommMenuBar.java b/src/net/java/sip/communicator/util/swing/SIPCommMenuBar.java
index 10fa699..45d4d4e 100644
--- a/src/net/java/sip/communicator/util/swing/SIPCommMenuBar.java
+++ b/src/net/java/sip/communicator/util/swing/SIPCommMenuBar.java
@@ -19,8 +19,6 @@ import net.java.sip.communicator.util.swing.plaf.*;
public class SIPCommMenuBar
extends JMenuBar
{
- private boolean isRollover;
-
public SIPCommMenuBar()
{
this.setBorder(BorderFactory.createEmptyBorder());