Make the window frame color settable by the decorator fixing a TODO. Although I don't think it is used by the Workspaces app anyway.
This commit is contained in:
@@ -167,7 +167,7 @@ WorkspacesView::_WindowFrame(const BRect& workspaceFrame,
|
||||
void
|
||||
WorkspacesView::_DrawWindow(DrawingEngine* drawingEngine,
|
||||
const BRect& workspaceFrame, const BRect& screenFrame, ::Window* window,
|
||||
BPoint windowPosition, BRegion& backgroundRegion, bool active)
|
||||
BPoint windowPosition, BRegion& backgroundRegion, bool workspaceActive)
|
||||
{
|
||||
if (window->Feel() == kDesktopWindowFeel || window->IsHidden())
|
||||
return;
|
||||
@@ -189,28 +189,33 @@ WorkspacesView::_DrawWindow(DrawingEngine* drawingEngine,
|
||||
rgb_color activeTabColor = (rgb_color){ 255, 203, 0, 255 };
|
||||
rgb_color inactiveTabColor = (rgb_color){ 232, 232, 232, 255 };
|
||||
rgb_color navColor = (rgb_color){ 0, 0, 229, 255 };
|
||||
rgb_color activeFrameColor = (rgb_color){ 180, 180, 180, 255 };
|
||||
rgb_color inactiveFrameColor = (rgb_color){ 180, 180, 180, 255 };
|
||||
if (decorator != NULL) {
|
||||
activeTabColor = decorator->UIColor(B_WINDOW_TAB_COLOR);
|
||||
inactiveTabColor = decorator->UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
|
||||
navColor = decorator->UIColor(B_NAVIGATION_BASE_COLOR);
|
||||
activeFrameColor = decorator->UIColor(B_WINDOW_BORDER_COLOR);
|
||||
inactiveFrameColor = decorator->UIColor(B_WINDOW_INACTIVE_BORDER_COLOR);
|
||||
}
|
||||
// TODO: let decorator do this!
|
||||
rgb_color frameColor = (rgb_color){ 180, 180, 180, 255 };
|
||||
|
||||
rgb_color white = (rgb_color){ 255, 255, 255, 255 };
|
||||
|
||||
rgb_color tabColor = inactiveTabColor;
|
||||
if (window->IsFocus())
|
||||
rgb_color frameColor = inactiveFrameColor;
|
||||
if (window->IsFocus()) {
|
||||
tabColor = activeTabColor;
|
||||
frameColor = activeFrameColor;
|
||||
}
|
||||
|
||||
if (!active) {
|
||||
if (!workspaceActive) {
|
||||
_DarkenColor(tabColor);
|
||||
_DarkenColor(frameColor);
|
||||
_DarkenColor(white);
|
||||
}
|
||||
if (window == fSelectedWindow) {
|
||||
frameColor = ui_color(B_WINDOW_BORDER_COLOR);
|
||||
//frameColor = navColor;
|
||||
}
|
||||
//if (window == fSelectedWindow) {
|
||||
// frameColor = ui_color(B_WINDOW_BORDER_COLOR);
|
||||
//}
|
||||
|
||||
if (tabFrame.left < frame.left)
|
||||
tabFrame.left = frame.left;
|
||||
@@ -276,8 +281,8 @@ WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine,
|
||||
BRect rect = _WorkspaceAt(index);
|
||||
|
||||
Workspace workspace(*Window()->Desktop(), index);
|
||||
bool active = workspace.IsCurrent();
|
||||
if (active) {
|
||||
bool workspaceActive = workspace.IsCurrent();
|
||||
if (workspaceActive) {
|
||||
// draw active frame
|
||||
rgb_color black = (rgb_color){ 0, 0, 0, 255 };
|
||||
drawingEngine->StrokeRect(rect, black);
|
||||
@@ -289,7 +294,7 @@ WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine,
|
||||
rect.InsetBy(1, 1);
|
||||
|
||||
rgb_color color = workspace.Color();
|
||||
if (!active)
|
||||
if (!workspaceActive)
|
||||
_DarkenColor(color);
|
||||
|
||||
// draw windows
|
||||
@@ -319,7 +324,7 @@ WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine,
|
||||
BPoint leftTop;
|
||||
while (workspace.GetPreviousWindow(window, leftTop) == B_OK) {
|
||||
_DrawWindow(drawingEngine, rect, screenFrame, window,
|
||||
leftTop, backgroundRegion, active);
|
||||
leftTop, backgroundRegion, workspaceActive);
|
||||
}
|
||||
|
||||
// draw background
|
||||
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
void _DrawWindow(DrawingEngine* drawingEngine,
|
||||
const BRect& workspaceFrame, const BRect& screenFrame,
|
||||
::Window* window, BPoint windowPosition,
|
||||
BRegion& backgroundRegion, bool active);
|
||||
BRegion& backgroundRegion, bool workspaceActive);
|
||||
void _DrawWorkspace(DrawingEngine* drawingEngine,
|
||||
BRegion& redraw, int32 index);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user