From 7c49aee74f61d1290b83ecf4e4697aa613539bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 10 Mar 2004 15:11:25 +0000 Subject: [PATCH] Improved the placement of the "Stop" button with smaller window sizes. It will now also follow the right border of the window. Enlarged the minimum window width a bit, so that the stop button can no longer overlay the position text control. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6945 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/diskprobe/ProbeView.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/apps/diskprobe/ProbeView.cpp b/src/apps/diskprobe/ProbeView.cpp index 372c674c41..4bce533a41 100644 --- a/src/apps/diskprobe/ProbeView.cpp +++ b/src/apps/diskprobe/ProbeView.cpp @@ -442,7 +442,7 @@ HeaderView::HeaderView(BRect frame, const entry_ref *ref, DataEditor &editor) BRect rect = Bounds(); fStopButton = new BButton(BRect(0, 0, 20, 20), B_EMPTY_STRING, "Stop", - new BMessage(kMsgStopFind)); + new BMessage(kMsgStopFind), B_FOLLOW_TOP | B_FOLLOW_RIGHT); fStopButton->ResizeToPreferred(); fStopButton->MoveTo(rect.right - 5 - fStopButton->Bounds().Width(), 5); fStopButton->Hide(); @@ -468,8 +468,8 @@ HeaderView::HeaderView(BRect frame, const entry_ref *ref, DataEditor &editor) } rect = stringView->Frame(); rect.left = rect.right; - rect.right = fStopButton->Frame().left - 1; - fPathView = new BStringView(rect, B_EMPTY_STRING, string.String()); + rect.right = fStopButton->Frame().right - 1; + fPathView = new BStringView(rect, B_EMPTY_STRING, string.String(), B_FOLLOW_TOP | B_FOLLOW_LEFT_RIGHT); fPathView->SetFont(&plainFont); AddChild(fPathView); @@ -773,10 +773,13 @@ HeaderView::MessageReceived(BMessage *message) bool state; if (message->FindBool("running", &state) == B_OK && fFileSize > fBlockSize) { fPositionSlider->SetEnabled(!state); - if (state) + if (state) { + fPathView->ResizeBy(-fStopButton->Bounds().Width(), 0); fStopButton->Show(); - else + } else { fStopButton->Hide(); + fPathView->ResizeBy(fStopButton->Bounds().Width(), 0); + } } off_t position; @@ -1096,10 +1099,10 @@ ProbeView::UpdateSizeLimits() BRect frame = Window()->ConvertFromScreen(ConvertToScreen(fHeaderView->Frame())); - Window()->SetSizeLimits(200, width + B_V_SCROLL_BAR_WIDTH, + Window()->SetSizeLimits(250, width + B_V_SCROLL_BAR_WIDTH, 200, height + frame.bottom + 4 + B_H_SCROLL_BAR_HEIGHT); } else - Window()->SetSizeLimits(200, 32768, 200, 32768); + Window()->SetSizeLimits(250, 32768, 200, 32768); #ifdef COMPILE_FOR_R5 BRect bounds = Window()->Bounds();