[haiku-webkit-commits] r555 - webkit/trunk/WebKit/haiku/WebPositive

  • From: noreply@xxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Mon, 27 Dec 2010 23:12:55 +0100 (CET)

Author: leavengood
Date: Mon Dec 27 23:12:55 2010
New Revision: 555
URL: http://webpositive.haiku-os.org/changeset/555

Log:
As indicated by Axel the border width for positioning the download window was
hard-coded. This fixes that and refactors the code a bit.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp        Mon Dec 27 
18:08:35 2010        (r554)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp        Mon Dec 27 
23:12:55 2010        (r555)
@@ -152,13 +152,7 @@
 #endif
 
        fLastWindowFrame = fSettings->GetValue("window frame", 
fLastWindowFrame);
-       // Put download window in lower right of screen. 375 is about the 
minimum
-       // width with the default layout.
-       BRect defaultDownloadWindowFrame(0, 0, 375, 275);
-       BRect screenFrame = BScreen().Frame();
-       // The extra 5 pixels is for the decorator frame
-       defaultDownloadWindowFrame.OffsetTo(screenFrame.Width() - 
defaultDownloadWindowFrame.Width() - 5,
-               screenFrame.Height() - defaultDownloadWindowFrame.Height() - 5);
+       BRect defaultDownloadWindowFrame(-10, -10, 365, 265);
        BRect downloadWindowFrame = fSettings->GetValue("downloads window 
frame",
                defaultDownloadWindowFrame);
        BRect settingsWindowFrame = fSettings->GetValue("settings window frame",
@@ -167,6 +161,17 @@
 
        fDownloadWindow = new DownloadWindow(downloadWindowFrame, showDownloads,
                fSettings);
+       if (downloadWindowFrame == defaultDownloadWindowFrame) {
+               // Initially put download window in lower right of screen.
+               BRect screenFrame = BScreen().Frame();
+               BMessage decoratorSettings;
+               fDownloadWindow->GetDecoratorSettings(&decoratorSettings);
+               float borderWidth = 0;
+               if (decoratorSettings.FindFloat("border width", &borderWidth) 
!= B_OK)
+                       borderWidth = 5;
+               fDownloadWindow->MoveTo(screenFrame.Width() - 
fDownloadWindow->Frame().Width() - borderWidth,
+                       screenFrame.Height() - 
fDownloadWindow->Frame().Height() - borderWidth);
+       }
        fSettingsWindow = new SettingsWindow(settingsWindowFrame, fSettings);
 
        BWebPage::SetDownloadListener(BMessenger(fDownloadWindow));

Other related posts:

  • » [haiku-webkit-commits] r555 - webkit/trunk/WebKit/haiku/WebPositive - noreply