Using DefaultItemSpacing() and DefaultLabelSpacing() as suggested by Axel.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41193 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Joachim Seemer
2011-04-07 16:37:05 +00:00
parent 3252a2a09d
commit 73c8170c25
+12 -8
View File
@@ -22,6 +22,7 @@
#include <Button.h> #include <Button.h>
#include <Catalog.h> #include <Catalog.h>
#include <CheckBox.h> #include <CheckBox.h>
#include <ControlLook.h>
#include <File.h> #include <File.h>
#include <FilePanel.h> #include <FilePanel.h>
#include <FindDirectory.h> #include <FindDirectory.h>
@@ -190,12 +191,15 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
BButton* saveScreenshot = new BButton("", B_TRANSLATE("Save"), BButton* saveScreenshot = new BButton("", B_TRANSLATE("Save"),
new BMessage(kSaveScreenshot)); new BMessage(kSaveScreenshot));
const float kSpacing = be_control_look->DefaultItemSpacing();
const float kLabelSpacing = be_control_look->DefaultLabelSpacing();
fPreview = new PreviewView(); fPreview = new PreviewView();
BGridLayout* gridLayout = BGridLayoutBuilder(0.0, 5.0) BGridLayout* gridLayout = BGridLayoutBuilder(0.0, kSpacing / 2)
.Add(fDelayControl->CreateLabelLayoutItem(), 0, 0) .Add(fDelayControl->CreateLabelLayoutItem(), 0, 0)
.Add(fDelayControl->CreateTextViewLayoutItem(), 1, 0) .Add(fDelayControl->CreateTextViewLayoutItem(), 1, 0)
.Add(BSpaceLayoutItem::CreateHorizontalStrut(5), 2, 0) .Add(BSpaceLayoutItem::CreateHorizontalStrut(kLabelSpacing), 2, 0)
.Add(seconds, 3, 0) .Add(seconds, 3, 0)
.Add(fNameControl->CreateLabelLayoutItem(), 0, 1) .Add(fNameControl->CreateLabelLayoutItem(), 0, 1)
.Add(fNameControl->CreateTextViewLayoutItem(), 1, 1, 3, 1) .Add(fNameControl->CreateTextViewLayoutItem(), 1, 1, 3, 1)
@@ -210,21 +214,21 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
SetLayout(new BGroupLayout(B_HORIZONTAL, 0)); SetLayout(new BGroupLayout(B_HORIZONTAL, 0));
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0) AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
.Add(BGroupLayoutBuilder(B_HORIZONTAL, 10.0) .Add(BGroupLayoutBuilder(B_HORIZONTAL, kSpacing)
.Add(fPreview) .Add(fPreview)
.AddGroup(B_VERTICAL, 0) .AddGroup(B_VERTICAL, 0)
.Add(fActiveWindow) .Add(fActiveWindow)
.Add(fWindowBorder) .Add(fWindowBorder)
.Add(fShowCursor) .Add(fShowCursor)
.AddStrut(10.0) .AddStrut(kSpacing)
.Add(gridLayout) .Add(gridLayout)
.Add(showSettings) .Add(showSettings)
.AddGlue() .AddGlue()
.End()) .End())
.AddStrut(10) .AddStrut(kSpacing)
.Add(divider) .Add(divider)
.AddStrut(10) .AddStrut(kSpacing)
.AddGroup(B_HORIZONTAL, 10.0) .AddGroup(B_HORIZONTAL, kSpacing)
.Add(new BButton("", B_TRANSLATE("Copy to clipboard"), .Add(new BButton("", B_TRANSLATE("Copy to clipboard"),
new BMessage(B_COPY))) new BMessage(B_COPY)))
.Add(new BButton("", B_TRANSLATE("New screenshot"), .Add(new BButton("", B_TRANSLATE("New screenshot"),
@@ -232,7 +236,7 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
.AddGlue() .AddGlue()
.Add(saveScreenshot) .Add(saveScreenshot)
.End() .End()
.SetInsets(10.0, 10.0, 10.0, 10.0) .SetInsets(kSpacing, kSpacing, kSpacing, kSpacing)
); );
saveScreenshot->MakeDefault(true); saveScreenshot->MakeDefault(true);