From 9aad8c7d4b3fe9dd1f74d80fef2865117ebcecaf Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Mon, 24 Aug 2009 17:38:10 +0000 Subject: [PATCH] Fix #4185 by making the border and title settings in the context menu positive settings ("Show x"). This required changing various logic, some of which I think was also wrong in the negative settings case. Now if you turn off the border when the title is on, the title will come back when the border is turned back on. But any changes in the title setting force the border back on. When loading the settings the border setting takes precedence. +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32656 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/workspaces/Workspaces.cpp | 33 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/apps/workspaces/Workspaces.cpp b/src/apps/workspaces/Workspaces.cpp index 2b52134016..88f78d7e67 100644 --- a/src/apps/workspaces/Workspaces.cpp +++ b/src/apps/workspaces/Workspaces.cpp @@ -521,13 +521,14 @@ WorkspacesView::MouseDown(BPoint where) BMenuItem* item; menu->AddSeparatorItem(); - menu->AddItem(item = new BMenuItem("No Window Title", + menu->AddItem(item = new BMenuItem("Show Window Title", new BMessage(kMsgToggleTitle))); - if (window->Look() == B_MODAL_WINDOW_LOOK) + if (window->Look() == B_TITLED_WINDOW_LOOK) item->SetMarked(true); - menu->AddItem(item = new BMenuItem("No Window Border", + menu->AddItem(item = new BMenuItem("Show Window Border", new BMessage(kMsgToggleBorder))); - if (window->Look() == B_NO_BORDER_WINDOW_LOOK) + if (window->Look() == B_TITLED_WINDOW_LOOK + || window->Look() == B_MODAL_WINDOW_LOOK) item->SetMarked(true); menu->AddSeparatorItem(); @@ -565,10 +566,10 @@ WorkspacesWindow::WorkspacesWindow(WorkspacesSettings *settings) { AddChild(new WorkspacesView(Bounds())); - if (!fSettings->HasTitle()) - SetLook(B_MODAL_WINDOW_LOOK); - else if (!fSettings->HasBorder()) + if (!fSettings->HasBorder()) SetLook(B_NO_BORDER_WINDOW_LOOK); + else if (!fSettings->HasTitle()) + SetLook(B_MODAL_WINDOW_LOOK); if (fSettings->AlwaysOnTop()) SetFeel(B_FLOATING_ALL_WINDOW_FEEL); @@ -641,11 +642,12 @@ WorkspacesWindow::MessageReceived(BMessage *message) enable = true; if (enable) - SetLook(B_TITLED_WINDOW_LOOK); - else { + if (fSettings->HasTitle()) + SetLook(B_TITLED_WINDOW_LOOK); + else + SetLook(B_MODAL_WINDOW_LOOK); + else SetLook(B_NO_BORDER_WINDOW_LOOK); - fSettings->SetHasTitle(true); - } fSettings->SetHasBorder(enable); break; @@ -654,16 +656,17 @@ WorkspacesWindow::MessageReceived(BMessage *message) case kMsgToggleTitle: { bool enable = false; - if (Look() == B_MODAL_WINDOW_LOOK) + if (Look() == B_MODAL_WINDOW_LOOK + || Look() == B_NO_BORDER_WINDOW_LOOK) enable = true; if (enable) SetLook(B_TITLED_WINDOW_LOOK); - else { + else SetLook(B_MODAL_WINDOW_LOOK); - fSettings->SetHasBorder(true); - } + // No matter what the setting for title, we must force the border on + fSettings->SetHasBorder(true); fSettings->SetHasTitle(enable); break; }