diff --git a/src/servers/app/server/ColorSet.cpp b/src/servers/app/server/ColorSet.cpp index b96dba5356..01035ab055 100644 --- a/src/servers/app/server/ColorSet.cpp +++ b/src/servers/app/server/ColorSet.cpp @@ -232,7 +232,7 @@ bool LoadGUIColors(ColorSet *set) rgb_color *col; ssize_t size; - if(msg.FindData("Panel Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) + if(msg.FindData("Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) set->panel_background=*col; if(msg.FindData("Panel Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) set->panel_text=*col; @@ -256,9 +256,9 @@ bool LoadGUIColors(ColorSet *set) set->menu_background=*col; if(msg.FindData("Selected Menu Item Background",(type_code)'RGBC',(const void**)&col,&size)==B_OK) set->menu_selected_background=*col; - if(msg.FindData("Keyboard Navigation Base",(type_code)'RGBC',(const void**)&col,&size)==B_OK) + if(msg.FindData("Navigation Base",(type_code)'RGBC',(const void**)&col,&size)==B_OK) set->keyboard_navigation_base=*col; - if(msg.FindData("Keyboard Navigation Pulse",(type_code)'RGBC',(const void**)&col,&size)==B_OK) + if(msg.FindData("Navigation Pulse",(type_code)'RGBC',(const void**)&col,&size)==B_OK) set->keyboard_navigation_pulse=*col; if(msg.FindData("Menu Item Text",(type_code)'RGBC',(const void**)&col,&size)==B_OK) set->menu_text=*col; diff --git a/src/servers/app/server/Decorator.cpp b/src/servers/app/server/Decorator.cpp index cc8d4535c4..527033c013 100644 --- a/src/servers/app/server/Decorator.cpp +++ b/src/servers/app/server/Decorator.cpp @@ -44,6 +44,7 @@ Decorator::Decorator(BRect rect, int32 wlook, int32 wfeel, int32 wflags) _close_state=false; _minimize_state=false; _zoom_state=false; + _has_focus=false; _title_string=new BString; _driver=NULL; @@ -84,6 +85,7 @@ Decorator::~Decorator(void) void Decorator::SetColors(const ColorSet &cset) { _colors->SetColors(cset); + _SetColors(); } /*! @@ -486,6 +488,16 @@ void Decorator::_DrawZoom(BRect r) { } +/*! + \brief Hook function for when the color set is updated + + This function is called after the decorator's color set is updated. Quite useful + if the decorator uses colors based on those in the system. +*/ +void Decorator::_SetColors(void) +{ +} + /*! \brief Returns the "footprint" of the entire window, including decorator \return Region representing the window's screen footprint diff --git a/src/servers/app/server/Decorator.h b/src/servers/app/server/Decorator.h index d3692476e3..e4f71757f8 100644 --- a/src/servers/app/server/Decorator.h +++ b/src/servers/app/server/Decorator.h @@ -110,6 +110,7 @@ protected: virtual void _DrawZoom(BRect r); virtual void _SetFocus(void)=0; virtual void _DoLayout(void)=0; + virtual void _SetColors(void); ColorSet *_colors; DisplayDriver *_driver; diff --git a/src/servers/app/server/DefaultDecorator.cpp b/src/servers/app/server/DefaultDecorator.cpp index 3af841fe6c..2d3664c19c 100644 --- a/src/servers/app/server/DefaultDecorator.cpp +++ b/src/servers/app/server/DefaultDecorator.cpp @@ -66,8 +66,8 @@ DefaultDecorator::DefaultDecorator(BRect rect, int32 wlook, int32 wfeel, int32 w solidhigh=0xFFFFFFFFFFFFFFFFLL; solidlow=0; - tab_highcol=_colors->window_tab; - tab_lowcol=_colors->window_tab; +// tab_highcol=_colors->window_tab; +// tab_lowcol=_colors->window_tab; #ifdef DEBUG_DECORATOR printf("DefaultDecorator:\n"); @@ -278,8 +278,10 @@ void DefaultDecorator::_SetFocus(void) } else { - tab_highcol.SetColor(235,235,235); - tab_lowcol.SetColor(160,160,160); +// tab_highcol.SetColor(235,235,235); +// tab_lowcol.SetColor(160,160,160); + tab_highcol=_colors->inactive_window_tab; + tab_lowcol=_colors->inactive_window_tab; button_highcol.SetColor(229,229,229); button_lowcol.SetColor(153,153,153); @@ -353,7 +355,7 @@ void DefaultDecorator::_DrawTab(BRect r) _layerdata.highcolor=frame_lowcol; _driver->StrokeRect(_tabrect,&_layerdata,(int8*)&solidhigh); - _layerdata.highcolor=_colors->window_tab; + _layerdata.highcolor=tab_highcol; _driver->FillRect(_tabrect.InsetByCopy(1,1),&_layerdata,(int8*)&solidhigh); // UpdateTitle(layer->name->String()); @@ -366,6 +368,11 @@ void DefaultDecorator::_DrawTab(BRect r) _DrawZoom(_zoomrect); } +void DefaultDecorator::_SetColors(void) +{ + _SetFocus(); +} + void DefaultDecorator::DrawBlendedRect(BRect r, bool down) { // This bad boy is used to draw a rectangle with a gradient. diff --git a/src/servers/app/server/DefaultDecorator.h b/src/servers/app/server/DefaultDecorator.h index deefb5e97a..b3edc7f3c7 100644 --- a/src/servers/app/server/DefaultDecorator.h +++ b/src/servers/app/server/DefaultDecorator.h @@ -42,7 +42,6 @@ public: void Draw(void); BRegion *GetFootprint(void); click_type Clicked(BPoint pt, int32 buttons, int32 modifiers); - protected: void _DrawClose(BRect r); void _DrawFrame(BRect r); @@ -51,6 +50,7 @@ protected: void _DrawZoom(BRect r); void _DoLayout(void); void _SetFocus(void); + void _SetColors(void); void DrawBlendedRect(BRect r, bool down); uint32 taboffset;