Added desktop color updates on workspace switches
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@843 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -181,6 +181,20 @@ void APRView::MessageReceived(BMessage *msg)
|
|||||||
|
|
||||||
switch(msg->what)
|
switch(msg->what)
|
||||||
{
|
{
|
||||||
|
case B_WORKSPACE_ACTIVATED:
|
||||||
|
{
|
||||||
|
BScreen screen;
|
||||||
|
rgb_color col=screen.DesktopColor();
|
||||||
|
settings.ReplaceData("DESKTOP",(type_code)'RGBC',
|
||||||
|
&col,sizeof(rgb_color));
|
||||||
|
|
||||||
|
if(attrstring=="DESKTOP")
|
||||||
|
{
|
||||||
|
picker->SetValue(col);
|
||||||
|
colorwell->SetColor(col);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DELETE_COLORSET:
|
case DELETE_COLORSET:
|
||||||
{
|
{
|
||||||
// Construct the path and delete
|
// Construct the path and delete
|
||||||
@@ -609,7 +623,7 @@ printf("Couldn't open file %s for read\n",path.String());
|
|||||||
SetColorSetName(colorset_name->String());
|
SetColorSetName(colorset_name->String());
|
||||||
|
|
||||||
BScreen screen;
|
BScreen screen;
|
||||||
rgb_color col=screen.GetDesktopColor();
|
rgb_color col=screen.DesktopColor();
|
||||||
settings.ReplaceData("DESKTOP",(type_code)'RGBC',
|
settings.ReplaceData("DESKTOP",(type_code)'RGBC',
|
||||||
&col,sizeof(rgb_color));
|
&col,sizeof(rgb_color));
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
|
#include <Messenger.h>
|
||||||
#include "APRWindow.h"
|
#include "APRWindow.h"
|
||||||
#include "APRView.h"
|
#include "APRView.h"
|
||||||
#include "DecView.h"
|
#include "DecView.h"
|
||||||
|
|
||||||
APRWindow::APRWindow(BRect frame)
|
APRWindow::APRWindow(BRect frame)
|
||||||
: BWindow(frame, "Appearance", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE )
|
: BWindow(frame, "Appearance", B_TITLED_WINDOW,
|
||||||
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES )
|
||||||
{
|
{
|
||||||
tabview=new BTabView(Bounds(),"TabView");
|
tabview=new BTabView(Bounds(),"TabView");
|
||||||
|
|
||||||
BTab *tab=NULL;
|
BTab *tab=NULL;
|
||||||
|
|
||||||
APRView *v=new APRView(Bounds(),"Colors",B_FOLLOW_ALL, B_WILL_DRAW);
|
colors=new APRView(Bounds(),"Colors",B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
tab=new BTab(v);
|
tab=new BTab(colors);
|
||||||
tabview->AddTab(v,tab);
|
tabview->AddTab(colors,tab);
|
||||||
|
|
||||||
DecView *dv=new DecView(Bounds(),"Decorator",B_FOLLOW_ALL, B_WILL_DRAW);
|
decorators=new DecView(Bounds(),"Decorator",B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
tab=new BTab(dv);
|
tab=new BTab(decorators);
|
||||||
tabview->AddTab(dv,tab);
|
tabview->AddTab(decorators,tab);
|
||||||
|
|
||||||
AddChild(tabview);
|
AddChild(tabview);
|
||||||
}
|
}
|
||||||
@@ -25,3 +27,12 @@ bool APRWindow::QuitRequested()
|
|||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void APRWindow::WorkspaceActivated(int32 wkspc, bool is_active)
|
||||||
|
{
|
||||||
|
if(is_active)
|
||||||
|
{
|
||||||
|
BMessenger notifier(colors);
|
||||||
|
notifier.SendMessage(new BMessage(B_WORKSPACE_ACTIVATED));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,12 +6,18 @@
|
|||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <TabView.h>
|
#include <TabView.h>
|
||||||
|
|
||||||
|
class APRView;
|
||||||
|
class DecView;
|
||||||
|
|
||||||
class APRWindow : public BWindow
|
class APRWindow : public BWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
APRWindow(BRect frame);
|
APRWindow(BRect frame);
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
|
virtual void WorkspaceActivated(int32 wkspc, bool is_active);
|
||||||
BTabView *tabview;
|
BTabView *tabview;
|
||||||
|
APRView *colors;
|
||||||
|
DecView *decorators;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user