From a7c2985541a3da5f81e4a794278005aaca66738a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 30 Sep 2005 22:32:45 +0000 Subject: [PATCH] takes string width into account git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14287 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/expander/ExpanderWindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/expander/ExpanderWindow.cpp b/src/apps/expander/ExpanderWindow.cpp index 7c3b7ea34e..c1d26867c4 100644 --- a/src/apps/expander/ExpanderWindow.cpp +++ b/src/apps/expander/ExpanderWindow.cpp @@ -98,7 +98,8 @@ ExpanderWindow::ExpanderWindow(BRect frame_rect, const entry_ref *ref, BMessage BBox *box = new BBox(rect, "background", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS, B_PLAIN_BORDER); AddChild(box); - rect = BRect(10, 10, 75, 25); + float size = 8 + be_plain_font->StringWidth("Destination")/2; + rect = BRect(42 - size, 10, 42 + size, 25); fSourceButton = new BButton(rect, "sourceButton", "Source", new BMessage(MSG_SOURCE), B_FOLLOW_LEFT | B_FOLLOW_TOP); box->AddChild(fSourceButton); @@ -138,7 +139,7 @@ ExpanderWindow::ExpanderWindow(BRect frame_rect, const entry_ref *ref, BMessage box->AddChild(fExpandedText); fExpandedText->SetText(""); - rect = BRect(Bounds().right - 105, rect.bottom + 13, Bounds().right - 10, rect.bottom + 28); + rect = BRect(Bounds().right - 38 - be_plain_font->StringWidth("Show Contents"), rect.bottom + 13, Bounds().right - 10, rect.bottom + 28); fShowContents = new BCheckBox(rect, "showContents", "Show Contents", new BMessage(MSG_SHOWCONTENTS), B_FOLLOW_RIGHT | B_FOLLOW_TOP); box->AddChild(fShowContents);