Backgrounds: Use font relative spacing and adjust insets

BBox's now line up.

Once again set the top inset of the BBox that forms the main
backgrounds view to 0. This should probably be converted to
a BView...
This commit is contained in:
John Scipione
2013-05-30 20:43:34 -04:00
parent 80e5b062fe
commit 7b03c0ce31
2 changed files with 13 additions and 12 deletions
+13 -11
View File
@@ -17,6 +17,7 @@
#include <Bitmap.h> #include <Bitmap.h>
#include <Catalog.h> #include <Catalog.h>
#include <ControlLook.h>
#include <Cursor.h> #include <Cursor.h>
#include <Debug.h> #include <Debug.h>
#include <File.h> #include <File.h>
@@ -72,8 +73,8 @@ BackgroundsView::BackgroundsView()
{ {
SetBorder(B_NO_BORDER); SetBorder(B_NO_BORDER);
fPreviewBox = new BBox("preview"); BBox* previewBox = new BBox("preview");
fPreviewBox->SetLabel(B_TRANSLATE("Preview")); previewBox->SetLabel(B_TRANSLATE("Preview"));
fPreview = new Preview(); fPreview = new Preview();
@@ -103,7 +104,7 @@ BackgroundsView::BackgroundsView()
BView* view = BLayoutBuilder::Group<>() BView* view = BLayoutBuilder::Group<>()
.AddGlue() .AddGlue()
.AddGroup(B_VERTICAL, 20) .AddGroup(B_VERTICAL, be_control_look->DefaultItemSpacing() * 2)
.AddGroup(B_HORIZONTAL, 0) .AddGroup(B_HORIZONTAL, 0)
.AddGlue() .AddGlue()
.AddGrid(0, 0, 1) .AddGrid(0, 0, 1)
@@ -119,17 +120,17 @@ BackgroundsView::BackgroundsView()
.End() .End()
.AddGlue() .AddGlue()
.End() .End()
.AddGroup(B_HORIZONTAL, 10) .AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
.Add(fXPlacementText) .Add(fXPlacementText)
.Add(fYPlacementText) .Add(fYPlacementText)
.End() .End()
.AddGlue() .AddGlue()
.SetInsets(10, 10, 10, 10) .SetInsets(B_USE_DEFAULT_SPACING)
.End() .End()
.AddGlue() .AddGlue()
.View(); .View();
fPreviewBox->AddChild(view); previewBox->AddChild(view);
BBox* rightbox = new BBox("rightbox"); BBox* rightbox = new BBox("rightbox");
@@ -224,16 +225,17 @@ BackgroundsView::BackgroundsView()
B_ALIGN_NO_VERTICAL)); B_ALIGN_NO_VERTICAL));
view = BLayoutBuilder::Group<>() view = BLayoutBuilder::Group<>()
.AddGroup(B_VERTICAL, 10) .AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
.AddGroup(B_HORIZONTAL, 10) .AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
.Add(fPreviewBox) .Add(previewBox)
.Add(rightbox) .Add(rightbox)
.End() .End()
.AddGroup(B_HORIZONTAL, 0) .AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
.Add(fRevert) .Add(fRevert)
.Add(fApply) .Add(fApply)
.End() .End()
.SetInsets(10, 10, 10, 10) .SetInsets(B_USE_DEFAULT_SPACING, 0, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING)
.End() .End()
.View(); .View();
@@ -154,7 +154,6 @@ protected:
BTextControl* fXPlacementText; BTextControl* fXPlacementText;
BTextControl* fYPlacementText; BTextControl* fYPlacementText;
Preview* fPreview; Preview* fPreview;
BBox* fPreviewBox;
BFilePanel* fFolderPanel; BFilePanel* fFolderPanel;
ImageFilePanel* fPanel; ImageFilePanel* fPanel;