Fixes the OTR menu in ChatDialog to use the CHAT_MENU_FOREGROUND color in order to make it copy with the other menus. Otherwise, it looks different with themes such as Ambiance on Ubuntu.

cusax-fix
Lyubomir Marinov 16 years ago
parent d0d1315e36
commit 886eb7591f

@ -15,6 +15,8 @@
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.Container;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.swing.*;
/**
* The <tt>MessageWindowMenuBar</tt> is the menu bar in the chat window where
@ -47,16 +49,14 @@ public MessageWindowMenuBar(ChatWindow parentWindow)
{
this.parentWindow = parentWindow;
final ResourceManagementService resources = GuiActivator.getResources();
this.setForeground(
new Color(GuiActivator.getResources()
.getColor("service.gui.MAIN_MENU_FOREGROUND")));
new Color(resources.getColor("service.gui.MAIN_MENU_FOREGROUND")));
fileMenu = new FileMenu(this.parentWindow);
editMenu = new EditMenu(this.parentWindow);
optionsMenu = new OptionsMenu(this.parentWindow);
helpMenu = new HelpMenu(this.parentWindow);
fileMenu.setOpaque(false);
@ -78,6 +78,18 @@ protected void addComponentToContainer(
Component component,
JComponent container)
{
/*
* Apply CHAT_MENU_FOREGROUND in order to prevent plugin
* menus from looking different than the built-in menus.
*/
if (component instanceof SIPCommMenu)
component
.setForeground(
new Color(
resources
.getColor(
"service.gui.CHAT_MENU_FOREGROUND")));
container.add(component, getComponentIndex(helpMenu));
}
};

@ -14,6 +14,7 @@
import net.java.sip.communicator.impl.gui.main.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.Container;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
@ -30,25 +31,22 @@ public class HelpMenu
implements ActionListener,
PluginComponentListener
{
private final Logger logger = Logger.getLogger(HelpMenu.class);
private static final Logger logger = Logger.getLogger(HelpMenu.class);
/**
* Creates an instance of <tt>HelpMenu</tt>.
*
* @param mainFrame
* the parent window
* @param mainFrame the parent window
*/
public HelpMenu(MainFrame mainFrame)
{
super(GuiActivator.getResources().getI18NString("service.gui.HELP"));
ResourceManagementService resources = GuiActivator.getResources();
this.setForeground(
new Color(GuiActivator.getResources().
getColor("service.gui.MAIN_MENU_FOREGROUND")));
this.setMnemonic(
GuiActivator.getResources().getI18nMnemonic("service.gui.HELP"));
this.setOpaque(false);
setForeground(
new Color(resources.getColor("service.gui.MAIN_MENU_FOREGROUND")));
setMnemonic(resources.getI18nMnemonic("service.gui.HELP"));
setOpaque(false);
setText(resources.getI18NString("service.gui.HELP"));
this.initPluginComponents();
}
@ -121,5 +119,4 @@ public void pluginComponentRemoved(PluginComponentEvent event)
this.remove((Component) c.getComponent());
}
}
}

@ -152,8 +152,12 @@ protected void fireMessageEvent(EventObject evt)
logger.debug("Dispatching Message Listeners=" + listeners.size()
+ " evt=" + evt);
// TODO Create a super class like this MessageEventObject that would contain the MessageEventType.
// Also we could fire an event for the MessageDeliveryPending event type (modify MessageListener and OperationSetInstantMessageTransform).
/*
* TODO Create a super class like this MessageEventObject that would
* contain the MessageEventType. Also we could fire an event for the
* MessageDeliveryPending event type (modify MessageListener and
* OperationSetInstantMessageTransform).
*/
MessageEventType eventType = MessageEventType.None;
if (evt instanceof MessageDeliveredEvent)
{
@ -173,11 +177,7 @@ else if (evt instanceof MessageDeliveryFailedEvent)
if (evt == null)
return;
for (Iterator<MessageListener> listenerIter = listeners.iterator(); listenerIter
.hasNext();)
{
MessageListener listener = listenerIter.next();
for (MessageListener listener : listeners)
try
{
switch (eventType)
@ -198,7 +198,6 @@ else if (evt instanceof MessageDeliveryFailedEvent)
{
logger.error("Error delivering message", e);
}
}
}
/**

Loading…
Cancel
Save