From 79cbd22649c4df291efbc1bc89b59b3a9dbf504e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 18 Apr 2008 16:42:10 +0000 Subject: [PATCH] Colors should be archived correctly now, at least for replicants. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25029 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/activitymonitor/ActivityView.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/apps/activitymonitor/ActivityView.cpp b/src/apps/activitymonitor/ActivityView.cpp index 0a8b678348..e90b95f62d 100644 --- a/src/apps/activitymonitor/ActivityView.cpp +++ b/src/apps/activitymonitor/ActivityView.cpp @@ -334,6 +334,7 @@ ActivityView::ActivityView(const char* name, const BMessage* settings) : BView(BRect(0,0,300,200), name, B_FOLLOW_NONE, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS) #endif { + SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); _Init(settings); BRect rect(Bounds()); @@ -369,7 +370,6 @@ ActivityView::_Init(const BMessage* settings) fLegendLayoutItem = NULL; #endif SetViewColor(B_TRANSPARENT_COLOR); - SetLowColor(ui_color(B_PANEL_BACKGROUND_COLOR)); fRefreshInterval = kInitialRefreshInterval; fDrawInterval = kInitialRefreshInterval * 2; @@ -388,6 +388,14 @@ ActivityView::_Init(const BMessage* settings) return; } + rgb_color *color; + ssize_t colorLen; + if (settings->FindData("background color", B_RGB_COLOR_TYPE, + (const void **)&color, &colorLen) == B_OK && + colorLen == sizeof(rgb_color)) + fBackgroundColor = *color; + + const char* name; for (int32 i = 0; settings->FindString("source", i, &name) == B_OK; i++) { AddDataSource(DataSource::FindSource(name)); @@ -433,6 +441,10 @@ ActivityView::SaveState(BMessage& state) const if (status != B_OK) return status; + status = state.AddData("background color", B_RGB_COLOR_TYPE, &fBackgroundColor, sizeof(rgb_color)); + if (status != B_OK) + return status; + for (int32 i = 0; i < fSources.CountItems(); i++) { DataSource* source = fSources.ItemAt(i);