From d1941a2765b0bffaeb2b003fb275467372cf56a6 Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Thu, 8 Aug 2002 21:33:55 +0000 Subject: [PATCH] Added Decorator tab and functionality git-svn-id: file:///srv/svn/repos/haiku/trunk/current@656 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/prefs/appearance/APRMain.cpp | 2 +- src/prefs/appearance/APRView.cpp | 17 ++++------------- src/prefs/appearance/APRView.h | 2 +- src/prefs/appearance/APRWindow.cpp | 16 ++++++++++++++-- src/prefs/appearance/APRWindow.h | 2 ++ src/prefs/appearance/Jamfile | 2 +- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/prefs/appearance/APRMain.cpp b/src/prefs/appearance/APRMain.cpp index 5672ce51c2..8bc11a0d28 100644 --- a/src/prefs/appearance/APRMain.cpp +++ b/src/prefs/appearance/APRMain.cpp @@ -7,7 +7,7 @@ APRApplication::APRApplication() BRect rect; // This is just the size and location of the window when Show() is called - rect.Set(100,100,580,220); + rect.Set(100,100,520,345); aprwin=new APRWindow(rect); aprwin->Show(); } diff --git a/src/prefs/appearance/APRView.cpp b/src/prefs/appearance/APRView.cpp index 18b7879e21..cee34851af 100644 --- a/src/prefs/appearance/APRView.cpp +++ b/src/prefs/appearance/APRView.cpp @@ -1,5 +1,5 @@ /* - APRView.cpp: The Appearance app's bulky boy + APRView.cpp: The Appearance app's color handler Handles all the grunt work. Color settings are stored in a BMessage to allow for easy transition to and from disk. The messy details are in the @@ -9,20 +9,11 @@ #include #include "APRView.h" #include "PortLink.h" +#include "defs.h" #include #include #include -#define SETTINGS_DIR "/boot/home/config/settings/app_server/" - -#define APPLY_SETTINGS 'aply' -#define REVERT_SETTINGS 'rvrt' -#define DEFAULT_SETTINGS 'dflt' -#define TRY_SETTINGS 'trys' - -#define ATTRIBUTE_CHOSEN 'atch' -#define UPDATE_COLOR 'upcl' - void SetRGBColor(rgb_color *col,uint8 r, uint8 g, uint8 b, uint8 a=255); void PrintRGBColor(rgb_color col); @@ -63,8 +54,8 @@ APRView::APRView(BRect frame, const char *name, int32 resize, int32 flags) AddChild(colorview); cvrect.Set(0,0,50,25); - cvrect.OffsetBy(picker->Frame().left, - picker->Frame().bottom+20); + cvrect.OffsetBy(scrollview->Frame().right+20, + scrollview->Frame().bottom-cvrect.Height()); defaults=new BButton(cvrect,"DefaultsButton","Defaults", new BMessage(DEFAULT_SETTINGS),B_FOLLOW_LEFT |B_FOLLOW_TOP, diff --git a/src/prefs/appearance/APRView.h b/src/prefs/appearance/APRView.h index da12ade6bf..6e4b43b790 100644 --- a/src/prefs/appearance/APRView.h +++ b/src/prefs/appearance/APRView.h @@ -26,7 +26,7 @@ public: void SetDefaults(void); void NotifyServer(void); rgb_color GetColorFromMessage(BMessage *msg, const char *name, int32 index=0); - +protected: BColorControl *picker; BButton *apply,*revert,*defaults,*try_settings; BListView *attrlist; diff --git a/src/prefs/appearance/APRWindow.cpp b/src/prefs/appearance/APRWindow.cpp index 7a7da4c47a..d7172b5221 100644 --- a/src/prefs/appearance/APRWindow.cpp +++ b/src/prefs/appearance/APRWindow.cpp @@ -1,11 +1,23 @@ #include "APRWindow.h" #include "APRView.h" +#include "DecView.h" APRWindow::APRWindow(BRect frame) : BWindow(frame, "Appearance", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE ) { - APRView *v=new APRView(Bounds(),"AppearanceView",B_FOLLOW_ALL, B_WILL_DRAW); - AddChild(v); + tabview=new BTabView(Bounds(),"TabView"); + + BTab *tab=NULL; + + DecView *dv=new DecView(Bounds(),"Decorator",B_FOLLOW_ALL, B_WILL_DRAW); + tab=new BTab(dv); + tabview->AddTab(dv,tab); + + APRView *v=new APRView(Bounds(),"Colors",B_FOLLOW_ALL, B_WILL_DRAW); + tab=new BTab(v); + tabview->AddTab(v,tab); + + AddChild(tabview); } bool APRWindow::QuitRequested() diff --git a/src/prefs/appearance/APRWindow.h b/src/prefs/appearance/APRWindow.h index 19a469509f..6337c8b59d 100644 --- a/src/prefs/appearance/APRWindow.h +++ b/src/prefs/appearance/APRWindow.h @@ -4,12 +4,14 @@ #include #include #include +#include class APRWindow : public BWindow { public: APRWindow(BRect frame); virtual bool QuitRequested(); + BTabView *tabview; }; #endif diff --git a/src/prefs/appearance/Jamfile b/src/prefs/appearance/Jamfile index 663e27e643..72597f46e5 100644 --- a/src/prefs/appearance/Jamfile +++ b/src/prefs/appearance/Jamfile @@ -1,5 +1,5 @@ SubDir OBOS_TOP src prefs appearance ; -Preference Appearance : APRMain.cpp APRView.cpp APRWindow.cpp PortLink.cpp ; +Preference Appearance : APRMain.cpp APRView.cpp APRWindow.cpp Decorator.cpp DecView.cpp DisplayDriver.cpp PortLink.cpp PreviewDriver.cpp RGBColor.cpp SPoint.cpp SRect.cpp ; LinkSharedOSLibs Appearance : be ;