* The ProgressWindow now starts centered over the reference window on every
open. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22393 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
eb138dc9c4
commit
7746846941
@ -51,15 +51,7 @@ ProgressWindow::ProgressWindow(BWindow* referenceWindow,
|
||||
}
|
||||
|
||||
ResizeTo(Bounds().Width(), height + 8);
|
||||
BRect frame;
|
||||
if (referenceWindow != NULL)
|
||||
frame = referenceWindow->Frame();
|
||||
else
|
||||
frame = BScreen().Frame();
|
||||
|
||||
MoveTo(frame.left + (frame.Width() - Bounds().Width()) / 2,
|
||||
frame.top + (frame.Height() - Bounds().Height()) / 2);
|
||||
|
||||
_Center(referenceWindow);
|
||||
Run();
|
||||
}
|
||||
|
||||
@ -71,9 +63,23 @@ ProgressWindow::~ProgressWindow()
|
||||
|
||||
|
||||
void
|
||||
ProgressWindow::Start()
|
||||
ProgressWindow::_Center(BWindow* referenceWindow)
|
||||
{
|
||||
BRect frame;
|
||||
if (referenceWindow != NULL)
|
||||
frame = referenceWindow->Frame();
|
||||
else
|
||||
frame = BScreen().Frame();
|
||||
|
||||
MoveTo(frame.left + (frame.Width() - Bounds().Width()) / 2,
|
||||
frame.top + (frame.Height() - Bounds().Height()) / 2);
|
||||
}
|
||||
|
||||
void
|
||||
ProgressWindow::Start(BWindow* referenceWindow)
|
||||
{
|
||||
BAutolock _(this);
|
||||
_Center(referenceWindow);
|
||||
|
||||
fRetrievedUpdate = false;
|
||||
fRetrievedShow = false;
|
||||
|
@ -19,10 +19,12 @@ class ProgressWindow : public BWindow {
|
||||
|
||||
virtual void MessageReceived(BMessage *message);
|
||||
|
||||
void Start();
|
||||
void Start(BWindow* referenceWindow);
|
||||
void Stop();
|
||||
|
||||
private:
|
||||
void _Center(BWindow* referenceWindow);
|
||||
|
||||
BStatusBar* fStatusBar;
|
||||
BMessageRunner* fRunner;
|
||||
bool fRetrievedUpdate;
|
||||
|
@ -343,7 +343,7 @@ SudokuWindow::_Generate(int32 level)
|
||||
delete fGenerator;
|
||||
|
||||
fSudokuView->SetEditable(false);
|
||||
fProgressWindow->Start();
|
||||
fProgressWindow->Start(this);
|
||||
fGenerator = new GenerateSudoku(*fSudokuView->Field(), level,
|
||||
fProgressWindow, this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user