OBOS-only system colors are loaded and used
Added _SetColors() hook function to Decorator API git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3889 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d5d9cf4017
commit
dae7413e8a
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user