From 8ea9eaa1cb72a29d4e171711fe05dcc32d635f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 30 Dec 2005 19:20:24 +0000 Subject: [PATCH] * Resize the placement controls to their preferred height, make them a little wider, so that they completely fill up the space they have (making them nicely aligned to the surrounding border). * the placement controls now accept up to 5 bytes (for things like "-1000"). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15751 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/preferences/backgrounds/BackgroundsView.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/preferences/backgrounds/BackgroundsView.cpp b/src/preferences/backgrounds/BackgroundsView.cpp index 54b787772e..315b1070d4 100644 --- a/src/preferences/backgrounds/BackgroundsView.cpp +++ b/src/preferences/backgrounds/BackgroundsView.cpp @@ -129,18 +129,24 @@ BackgroundsView::BackgroundsView(BRect frame, const char *name, int32 resize, fPreview->SetLabel("Preview"); AddChild(fPreview); - BRect rect(15, fPreview->Bounds().bottom - 30, 70, fPreview->Bounds().bottom - 10); + BRect rect(10, fPreview->Bounds().bottom - 30, 70, fPreview->Bounds().bottom - 10); fXPlacementText = new BTextControl(rect, "xPlacementText", "X:", NULL, new BMessage(kMsgImagePlacement), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); fXPlacementText->SetDivider(fXPlacementText->StringWidth(fXPlacementText->Label()) + 4.0f); - fXPlacementText->TextView()->SetMaxBytes(4); + fXPlacementText->TextView()->SetMaxBytes(5); + float width, height; + fXPlacementText->GetPreferredSize(&width, &height); + float delta = fXPlacementText->Bounds().Height() - height; + fXPlacementText->MoveBy(0, delta); + fXPlacementText->ResizeTo(fXPlacementText->Bounds().Width(), height); fPreview->AddChild(fXPlacementText); - rect.OffsetBy(65, 0); + rect.OffsetBy(70, delta); fYPlacementText = new BTextControl(rect, "yPlacementText", "Y:", NULL, new BMessage(kMsgImagePlacement), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); fYPlacementText->SetDivider(fYPlacementText->StringWidth(fYPlacementText->Label()) + 4.0f); - fYPlacementText->TextView()->SetMaxBytes(4); + fYPlacementText->TextView()->SetMaxBytes(5); + fXPlacementText->ResizeTo(fYPlacementText->Bounds().Width(), height); fPreview->AddChild(fYPlacementText); for (int32 i = 0; i < 256; i++) { @@ -166,7 +172,7 @@ BackgroundsView::BackgroundsView(BRect frame, const char *name, int32 resize, new BMessage(kMsgUpdateColor)); rightbox->AddChild(fPicker); - float delta = fPicker->Frame().bottom + 10.0f - rightbox->Bounds().Height(); + delta = fPicker->Frame().bottom + 10.0f - rightbox->Bounds().Height(); rightbox->ResizeBy(0, delta); fPreview->ResizeBy(0, delta);