From 7b03c0ce313bf24d0bd0c32f0efceb85af6747eb Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 30 May 2013 20:43:34 -0400 Subject: [PATCH] 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... --- .../backgrounds/BackgroundsView.cpp | 24 ++++++++++--------- src/preferences/backgrounds/BackgroundsView.h | 1 - 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/preferences/backgrounds/BackgroundsView.cpp b/src/preferences/backgrounds/BackgroundsView.cpp index f2052f98d5..f7995f9d7f 100644 --- a/src/preferences/backgrounds/BackgroundsView.cpp +++ b/src/preferences/backgrounds/BackgroundsView.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -72,8 +73,8 @@ BackgroundsView::BackgroundsView() { SetBorder(B_NO_BORDER); - fPreviewBox = new BBox("preview"); - fPreviewBox->SetLabel(B_TRANSLATE("Preview")); + BBox* previewBox = new BBox("preview"); + previewBox->SetLabel(B_TRANSLATE("Preview")); fPreview = new Preview(); @@ -103,7 +104,7 @@ BackgroundsView::BackgroundsView() BView* view = BLayoutBuilder::Group<>() .AddGlue() - .AddGroup(B_VERTICAL, 20) + .AddGroup(B_VERTICAL, be_control_look->DefaultItemSpacing() * 2) .AddGroup(B_HORIZONTAL, 0) .AddGlue() .AddGrid(0, 0, 1) @@ -119,17 +120,17 @@ BackgroundsView::BackgroundsView() .End() .AddGlue() .End() - .AddGroup(B_HORIZONTAL, 10) + .AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING) .Add(fXPlacementText) .Add(fYPlacementText) .End() .AddGlue() - .SetInsets(10, 10, 10, 10) + .SetInsets(B_USE_DEFAULT_SPACING) .End() .AddGlue() .View(); - fPreviewBox->AddChild(view); + previewBox->AddChild(view); BBox* rightbox = new BBox("rightbox"); @@ -224,16 +225,17 @@ BackgroundsView::BackgroundsView() B_ALIGN_NO_VERTICAL)); view = BLayoutBuilder::Group<>() - .AddGroup(B_VERTICAL, 10) - .AddGroup(B_HORIZONTAL, 10) - .Add(fPreviewBox) + .AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING) + .AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING) + .Add(previewBox) .Add(rightbox) .End() - .AddGroup(B_HORIZONTAL, 0) + .AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING) .Add(fRevert) .Add(fApply) .End() - .SetInsets(10, 10, 10, 10) + .SetInsets(B_USE_DEFAULT_SPACING, 0, B_USE_DEFAULT_SPACING, + B_USE_DEFAULT_SPACING) .End() .View(); diff --git a/src/preferences/backgrounds/BackgroundsView.h b/src/preferences/backgrounds/BackgroundsView.h index 0392053b4e..6074a5f49f 100644 --- a/src/preferences/backgrounds/BackgroundsView.h +++ b/src/preferences/backgrounds/BackgroundsView.h @@ -154,7 +154,6 @@ protected: BTextControl* fXPlacementText; BTextControl* fYPlacementText; Preview* fPreview; - BBox* fPreviewBox; BFilePanel* fFolderPanel; ImageFilePanel* fPanel;