Updates the incoming call dialog look.

cusax-fix
Yana Stamcheva 13 years ago
parent 8e594b7212
commit 037be1e08e

@ -97,6 +97,7 @@ service.gui.icons.HD_VIDEO_ICON=resources/images/impl/gui/common/hdVideoIcon.png
service.gui.icons.UNAUTHORIZED_CONTACT_PHOTO=resources/images/impl/gui/common/unauthorizedContact.png
service.gui.icons.UNAUTHORIZED_CONTACT_16x16=resources/images/impl/gui/common/unauthorizedContact16x16.png
service.gui.icons.CALL_TOOLBAR_SEPARATOR=resources/images/impl/gui/common/callToolbarSeparator.png
service.gui.icons.CALL_TOOLBAR_DARK_SEPARATOR=resources/images/impl/gui/common/callToolbarDarkSeparator.png
service.gui.icons.CALL_HISTORY_BUTTON_NOTIFICATION=resources/images/impl/gui/common/callHistoryButtonNotification.png
service.gui.icons.AUTO_ANSWER_CHECK=resources/images/impl/gui/common/autoAnswerCheck.png
service.gui.icons.SEARCH_SEPARATOR=resources/images/impl/gui/common/searchSeparator.png
@ -115,9 +116,15 @@ service.gui.buttons.CONTACT_LIST_BUTTON_BG_RIGHT=resources/images/impl/gui/butto
service.gui.buttons.CONTACT_LIST_BUTTON_BG_MIDDLE=resources/images/impl/gui/buttons/contactListButtonBgMiddle.png
service.gui.buttons.CONTACT_LIST_ONE_BUTTON_BG=resources/images/impl/gui/buttons/contactListOneButtonBg.png
service.gui.buttons.CONTACT_LIST_BUTTON_SEPARATOR=resources/images/impl/gui/buttons/contactListButtonSeparator.png
service.gui.buttons.CALL_BUTTON_BG=resources/images/impl/gui/buttons/callButton.png
service.gui.buttons.INCOMING_CALL_BUTTON_BG=resources/images/impl/gui/buttons/callButton.png
service.gui.buttons.INCOMING_CALL_BUTTON_ROLLOVER=resources/images/impl/gui/buttons/callButtonRollover.png
service.gui.buttons.INCOMING_CALL_BUTTON_PRESSED=resources/images/impl/gui/buttons/callButtonPressed.png
service.gui.buttons.MERGE_CALL_BUTTON_BG=resources/images/impl/gui/buttons/mergeToCall.png
service.gui.buttons.MERGE_CALL_BUTTON_ROLLOVER=resources/images/impl/gui/buttons/mergeCallRollover.png
service.gui.buttons.MERGE_CALL_BUTTON_PRESSED=resources/images/impl/gui/buttons/mergeCallPressed.png
service.gui.buttons.CALL_VIDEO_BUTTON_BG=resources/images/impl/gui/buttons/videoCallButton.png
service.gui.buttons.CALL_VIDEO_BUTTON_ROLLOVER=resources/images/impl/gui/buttons/videoCallButtonRollover.png
service.gui.buttons.CALL_VIDEO_BUTTON_PRESSED=resources/images/impl/gui/buttons/videoCallButtonPressed.png
service.gui.buttons.CALL_BUTTON_SMALL=resources/images/impl/gui/buttons/callSmall.png
service.gui.buttons.CALL_BUTTON_SMALL_PRESSED=resources/images/impl/gui/buttons/callSmallPressed.png
service.gui.buttons.CALL_BUTTON_SMALL_ROLLOVER=resources/images/impl/gui/buttons/callSmallRollover.png
@ -136,6 +143,8 @@ service.gui.buttons.ADD_CONTACT_BUTTON_SMALL=resources/images/impl/gui/buttons/a
service.gui.buttons.ADD_CONTACT_BUTTON_SMALL_PRESSED=resources/images/impl/gui/buttons/addContactSmallPressed.png
service.gui.buttons.ADD_CONTACT_BUTTON_SMALL_ROLLOVER=resources/images/impl/gui/buttons/addContactSmallRollover.png
service.gui.buttons.HANGUP_BUTTON_BG=resources/images/impl/gui/buttons/hangupButton.png
service.gui.buttons.HANGUP_BUTTON_ROLLOVER=resources/images/impl/gui/buttons/hangupButtonRollover.png
service.gui.buttons.HANGUP_BUTTON_PRESSED=resources/images/impl/gui/buttons/hangupButtonPressed.png
service.gui.buttons.ADD_TO_CALL_BUTTON=resources/images/impl/gui/buttons/addToCall.png
service.gui.buttons.CALL_SETTING_BUTTON_BG=resources/images/impl/gui/buttons/callSettingButton.png
service.gui.buttons.CALL_SETTING_BUTTON_PRESSED_BG=resources/images/impl/gui/buttons/callSettingButtonPressed.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

@ -71,8 +71,8 @@ public static JComponent createButtonBar(boolean fullScreen,
Component[] buttons)
{
JComponent buttonBar = fullScreen
? new CallToolBarPanel(true)
: new CallToolBarPanel(false);
? new CallToolBarPanel(true, false)
: new CallToolBarPanel(false, false);
if (buttons != null)
{
@ -86,6 +86,19 @@ public static JComponent createButtonBar(boolean fullScreen,
return buttonBar;
}
/**
* Creates a buttons bar from the given list of button components.
*
* @param fullScreen indicates if the created button bar would be shown in
* full screen mode
* @param buttons the list of buttons to add in the created button bar
* @return the created button bar
*/
public static JComponent createIncomingCallButtonBar()
{
return new CallToolBarPanel(false, true);
}
/**
* Gets the first <tt>Frame</tt> in the ancestor <tt>Component</tt>
* hierarchy of a specific <tt>Component</tt>.
@ -120,28 +133,45 @@ public static Frame getFrame(Component component)
private static class CallToolBarPanel
extends OrderedTransparentPanel
{
final Color settingsColor
final Color toolbarColor
= new Color(GuiActivator.getResources().getColor(
"service.gui.CALL_TOOL_BAR"));
final Color settingsFullScreenColor
final Color toolbarFullScreenColor
= new Color(GuiActivator.getResources().getColor(
"service.gui.CALL_TOOL_BAR_FULL_SCREEN"));
final Color toolbarInCallBorderColor
= new Color(GuiActivator.getResources().getColor(
"service.gui.IN_CALL_TOOL_BAR_BORDER"));
final Color toolbarInCallShadowColor
= new Color(GuiActivator.getResources().getColor(
"service.gui.IN_CALL_TOOL_BAR_BORDER_SHADOW"));
final Image buttonSeparatorImage
= ImageLoader.getImage(ImageLoader.CALL_TOOLBAR_SEPARATOR);
final Image buttonDarkSeparatorImage
= ImageLoader.getImage(ImageLoader.CALL_TOOLBAR_DARK_SEPARATOR);
private final boolean isFullScreen;
private final boolean isIncomingCall;
private final int TOOL_BAR_BORDER = 2;
private final int TOOL_BAR_X_GAP = 3;
public CallToolBarPanel(boolean isFullScreen)
private Image separatorImage;
public CallToolBarPanel(boolean isFullScreen,
boolean isIncomingCall)
{
this.isFullScreen = isFullScreen;
this.isIncomingCall = isIncomingCall;
setLayout(new FlowLayout(FlowLayout.CENTER, 3, 0));
setLayout(new FlowLayout(FlowLayout.CENTER, TOOL_BAR_X_GAP, 0));
setBorder(BorderFactory.createEmptyBorder(
TOOL_BAR_BORDER,
TOOL_BAR_BORDER,
@ -159,24 +189,46 @@ public void paintComponent(Graphics g)
try
{
if (isFullScreen)
g.setColor(settingsFullScreenColor);
else
g.setColor(settingsColor);
if (isIncomingCall)
{
g.setColor(toolbarInCallShadowColor);
g.drawRoundRect(
0, 0, getWidth() - 1, getHeight() - 2, 10, 10);
g.fillRoundRect(0, 0, getWidth(), getHeight(), 8, 8);
g.setColor(toolbarInCallBorderColor);
g.drawRoundRect(
0, 0, getWidth() - 1, getHeight() - 3, 10, 10);
}
else
{
if (isFullScreen)
g.setColor(toolbarFullScreenColor);
else
g.setColor(toolbarColor);
// We add the border.
int x = CallToolBarButton.DEFAULT_WIDTH
+ TOOL_BAR_BORDER + TOOL_BAR_X_GAP;
g.fillRoundRect(0, 0, getWidth(), getHeight(), 10, 10);
}
while (x < getWidth() - TOOL_BAR_BORDER - TOOL_BAR_X_GAP)
if (!isFullScreen)
{
g.drawImage(buttonSeparatorImage, x + 1,
(getHeight() - buttonSeparatorImage.getHeight(this))/2,
this);
x += CallToolBarButton.DEFAULT_WIDTH + TOOL_BAR_X_GAP;
// We add the border.
int x = CallToolBarButton.DEFAULT_WIDTH
+ TOOL_BAR_BORDER + TOOL_BAR_X_GAP;
while (x < getWidth() - TOOL_BAR_BORDER - TOOL_BAR_X_GAP)
{
separatorImage = (isIncomingCall)
? buttonDarkSeparatorImage
: buttonSeparatorImage;
g.drawImage(separatorImage,
x + 1,
(getHeight()
- separatorImage.getHeight(this))/2,
this);
x += CallToolBarButton.DEFAULT_WIDTH + TOOL_BAR_X_GAP;
}
}
}
finally

@ -18,6 +18,7 @@
import org.jitsi.service.neomedia.*;
import org.jitsi.service.neomedia.device.*;
import org.jitsi.util.*;
import org.jitsi.util.swing.TransparentPanel;
import com.explodingpixels.macwidgets.*;
@ -52,11 +53,6 @@ public abstract class PreCallDialog
*/
private static final String HANGUP_BUTTON = "HangupButton";
/**
* The horizontal gap between buttons.
*/
private static final int HGAP = 5;
/**
* Call button.
*/
@ -244,36 +240,31 @@ private Window createPreCallWindow( String title,
*/
private void initComponents()
{
JPanel mainPanel = new JPanel(new GridBagLayout());
JPanel mainPanel = new TransparentPanel(new BorderLayout(10, 0));
mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
// disable html rendering
callLabelDisplayName.putClientProperty("html.disable", Boolean.TRUE);
callLabelAddress.putClientProperty("html.disable", Boolean.TRUE);
callLabelImage.putClientProperty("html.disable", Boolean.TRUE);
JPanel buttonsPanel = new TransparentPanel(new GridBagLayout());
JComponent buttonsPanel
= CallPeerRendererUtils.createIncomingCallButtonBar();
callButton = new SIPCommButton(
ImageLoader.getImage(ImageLoader.CALL_BUTTON_BG));
callButton = new SIPCommButton();
if(mergeCall)
{
mergeCallButton = new SIPCommButton(
ImageLoader.getImage(ImageLoader.MERGE_CALL_BUTTON_BG));
mergeCallButton = new SIPCommButton();
}
if(video)
{
videoCallButton = new SIPCommButton(
ImageLoader.getImage(ImageLoader.CALL_VIDEO_BUTTON_BG));
videoCallButton = new SIPCommButton();
}
hangupButton = new SIPCommButton(
ImageLoader.getImage(ImageLoader.HANGUP_BUTTON_BG));
mainPanel.setPreferredSize(new Dimension(400, 90));
mainPanel.setOpaque(false);
mainPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
hangupButton = new SIPCommButton();
callButton.setName(CALL_BUTTON);
hangupButton.setName(HANGUP_BUTTON);
@ -296,71 +287,47 @@ private void initComponents()
preCallWindow.add(mainPanel);
GridBagConstraints constraints = new GridBagConstraints();
constraints.anchor = GridBagConstraints.WEST;
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridheight = 2;
constraints.insets = new Insets(0, 0, 0, HGAP);
mainPanel.add(callLabelImage, constraints);
mainPanel.add(callLabelImage, BorderLayout.WEST);
constraints.insets = new Insets(0, 0, 0, 0);
constraints.gridheight = 1;
constraints.gridx = 1;
constraints.weightx = 1;
mainPanel.add(callLabelDisplayName, constraints);
JPanel labelsPanel = new TransparentPanel();
labelsPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
constraints.gridy = 1;
mainPanel.add(callLabelAddress, constraints);
labelsPanel.setLayout(new BoxLayout(labelsPanel, BoxLayout.Y_AXIS));
callLabelDisplayName.setAlignmentX(JLabel.LEFT_ALIGNMENT);
labelsPanel.add(callLabelDisplayName);
labelsPanel.add(Box.createVerticalStrut(3));
callLabelAddress.setAlignmentX(JLabel.LEFT_ALIGNMENT);
labelsPanel.add(callLabelAddress);
if (accountsCombo != null)
{
constraints.gridx = 1;
constraints.weightx = 1;
mainPanel.add(Box.createVerticalStrut(HGAP), constraints);
constraints.gridx = 1;
constraints.gridy = 2;
constraints.weightx = 1;
mainPanel.add(accountsCombo, constraints);
labelsPanel.add(Box.createVerticalStrut(3));
accountsCombo.setAlignmentX(JLabel.LEFT_ALIGNMENT);
labelsPanel.add(accountsCombo);
}
constraints.anchor = GridBagConstraints.CENTER;
constraints.gridx = 2;
constraints.gridy = 0;
constraints.weightx = 0;
constraints.gridheight = 2;
mainPanel.add(Box.createHorizontalStrut(HGAP), constraints);
mainPanel.add(labelsPanel, BorderLayout.CENTER);
// Loads skin resources.
loadSkin();
constraints.anchor = GridBagConstraints.CENTER;
constraints.gridx = 3;
constraints.weightx = 0;
mainPanel.add(buttonsPanel, constraints);
JPanel rightPanel = new TransparentPanel(
new FlowLayout(FlowLayout.CENTER, 0, 0));
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridheight = 0;
buttonsPanel.add(callButton, constraints);
rightPanel.setBorder(BorderFactory.createEmptyBorder(6, 0, 0, 0));
buttonsPanel.add(callButton);
if(mergeCall)
{
constraints.gridx++;
buttonsPanel.add(Box.createHorizontalStrut(HGAP));
constraints.gridx++;
buttonsPanel.add(mergeCallButton, constraints);
}
buttonsPanel.add(mergeCallButton);
if(video)
{
constraints.gridx++;
buttonsPanel.add(Box.createHorizontalStrut(HGAP));
constraints.gridx++;
buttonsPanel.add(videoCallButton, constraints);
}
constraints.gridx++;
buttonsPanel.add(Box.createHorizontalStrut(HGAP));
constraints.gridx++;
buttonsPanel.add(hangupButton, constraints);
buttonsPanel.add(videoCallButton);
buttonsPanel.add(hangupButton);
rightPanel.add(buttonsPanel);
mainPanel.add(rightPanel, BorderLayout.EAST);
}
/**
@ -436,13 +403,38 @@ public JComboBox getAccountsCombo()
public void loadSkin()
{
callButton.setBackgroundImage(
ImageLoader.getImage(ImageLoader.CALL_BUTTON_BG));
ImageLoader.getImage(ImageLoader.INCOMING_CALL_BUTTON_BG));
callButton.setRolloverImage(
ImageLoader.getImage(ImageLoader.INCOMING_CALL_BUTTON_ROLLOVER));
callButton.setPressedImage(
ImageLoader.getImage(ImageLoader.INCOMING_CALL_BUTTON_PRESSED));
videoCallButton.setBackgroundImage(
ImageLoader.getImage(ImageLoader.CALL_VIDEO_BUTTON_BG));
if (videoCallButton != null)
{
videoCallButton.setBackgroundImage(
ImageLoader.getImage(ImageLoader.CALL_VIDEO_BUTTON_BG));
videoCallButton.setRolloverImage(
ImageLoader.getImage(ImageLoader.CALL_VIDEO_BUTTON_ROLLOVER));
videoCallButton.setPressedImage(
ImageLoader.getImage(ImageLoader.CALL_VIDEO_BUTTON_PRESSED));
}
if (mergeCallButton != null)
{
mergeCallButton.setBackgroundImage(
ImageLoader.getImage(ImageLoader.MERGE_CALL_BUTTON_BG));
mergeCallButton.setRolloverImage(
ImageLoader.getImage(ImageLoader.MERGE_CALL_BUTTON_ROLLOVER));
mergeCallButton.setPressedImage(
ImageLoader.getImage(ImageLoader.MERGE_CALL_BUTTON_PRESSED));
}
hangupButton.setBackgroundImage(
ImageLoader.getImage(ImageLoader.HANGUP_BUTTON_BG));
hangupButton.setRolloverImage(
ImageLoader.getImage(ImageLoader.HANGUP_BUTTON_ROLLOVER));
hangupButton.setPressedImage(
ImageLoader.getImage(ImageLoader.HANGUP_BUTTON_PRESSED));
}
/**

@ -191,14 +191,6 @@ public void incomingCallReceived(CallEvent event) {}
*/
public void outgoingCallCreated(CallEvent event) {}
/**
* Reloads icons.
*/
public void loadSkin()
{
this.initCallLabel(getCallLabels());
}
/**
* Answers the call when the call button has been pressed.
*/

Loading…
Cancel
Save