Configurable foreground color of the tabbed pane look and feel.

cusax-fix
Yana Stamcheva 17 years ago
parent 0a30edfce8
commit 2af15f779d

@ -74,6 +74,9 @@ service.gui.TAB_TITLE_HIGHLIGHT=DE4900
# Tab default text color.
service.gui.TAB_TITLE=474747
# Tab text color for selected tabs.
service.gui.TAB_TITLE_SELECTED=FFFFFF
# Custom components GUI constants
# Background color for incoming call lines in the call list.

@ -34,7 +34,13 @@
public class SIPCommTabbedPaneEnhancedUI
extends SIPCommTabbedPaneUI
{
private static final Color whiteColor = Color.white;
private static final Color TAB_HIGHLIGHT_FOREGROUND_COLOR
= new Color(UtilActivator.getResources()
.getColor("service.gui.TAB_TITLE_HIGHLIGHT"));
private static final Color TAB_SELECTED_FOREGROUND_COLOR
= new Color(UtilActivator.getResources()
.getColor("service.gui.TAB_TITLE_SELECTED"));
private static final int TAB_OVERLAP
= Integer.parseInt(UtilActivator.getResources().
@ -263,13 +269,12 @@ protected void paintText(Graphics g, int tabPlacement, Font font,
if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex))
{
if (isSelected)
g.setColor(whiteColor);
g.setColor(TAB_SELECTED_FOREGROUND_COLOR);
else
{
if (this.isTabHighlighted(tabIndex))
{
g.setColor(new Color(UtilActivator.getResources()
.getColor("service.gui.TAB_TITLE_HIGHLIGHT")));
g.setColor(TAB_HIGHLIGHT_FOREGROUND_COLOR);
}
else
g.setColor(tabPane.getForegroundAt(tabIndex));
@ -334,17 +339,20 @@ public void paint(Graphics g)
g.drawLine(0, 0, w - 2, 0); // top
if (isRollOver) {
if (isRollOver)
{
// do highlights or shadows
Color color1;
Color color2;
if (isPressed) {
color2 = whiteColor;
if (isPressed)
{
color2 = Color.WHITE;
color1 = shadow;
} else {
color1 = whiteColor;
}
else
{
color1 = Color.WHITE;
color2 = shadow;
}

Loading…
Cancel
Save