This patch fixes the way the DefaultDecorator reads its colors
from DesktopSettings. It allows you to change the tab color (focused and non focused) for new windows. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30279 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
* Authors:
|
* Authors:
|
||||||
* DarkWyrm <[email protected]>
|
* DarkWyrm <[email protected]>
|
||||||
* Stephan Aßmus <[email protected]>
|
* Stephan Aßmus <[email protected]>
|
||||||
|
* Philippe Saint-Pierre, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! Default and fallback decorator for the app_server - the yellow tabs */
|
/*! Default and fallback decorator for the app_server - the yellow tabs */
|
||||||
@@ -80,10 +81,10 @@ DefaultDecorator::DefaultDecorator(DesktopSettings& settings, BRect rect,
|
|||||||
fNonFocusFrameColors[1] = (rgb_color){ 216, 216, 216, 255 };
|
fNonFocusFrameColors[1] = (rgb_color){ 216, 216, 216, 255 };
|
||||||
fNonFocusFrameColors[1] = fNonFocusFrameColors[0];
|
fNonFocusFrameColors[1] = fNonFocusFrameColors[0];
|
||||||
|
|
||||||
fFocusTabColor = UIColor(B_WINDOW_TAB_COLOR);
|
fFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR);
|
||||||
fFocusTextColor = UIColor(B_WINDOW_TEXT_COLOR);
|
fFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR);
|
||||||
fNonFocusTabColor = UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
|
fNonFocusTabColor = settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
|
||||||
fNonFocusTextColor = UIColor(B_WINDOW_INACTIVE_TEXT_COLOR);
|
fNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR);
|
||||||
|
|
||||||
fCloseBitmaps[0] = fCloseBitmaps[1] = fCloseBitmaps[2] = fCloseBitmaps[3]
|
fCloseBitmaps[0] = fCloseBitmaps[1] = fCloseBitmaps[2] = fCloseBitmaps[3]
|
||||||
= fZoomBitmaps[0] = fZoomBitmaps[1] = fZoomBitmaps[2] = fZoomBitmaps[3]
|
= fZoomBitmaps[0] = fZoomBitmaps[1] = fZoomBitmaps[2] = fZoomBitmaps[3]
|
||||||
@@ -1269,6 +1270,8 @@ DefaultDecorator::_GetBitmapForButton(int32 item, bool down, bool focus,
|
|||||||
bool focus;
|
bool focus;
|
||||||
int32 width;
|
int32 width;
|
||||||
int32 height;
|
int32 height;
|
||||||
|
rgb_color focusColor;
|
||||||
|
rgb_color nonFocusColor;
|
||||||
UtilityBitmap* bitmap;
|
UtilityBitmap* bitmap;
|
||||||
decorator_bitmap* next;
|
decorator_bitmap* next;
|
||||||
};
|
};
|
||||||
@@ -1282,7 +1285,9 @@ DefaultDecorator::_GetBitmapForButton(int32 item, bool down, bool focus,
|
|||||||
while (current) {
|
while (current) {
|
||||||
if (current->item == item && current->down == down
|
if (current->item == item && current->down == down
|
||||||
&& current->focus == focus && current->width == width
|
&& current->focus == focus && current->width == width
|
||||||
&& current->height == height) {
|
&& current->height == height
|
||||||
|
&& current->focusColor == object->fFocusTabColor
|
||||||
|
&& current->nonFocusColor == object->fNonFocusTabColor) {
|
||||||
return current->bitmap;
|
return current->bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1317,15 +1322,15 @@ DefaultDecorator::_GetBitmapForButton(int32 item, bool down, bool focus,
|
|||||||
BRect zoomRect(rect);
|
BRect zoomRect(rect);
|
||||||
zoomRect.left += inset;
|
zoomRect.left += inset;
|
||||||
zoomRect.top += inset;
|
zoomRect.top += inset;
|
||||||
object->_DrawBlendedRect(sBitmapDrawingEngine, zoomRect, down,
|
object->_DrawBlendedRect(sBitmapDrawingEngine, zoomRect,
|
||||||
focus);
|
down, focus);
|
||||||
|
|
||||||
inset = floorf(width / 2.1);
|
inset = floorf(width / 2.1);
|
||||||
zoomRect = rect;
|
zoomRect = rect;
|
||||||
zoomRect.right -= inset;
|
zoomRect.right -= inset;
|
||||||
zoomRect.bottom -= inset;
|
zoomRect.bottom -= inset;
|
||||||
object->_DrawBlendedRect(sBitmapDrawingEngine, zoomRect, down,
|
object->_DrawBlendedRect(sBitmapDrawingEngine, zoomRect,
|
||||||
focus);
|
down, focus);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1348,6 +1353,8 @@ DefaultDecorator::_GetBitmapForButton(int32 item, bool down, bool focus,
|
|||||||
entry->width = width;
|
entry->width = width;
|
||||||
entry->height = height;
|
entry->height = height;
|
||||||
entry->bitmap = bitmap;
|
entry->bitmap = bitmap;
|
||||||
|
entry->focusColor = object->fFocusTabColor;
|
||||||
|
entry->nonFocusColor = object->fNonFocusTabColor;
|
||||||
entry->next = sBitmapList;
|
entry->next = sBitmapList;
|
||||||
sBitmapList = entry;
|
sBitmapList = entry;
|
||||||
return bitmap;
|
return bitmap;
|
||||||
|
|||||||
Reference in New Issue
Block a user