inactive workspaces are drawn with darker colors
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13787 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -92,7 +92,7 @@ WorkspacesLayer::_WindowFrame(const BRect& workspaceFrame,
|
|||||||
void
|
void
|
||||||
WorkspacesLayer::_DrawWindow(const BRect& workspaceFrame,
|
WorkspacesLayer::_DrawWindow(const BRect& workspaceFrame,
|
||||||
const BRect& screenFrame, WinBorder* window,
|
const BRect& screenFrame, WinBorder* window,
|
||||||
BRegion& backgroundRegion)
|
BRegion& backgroundRegion, bool active)
|
||||||
{
|
{
|
||||||
if (window->Feel() == kDesktopWindowFeel)
|
if (window->Feel() == kDesktopWindowFeel)
|
||||||
return;
|
return;
|
||||||
@@ -103,6 +103,14 @@ WorkspacesLayer::_DrawWindow(const BRect& workspaceFrame,
|
|||||||
|
|
||||||
// ToDo: let decorator do this!
|
// ToDo: let decorator do this!
|
||||||
RGBColor yellow = window->GetDecorator()->GetColors().window_tab;
|
RGBColor yellow = window->GetDecorator()->GetColors().window_tab;
|
||||||
|
RGBColor gray(180, 180, 180);
|
||||||
|
RGBColor white(255, 255, 255);
|
||||||
|
|
||||||
|
if (!active) {
|
||||||
|
_DarkenColor(yellow);
|
||||||
|
_DarkenColor(gray);
|
||||||
|
_DarkenColor(white);
|
||||||
|
}
|
||||||
|
|
||||||
if (tabFrame.left < frame.left)
|
if (tabFrame.left < frame.left)
|
||||||
tabFrame.left = frame.left;
|
tabFrame.left = frame.left;
|
||||||
@@ -117,10 +125,8 @@ WorkspacesLayer::_DrawWindow(const BRect& workspaceFrame,
|
|||||||
|
|
||||||
fDriver->StrokeLine(tabFrame.LeftTop(), tabFrame.RightBottom(), yellow);
|
fDriver->StrokeLine(tabFrame.LeftTop(), tabFrame.RightBottom(), yellow);
|
||||||
|
|
||||||
RGBColor gray(180, 180, 180);
|
|
||||||
fDriver->StrokeRect(frame, gray);
|
fDriver->StrokeRect(frame, gray);
|
||||||
|
|
||||||
RGBColor white(255, 255, 255);
|
|
||||||
frame.InsetBy(1, 1);
|
frame.InsetBy(1, 1);
|
||||||
fDriver->FillRect(frame, white);
|
fDriver->FillRect(frame, white);
|
||||||
}
|
}
|
||||||
@@ -132,7 +138,8 @@ WorkspacesLayer::_DrawWorkspace(int32 index)
|
|||||||
BRect rect = _WorkspaceAt(index);
|
BRect rect = _WorkspaceAt(index);
|
||||||
|
|
||||||
Workspace* workspace = GetRootLayer()->WorkspaceAt(index);
|
Workspace* workspace = GetRootLayer()->WorkspaceAt(index);
|
||||||
if (workspace == GetRootLayer()->ActiveWorkspace()) {
|
bool active = workspace == GetRootLayer()->ActiveWorkspace();
|
||||||
|
if (active) {
|
||||||
// draw active frame
|
// draw active frame
|
||||||
RGBColor black(0, 0, 0);
|
RGBColor black(0, 0, 0);
|
||||||
fDriver->StrokeRect(rect, black);
|
fDriver->StrokeRect(rect, black);
|
||||||
@@ -149,6 +156,10 @@ WorkspacesLayer::_DrawWorkspace(int32 index)
|
|||||||
else
|
else
|
||||||
color.SetColor(51, 102, 152);
|
color.SetColor(51, 102, 152);
|
||||||
|
|
||||||
|
if (!active) {
|
||||||
|
_DarkenColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
// draw windows
|
// draw windows
|
||||||
|
|
||||||
#ifndef NEW_CLIPPING
|
#ifndef NEW_CLIPPING
|
||||||
@@ -175,7 +186,7 @@ WorkspacesLayer::_DrawWorkspace(int32 index)
|
|||||||
fDriver->ConstrainClippingRegion(&backgroundRegion);
|
fDriver->ConstrainClippingRegion(&backgroundRegion);
|
||||||
|
|
||||||
for (int32 i = count; i-- > 0;) {
|
for (int32 i = count; i-- > 0;) {
|
||||||
_DrawWindow(rect, screenFrame, windows[i], backgroundRegion);
|
_DrawWindow(rect, screenFrame, windows[i], backgroundRegion, active);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,6 +203,13 @@ WorkspacesLayer::_DrawWorkspace(int32 index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WorkspacesLayer::_DarkenColor(RGBColor& color) const
|
||||||
|
{
|
||||||
|
color = tint_color(color.GetColor32(), B_DARKEN_2_TINT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WorkspacesLayer::Draw(const BRect& updateRect)
|
WorkspacesLayer::Draw(const BRect& updateRect)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,8 +30,10 @@ class WorkspacesLayer : public Layer {
|
|||||||
|
|
||||||
void _DrawWindow(const BRect& workspaceFrame,
|
void _DrawWindow(const BRect& workspaceFrame,
|
||||||
const BRect& screenFrame, WinBorder* window,
|
const BRect& screenFrame, WinBorder* window,
|
||||||
BRegion& backgroundRegion);
|
BRegion& backgroundRegion, bool active);
|
||||||
void _DrawWorkspace(int32 index);
|
void _DrawWorkspace(int32 index);
|
||||||
|
|
||||||
|
void _DarkenColor(RGBColor& color) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WORKSPACES_LAYER_H
|
#endif // WORKSPACES_LAYER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user