Ensure the window is at the right position before showing it. Fixes #7011.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42587 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2011-08-06 10:41:45 +00:00
parent 9dcd41a8af
commit beb636036f
2 changed files with 14 additions and 4 deletions

View File

@ -54,7 +54,7 @@ const float kSmallPadding = 2;
NotificationWindow::NotificationWindow()
:
BWindow(BRect(10, 10, 30, 30), B_TRANSLATE_MARK("Notification"),
BWindow(BRect(0, 0, 0, 0), B_TRANSLATE_MARK("Notification"),
kLeftTitledWindowLook, B_FLOATING_ALL_WINDOW_FEEL, B_AVOID_FRONT | B_AVOID_FOCUS | B_NOT_CLOSABLE
| B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_RESIZABLE,
B_ALL_WORKSPACES)
@ -63,6 +63,7 @@ NotificationWindow::NotificationWindow()
AddChild(fBorder);
SetPosition();
Show();
Hide();
@ -363,13 +364,15 @@ NotificationWindow::ResizeAll()
}
ResizeTo(ViewWidth(), height);
PopupAnimation(Bounds().Width(), Bounds().Height());
PopupAnimation();
}
void
NotificationWindow::PopupAnimation(float width, float height)
NotificationWindow::SetPosition()
{
float width = Bounds().Width();
float height = Bounds().Height();
float x = 0, y = 0, sx, sy;
float pad = 0;
BDeskbar deskbar;
@ -423,6 +426,12 @@ NotificationWindow::PopupAnimation(float width, float height)
}
MoveTo(x, y);
}
void
NotificationWindow::PopupAnimation()
{
SetPosition();
if (IsHidden() && fViews.size() != 0)
Show();

View File

@ -62,7 +62,8 @@ public:
private:
friend class AppGroupView;
void PopupAnimation(float, float);
void SetPosition();
void PopupAnimation();
void LoadSettings(bool startMonitor = false);
void LoadAppFilters(bool startMonitor = false);
void SaveAppFilters();