hopefully implemented makedefault in Workspace::SetColor()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17113 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2006-04-12 16:52:41 +00:00
parent 196144a56c
commit 190b4fa4ef
3 changed files with 24 additions and 1 deletions

View File

@ -657,6 +657,27 @@ Desktop::RedrawBackground()
}
/*!
\brief Store the workspace configuration
*/
void
Desktop::StoreWorkspaceConfiguration(Workspace::Private *workspace)
{
// store settings
for (int32 index = 0; index < 32; index++) {
if (&fWorkspaces[index] == workspace) {
const BMessage *oldSettings = fSettings->WorkspacesMessage(index);
BMessage settings;
if (oldSettings)
settings = *oldSettings;
workspace->StoreConfiguration(settings);
fSettings->Save(kWorkspacesSettings);
break;
}
}
}
void
Desktop::UpdateWorkspaces()
{

View File

@ -163,6 +163,7 @@ class Desktop : public MessageLooper, public ScreenOwner {
{ return fBackgroundRegion; }
void RedrawBackground();
void StoreWorkspaceConfiguration(Workspace::Private *workspace);
void MinimizeApplication(team_id team);
void BringApplicationToFront(team_id team);

View File

@ -105,9 +105,10 @@ Workspace::SetColor(const RGBColor& color, bool makeDefault)
if (color == Color())
return;
// TODO: support makeDefault
fWorkspace.SetColor(color);
fDesktop.RedrawBackground();
if (makeDefault)
fDesktop.StoreWorkspaceConfiguration(&fWorkspace);
}