From a0bf2906241a762e8f368484a190aba57b86e4fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 10 Feb 2004 04:26:03 +0000 Subject: [PATCH] Fixed window cascading. Moved position of first window a bit more to the center. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6550 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/diskprobe/DiskProbe.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/apps/diskprobe/DiskProbe.cpp b/src/apps/diskprobe/DiskProbe.cpp index d234bfaa7a..1514bf70b4 100644 --- a/src/apps/diskprobe/DiskProbe.cpp +++ b/src/apps/diskprobe/DiskProbe.cpp @@ -114,7 +114,7 @@ DiskProbe::DiskProbe() : BApplication(kSignature), fOpenWindow(NULL), fWindowCount(0), - fWindowPosition(30, 30, 500, 500) + fWindowPosition(50, 50, 500, 500) { fFilePanel = new BFilePanel(); @@ -220,6 +220,8 @@ DiskProbe::ReadyToRun() status_t DiskProbe::Probe(entry_ref &ref) { + int32 probeWindows = 0; + // Do we already have that window open? for (int32 i = CountWindows(); i-- > 0; ) { ProbeWindow *window = dynamic_cast(WindowAt(i)); @@ -230,6 +232,7 @@ DiskProbe::Probe(entry_ref &ref) window->Activate(true); return B_OK; } + probeWindows++; } // Does the file really exists? @@ -240,7 +243,7 @@ DiskProbe::Probe(entry_ref &ref) // cascade window BRect rect = fWindowPosition; - rect.OffsetBy(fWindowCount * 15, fWindowCount * 15); + rect.OffsetBy(probeWindows * 15, probeWindows * 15); BWindow *window = new ProbeWindow(rect, &ref); window->Show();