From 2a1583cbc0591c9ea6b8cb6ea096315c00aef915 Mon Sep 17 00:00:00 2001 From: Janus Date: Sun, 19 Apr 2015 09:50:18 +0000 Subject: [PATCH] Preferences: Consistent buttons position and spacing. * Appearance fix spacing. * Keyboard fix spacing. * Mouse fix spacing. * Notifications fix spacing. * Fixes #5230. --- src/preferences/appearance/APRWindow.cpp | 3 +-- src/preferences/keyboard/KeyboardWindow.cpp | 7 ++++--- src/preferences/mouse/MouseWindow.cpp | 7 ++++--- src/preferences/notifications/PrefletWin.cpp | 12 ++++-------- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/preferences/appearance/APRWindow.cpp b/src/preferences/appearance/APRWindow.cpp index 661f998400..7995db6974 100644 --- a/src/preferences/appearance/APRWindow.cpp +++ b/src/preferences/appearance/APRWindow.cpp @@ -67,9 +67,8 @@ APRWindow::APRWindow(BRect frame) _UpdateButtons(); - AddChild(BGroupLayoutBuilder(B_VERTICAL, 0) + AddChild(BGroupLayoutBuilder(B_VERTICAL) .Add(tabView) - .Add(BSpaceLayoutItem::CreateVerticalStrut(5)) .Add(BGroupLayoutBuilder(B_HORIZONTAL) .Add(fDefaultsButton) .Add(fRevertButton) diff --git a/src/preferences/keyboard/KeyboardWindow.cpp b/src/preferences/keyboard/KeyboardWindow.cpp index ee421981bf..b12860016b 100644 --- a/src/preferences/keyboard/KeyboardWindow.cpp +++ b/src/preferences/keyboard/KeyboardWindow.cpp @@ -50,14 +50,15 @@ KeyboardWindow::KeyboardWindow() // Build the layout SetLayout(new BGroupLayout(B_VERTICAL)); - AddChild(BGroupLayoutBuilder(B_VERTICAL, 10) + AddChild(BGroupLayoutBuilder(B_VERTICAL) .Add(fSettingsBox) - .AddGroup(B_HORIZONTAL, 7) + .AddGroup(B_HORIZONTAL) .Add(fDefaultsButton) .Add(fRevertButton) .AddGlue() .End() - .SetInsets(10, 10, 10, 10) + .SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, + B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING) ); BSlider* slider = (BSlider* )FindView("key_repeat_rate"); diff --git a/src/preferences/mouse/MouseWindow.cpp b/src/preferences/mouse/MouseWindow.cpp index 96bf31b3a1..251cfcd633 100644 --- a/src/preferences/mouse/MouseWindow.cpp +++ b/src/preferences/mouse/MouseWindow.cpp @@ -60,14 +60,15 @@ MouseWindow::MouseWindow(BRect _rect) // Build the layout SetLayout(new BGroupLayout(B_VERTICAL)); - AddChild(BGroupLayoutBuilder(B_VERTICAL, 10) + AddChild(BGroupLayoutBuilder(B_VERTICAL) .Add(fSettingsBox) - .AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING) + .AddGroup(B_HORIZONTAL) .Add(fDefaultsButton) .Add(fRevertButton) .AddGlue() .End() - .SetInsets(10, 10, 10, 10) + .SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, + B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING) ); // check if the window is on screen diff --git a/src/preferences/notifications/PrefletWin.cpp b/src/preferences/notifications/PrefletWin.cpp index 79bdf10f22..0796100bba 100644 --- a/src/preferences/notifications/PrefletWin.cpp +++ b/src/preferences/notifications/PrefletWin.cpp @@ -47,23 +47,19 @@ PrefletWin::PrefletWin() fApply = new BButton("apply", B_TRANSLATE("Apply"), new BMessage(kApply)); fApply->SetEnabled(false); - // Calculate inset - float inset = ceilf(be_plain_font->Size() * 0.7f); - // Build the layout SetLayout(new BGroupLayout(B_VERTICAL)); // Add childs - AddChild(BGroupLayoutBuilder(B_VERTICAL, inset) + AddChild(BGroupLayoutBuilder(B_VERTICAL) .Add(fMainView) - - .AddGroup(B_HORIZONTAL, inset) + .AddGroup(B_HORIZONTAL) .Add(fRevert) .AddGlue() .Add(fApply) .End() - - .SetInsets(inset, inset, inset, inset) + .SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, + B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING) ); ReloadSettings();