Update Tracker prefs window workspace behavior.

Basically make the Tracker preferences window work like most other
windows do as far as workspaces go.

Opens on your current workspace. If you switch workspaces then go
into Deskbar and select Tracker Preferences it will switch to
the workspace that already has the window open. If you close the
window, switch workspaces and then select preferences it will move
the window to your current workspace and show it.

This is similar to the fix for the same problem on the Deskbar
preferences window and for the same reason: the window gets hidden
when you close it, not actually deleted so we need to do a bit more
work to get the window to behave with workspaces. Hiding instead of
deleting the window allows us to remember where you were when you
closed the window, what tab you were on, what control had focus, etc.

Fixes #8000
This commit is contained in:
John Scipione 2013-02-11 21:59:37 -05:00
parent 331c9098ea
commit 3c6d2325c7

View File

@ -70,11 +70,11 @@ const uint32 kRevertButtonPressed = 'Rebp';
#undef B_TRANSLATION_CONTEXT #undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "TrackerSettingsWindow" #define B_TRANSLATION_CONTEXT "TrackerSettingsWindow"
TrackerSettingsWindow::TrackerSettingsWindow() TrackerSettingsWindow::TrackerSettingsWindow()
: :
BWindow(BRect(80, 80, 450, 350), B_TRANSLATE("Tracker preferences"), BWindow(BRect(80, 80, 450, 350), B_TRANSLATE("Tracker preferences"),
B_TITLED_WINDOW, B_NOT_MINIMIZABLE | B_NOT_RESIZABLE B_TITLED_WINDOW, B_NOT_MINIMIZABLE | B_NOT_RESIZABLE
| B_NO_WORKSPACE_ACTIVATION | B_NOT_ANCHORED_ON_ACTIVATE
| B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
| B_AUTO_UPDATE_SIZE_LIMITS) | B_AUTO_UPDATE_SIZE_LIMITS)
{ {
@ -184,6 +184,12 @@ TrackerSettingsWindow::Show()
Unlock(); Unlock();
} }
if (IsHidden()) {
// move to current workspace
SetWorkspaces(B_CURRENT_WORKSPACE);
}
_inherited::Show(); _inherited::Show();
} }