From aab72d7ea63f8951f66a733558a1fe568255a5df Mon Sep 17 00:00:00 2001 From: stippi Date: Sat, 13 Feb 2010 13:42:52 +0000 Subject: [PATCH] * Use hiding instead of minimizing for the Download window. * Auto-show and auto-move-to-current-workspace when a download starts. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@61 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/DownloadWindow.cpp | 12 ++++++++---- src/apps/webpositive/LauncherApp.cpp | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/apps/webpositive/DownloadWindow.cpp b/src/apps/webpositive/DownloadWindow.cpp index 0511ff194d..ea0492b402 100644 --- a/src/apps/webpositive/DownloadWindow.cpp +++ b/src/apps/webpositive/DownloadWindow.cpp @@ -347,7 +347,7 @@ DownloadWindow::DownloadWindow(BRect frame, bool visible) BMenuBar* menuBar = new BMenuBar("Menu bar"); BMenu* menu = new BMenu("Window"); - menu->AddItem(new BMenuItem("Minimize", new BMessage(B_QUIT_REQUESTED), 'M')); + menu->AddItem(new BMenuItem("Hide", new BMessage(B_QUIT_REQUESTED), 'H')); menuBar->AddItem(menu); BScrollView* scrollView = new DownloadContainerScrollView(downloadsGroupView); @@ -372,7 +372,7 @@ DownloadWindow::DownloadWindow(BRect frame, bool visible) downloadFinished(NULL); if (!visible) - Minimize(true); + Hide(); Show(); } @@ -411,8 +411,8 @@ void DownloadWindow::MessageReceived(BMessage* message) bool DownloadWindow::QuitRequested() { - if (!IsMinimized()) - Minimize(true); + if (!IsHidden()) + Hide(); return false; } @@ -437,6 +437,10 @@ void DownloadWindow::downloadStarted(WebDownload* download) return; m_downloadViewsLayout->AddView(index, view); saveSettings(); + + SetWorkspaces(B_CURRENT_WORKSPACE); + if (IsHidden()) + Show(); } void DownloadWindow::downloadFinished(WebDownload* download) diff --git a/src/apps/webpositive/LauncherApp.cpp b/src/apps/webpositive/LauncherApp.cpp index 84a338ff07..44baaf0210 100644 --- a/src/apps/webpositive/LauncherApp.cpp +++ b/src/apps/webpositive/LauncherApp.cpp @@ -173,8 +173,8 @@ void LauncherApp::MessageReceived(BMessage* message) uint32 workspaces; if (message->FindUInt32("workspaces", &workspaces) == B_OK) m_downloadWindow->SetWorkspaces(workspaces); - if (m_downloadWindow->IsMinimized()) - m_downloadWindow->Minimize(false); + if (m_downloadWindow->IsHidden()) + m_downloadWindow->Show(); else m_downloadWindow->Activate(); } @@ -231,7 +231,7 @@ bool LauncherApp::QuitRequested() settingsArchive.AddRect("window frame", m_lastWindowFrame); if (m_downloadWindow->Lock()) { settingsArchive.AddRect("downloads window frame", m_downloadWindow->Frame()); - settingsArchive.AddBool("show downloads", !m_downloadWindow->IsMinimized()); + settingsArchive.AddBool("show downloads", !m_downloadWindow->IsHidden()); m_downloadWindow->Unlock(); } settingsArchive.Flatten(&settingsFile);