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
|
void
|
||||||
WorkspacesView::_DrawWindow(DrawingEngine* drawingEngine,
|
WorkspacesView::_DrawWindow(DrawingEngine* drawingEngine,
|
||||||
const BRect& workspaceFrame, const BRect& screenFrame, ::Window* window,
|
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())
|
if (window->Feel() == kDesktopWindowFeel || window->IsHidden())
|
||||||
return;
|
return;
|
||||||
@@ -189,28 +189,33 @@ WorkspacesView::_DrawWindow(DrawingEngine* drawingEngine,
|
|||||||
rgb_color activeTabColor = (rgb_color){ 255, 203, 0, 255 };
|
rgb_color activeTabColor = (rgb_color){ 255, 203, 0, 255 };
|
||||||
rgb_color inactiveTabColor = (rgb_color){ 232, 232, 232, 255 };
|
rgb_color inactiveTabColor = (rgb_color){ 232, 232, 232, 255 };
|
||||||
rgb_color navColor = (rgb_color){ 0, 0, 229, 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) {
|
if (decorator != NULL) {
|
||||||
activeTabColor = decorator->UIColor(B_WINDOW_TAB_COLOR);
|
activeTabColor = decorator->UIColor(B_WINDOW_TAB_COLOR);
|
||||||
inactiveTabColor = decorator->UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
|
inactiveTabColor = decorator->UIColor(B_WINDOW_INACTIVE_TAB_COLOR);
|
||||||
navColor = decorator->UIColor(B_NAVIGATION_BASE_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 white = (rgb_color){ 255, 255, 255, 255 };
|
||||||
|
|
||||||
rgb_color tabColor = inactiveTabColor;
|
rgb_color tabColor = inactiveTabColor;
|
||||||
if (window->IsFocus())
|
rgb_color frameColor = inactiveFrameColor;
|
||||||
|
if (window->IsFocus()) {
|
||||||
tabColor = activeTabColor;
|
tabColor = activeTabColor;
|
||||||
|
frameColor = activeFrameColor;
|
||||||
|
}
|
||||||
|
|
||||||
if (!active) {
|
if (!workspaceActive) {
|
||||||
_DarkenColor(tabColor);
|
_DarkenColor(tabColor);
|
||||||
_DarkenColor(frameColor);
|
_DarkenColor(frameColor);
|
||||||
_DarkenColor(white);
|
_DarkenColor(white);
|
||||||
}
|
}
|
||||||
if (window == fSelectedWindow) {
|
//if (window == fSelectedWindow) {
|
||||||
frameColor = ui_color(B_WINDOW_BORDER_COLOR);
|
// frameColor = ui_color(B_WINDOW_BORDER_COLOR);
|
||||||
//frameColor = navColor;
|
//}
|
||||||
}
|
|
||||||
|
|
||||||
if (tabFrame.left < frame.left)
|
if (tabFrame.left < frame.left)
|
||||||
tabFrame.left = frame.left;
|
tabFrame.left = frame.left;
|
||||||
@@ -276,8 +281,8 @@ WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine,
|
|||||||
BRect rect = _WorkspaceAt(index);
|
BRect rect = _WorkspaceAt(index);
|
||||||
|
|
||||||
Workspace workspace(*Window()->Desktop(), index);
|
Workspace workspace(*Window()->Desktop(), index);
|
||||||
bool active = workspace.IsCurrent();
|
bool workspaceActive = workspace.IsCurrent();
|
||||||
if (active) {
|
if (workspaceActive) {
|
||||||
// draw active frame
|
// draw active frame
|
||||||
rgb_color black = (rgb_color){ 0, 0, 0, 255 };
|
rgb_color black = (rgb_color){ 0, 0, 0, 255 };
|
||||||
drawingEngine->StrokeRect(rect, black);
|
drawingEngine->StrokeRect(rect, black);
|
||||||
@@ -289,7 +294,7 @@ WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine,
|
|||||||
rect.InsetBy(1, 1);
|
rect.InsetBy(1, 1);
|
||||||
|
|
||||||
rgb_color color = workspace.Color();
|
rgb_color color = workspace.Color();
|
||||||
if (!active)
|
if (!workspaceActive)
|
||||||
_DarkenColor(color);
|
_DarkenColor(color);
|
||||||
|
|
||||||
// draw windows
|
// draw windows
|
||||||
@@ -319,7 +324,7 @@ WorkspacesView::_DrawWorkspace(DrawingEngine* drawingEngine,
|
|||||||
BPoint leftTop;
|
BPoint leftTop;
|
||||||
while (workspace.GetPreviousWindow(window, leftTop) == B_OK) {
|
while (workspace.GetPreviousWindow(window, leftTop) == B_OK) {
|
||||||
_DrawWindow(drawingEngine, rect, screenFrame, window,
|
_DrawWindow(drawingEngine, rect, screenFrame, window,
|
||||||
leftTop, backgroundRegion, active);
|
leftTop, backgroundRegion, workspaceActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw background
|
// draw background
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ private:
|
|||||||
void _DrawWindow(DrawingEngine* drawingEngine,
|
void _DrawWindow(DrawingEngine* drawingEngine,
|
||||||
const BRect& workspaceFrame, const BRect& screenFrame,
|
const BRect& workspaceFrame, const BRect& screenFrame,
|
||||||
::Window* window, BPoint windowPosition,
|
::Window* window, BPoint windowPosition,
|
||||||
BRegion& backgroundRegion, bool active);
|
BRegion& backgroundRegion, bool workspaceActive);
|
||||||
void _DrawWorkspace(DrawingEngine* drawingEngine,
|
void _DrawWorkspace(DrawingEngine* drawingEngine,
|
||||||
BRegion& redraw, int32 index);
|
BRegion& redraw, int32 index);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user