WinDecorator::WinDecorator(DesktopSettings& settings, BRect rect, window_look look, uint32 flags) : Decorator(settings, rect, look, flags), taboffset(0) { _UpdateFont(settings); // common colors to both focus and non focus state frame_highcol = (rgb_color){ 255, 255, 255, 255 }; frame_midcol = (rgb_color){ 216, 216, 216, 255 }; frame_lowcol = (rgb_color){ 110, 110, 110, 255 }; frame_lowercol = (rgb_color){ 0, 0, 0, 255 }; // state based colors fFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR); fFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR); fNonFocusTabColor = settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR); fNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR); // Set appropriate colors based on the current focus value. In this case, // each decorator defaults to not having the focus. _SetFocus(); // Do initial decorator setup _DoLayout(); textoffset=5; STRACE(("WinDecorator()\n")); }
void WinDecorator::_UpdateFont(DesktopSettings& settings) { ServerFont font; if (fLook == B_FLOATING_WINDOW_LOOK) settings.GetDefaultPlainFont(font); else settings.GetDefaultBoldFont(font); font.SetFlags(B_FORCE_ANTIALIASING); font.SetSpacing(B_STRING_SPACING); fDrawState.SetFont(font); }
void TabDecorator::_UpdateFont(DesktopSettings& settings) { ServerFont font; if (fTopTab->look == B_FLOATING_WINDOW_LOOK || fTopTab->look == kLeftTitledWindowLook) { settings.GetDefaultPlainFont(font); if (fTopTab->look == kLeftTitledWindowLook) font.SetRotation(90.0f); } else settings.GetDefaultBoldFont(font); font.SetFlags(B_FORCE_ANTIALIASING); font.SetSpacing(B_STRING_SPACING); fDrawState.SetFont(font); }
WinDecorator::WinDecorator(DesktopSettings& settings, BRect frame, Desktop* desktop) : SATDecorator(settings, frame, desktop), // common colors to both focus and non focus state fFrameHighColor((rgb_color){ 255, 255, 255, 255 }), fFrameMidColor((rgb_color){ 216, 216, 216, 255 }), fFrameLowColor((rgb_color){ 110, 110, 110, 255 }), fFrameLowerColor((rgb_color){ 0, 0, 0, 255 }), // state based colors fFocusTabColor(settings.UIColor(B_WINDOW_TAB_COLOR)), fFocusTextColor(settings.UIColor(B_WINDOW_TEXT_COLOR)), fNonFocusTabColor(settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR)), fNonFocusTextColor(settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR)) { STRACE(("WinDecorator:\n")); STRACE(("\tFrame (%.1f,%.1f,%.1f,%.1f)\n", frame.left, frame.top, frame.right, frame.bottom)); }
// TODO: get rid of DesktopSettings here, and introduce private accessor // methods to the Decorator base class TabDecorator::TabDecorator(DesktopSettings& settings, BRect frame) : Decorator(settings, frame), fOldMovingTab(0, 0, -1, -1), // focus color constants kFocusFrameColor(settings.UIColor(B_WINDOW_BORDER_COLOR)), kFocusTabColor(settings.UIColor(B_WINDOW_TAB_COLOR)), kFocusTabColorLight(tint_color(kFocusTabColor, (B_LIGHTEN_MAX_TINT + B_LIGHTEN_2_TINT) / 2)), kFocusTabColorBevel(tint_color(kFocusTabColor, B_LIGHTEN_2_TINT)), kFocusTabColorShadow(tint_color(kFocusTabColor, (B_DARKEN_1_TINT + B_NO_TINT) / 2)), kFocusTextColor(settings.UIColor(B_WINDOW_TEXT_COLOR)), // non-focus color constants kNonFocusFrameColor(settings.UIColor(B_WINDOW_INACTIVE_BORDER_COLOR)), kNonFocusTabColor(settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR)), kNonFocusTabColorLight(tint_color(kNonFocusTabColor, (B_LIGHTEN_MAX_TINT + B_LIGHTEN_2_TINT) / 2)), kNonFocusTabColorBevel(tint_color(kNonFocusTabColor, B_LIGHTEN_2_TINT)), kNonFocusTabColorShadow(tint_color(kNonFocusTabColor, (B_DARKEN_1_TINT + B_NO_TINT) / 2)), kNonFocusTextColor(settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR)) { STRACE(("TabDecorator:\n")); STRACE(("\tFrame (%.1f,%.1f,%.1f,%.1f)\n", frame.left, frame.top, frame.right, frame.bottom)); // TODO: If the decorator was created with a frame too small, it should // resize itself! }
WinDecorator::WinDecorator(DesktopSettings& settings, BRect rect, window_look look, uint32 flags) : Decorator(settings, rect, look, flags) { taboffset=0; frame_highcol = (rgb_color){ 255, 255, 255, 255 }; frame_midcol = (rgb_color){ 216, 216, 216, 255 }; frame_lowcol = (rgb_color){ 110, 110, 110, 255 }; frame_lowercol = (rgb_color){ 0, 0, 0, 255 }; fFocusTabColor = settings.UIColor(B_WINDOW_TAB_COLOR); fFocusTextColor = settings.UIColor(B_WINDOW_TEXT_COLOR); fNonFocusTabColor = settings.UIColor(B_WINDOW_INACTIVE_TAB_COLOR); fNonFocusTextColor = settings.UIColor(B_WINDOW_INACTIVE_TEXT_COLOR); _UpdateFont(settings); _DoLayout(); textoffset=5; STRACE(("WinDecorator()\n")); }