Update screen prefs layout. Fixes #8817

* Center monitor info and Workspaces label.
* Use font-relative spacing.
* Update the header including copyright year, sort contributors by name and add
  myself as well.
This commit is contained in:
John Scipione
2013-03-16 10:15:30 -04:00
parent 4307b2e057
commit e1c882014b
+41 -19
View File
@@ -1,16 +1,17 @@
/* /*
* Copyright 2001-2012, Haiku. * Copyright 2001-2013, Haiku, Inc.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
* Rafael Romo * Stephan Aßmus, [email protected]
* Stefano Ceccherini ([email protected])
* Andrew Bachmann * Andrew Bachmann
* Stefano Ceccherini, [email protected]
* Alexandre Deckner, [email protected]
* Axel Dörfler, [email protected]
* Rene Gollent, [email protected] * Rene Gollent, [email protected]
* Thomas Kurschel * Thomas Kurschel
* Axel Dörfler, [email protected] * Rafael Romo
* Stephan Aßmus <[email protected]> * John Scipione, [email protected]
* Alexandre Deckner, [email protected]
*/ */
@@ -25,6 +26,7 @@
#include <Box.h> #include <Box.h>
#include <Button.h> #include <Button.h>
#include <Catalog.h> #include <Catalog.h>
#include <ControlLook.h>
#include <Directory.h> #include <Directory.h>
#include <File.h> #include <File.h>
#include <FindDirectory.h> #include <FindDirectory.h>
@@ -37,6 +39,7 @@
#include <Path.h> #include <Path.h>
#include <PopUpMenu.h> #include <PopUpMenu.h>
#include <Screen.h> #include <Screen.h>
#include <SpaceLayoutItem.h>
#include <String.h> #include <String.h>
#include <StringView.h> #include <StringView.h>
#include <Roster.h> #include <Roster.h>
@@ -209,11 +212,13 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
// box on the left with workspace count and monitor view // box on the left with workspace count and monitor view
BBox* screenBox = new BBox("screen box"); BBox* screenBox = new BBox("screen box");
BGroupLayout* layout = new BGroupLayout(B_VERTICAL, 5.0); BGroupLayout* layout = new BGroupLayout(B_VERTICAL, B_USE_SMALL_SPACING);
layout->SetInsets(10, 10, 10, 10); layout->SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
screenBox->SetLayout(layout); screenBox->SetLayout(layout);
fMonitorInfo = new BStringView("monitor info", ""); fMonitorInfo = new BStringView("monitor info", "");
fMonitorInfo->SetAlignment(B_ALIGN_CENTER);
screenBox->AddChild(fMonitorInfo); screenBox->AddChild(fMonitorInfo);
fMonitorView = new MonitorView(BRect(0.0, 0.0, 80.0, 80.0), fMonitorView = new MonitorView(BRect(0.0, 0.0, 80.0, 80.0),
@@ -221,22 +226,39 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
screen.Frame().IntegerHeight() + 1); screen.Frame().IntegerHeight() + 1);
screenBox->AddChild(fMonitorView); screenBox->AddChild(fMonitorView);
BStringView* workspaces = new BStringView("workspaces",
B_TRANSLATE("Workspaces"));
workspaces->SetAlignment(B_ALIGN_CENTER);
fColumnsControl = new BTextControl(B_TRANSLATE("Columns:"), "0", fColumnsControl = new BTextControl(B_TRANSLATE("Columns:"), "0",
new BMessage(kMsgWorkspaceColumnsChanged)); new BMessage(kMsgWorkspaceColumnsChanged));
fColumnsControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
fRowsControl = new BTextControl(B_TRANSLATE("Rows:"), "0", fRowsControl = new BTextControl(B_TRANSLATE("Rows:"), "0",
new BMessage(kMsgWorkspaceRowsChanged)); new BMessage(kMsgWorkspaceRowsChanged));
fRowsControl->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
screenBox->AddChild(BLayoutBuilder::Grid<>(5.0, 5.0) float tiny = be_control_look->DefaultItemSpacing() / 4;
.Add(new BStringView("", B_TRANSLATE("Workspaces")), 0, 0, 3) screenBox->AddChild(BLayoutBuilder::Group<>()
.AddTextControl(fColumnsControl, 0, 1, B_ALIGN_RIGHT) .AddGroup(B_VERTICAL, B_USE_SMALL_SPACING)
.AddGroup(B_HORIZONTAL, 0, 2, 1) .Add(workspaces)
.Add(_CreateColumnRowButton(true, false)) .AddGrid(0.0, tiny)
.Add(_CreateColumnRowButton(true, true)) // columns
.End() .Add(fColumnsControl->CreateLabelLayoutItem(), 0, 0)
.AddTextControl(fRowsControl, 0, 2, B_ALIGN_RIGHT) .Add(BSpaceLayoutItem::CreateHorizontalStrut(
.AddGroup(B_HORIZONTAL, 0, 2, 2) B_USE_SMALL_SPACING), 1, 0)
.Add(_CreateColumnRowButton(false, false)) .Add(fColumnsControl->CreateTextViewLayoutItem(), 2, 0)
.Add(_CreateColumnRowButton(false, true)) .Add(BSpaceLayoutItem::CreateHorizontalStrut(tiny), 3, 0)
.Add(_CreateColumnRowButton(true, false), 4, 0)
.Add(_CreateColumnRowButton(true, true), 5, 0)
// rows
.Add(fRowsControl->CreateLabelLayoutItem(), 0, 1)
.Add(BSpaceLayoutItem::CreateHorizontalStrut(
B_USE_SMALL_SPACING), 1, 1)
.Add(fRowsControl->CreateTextViewLayoutItem(), 2, 1)
.Add(BSpaceLayoutItem::CreateHorizontalStrut(tiny), 3, 1)
.Add(_CreateColumnRowButton(false, false), 4, 1)
.Add(_CreateColumnRowButton(false, true), 5, 1)
.End()
.End() .End()
.View()); .View());