* Made the spacing a bit larger in general, and made it use

BControlLook::DefaultItemSpacing() instead of hard coded values.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36715 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-05-07 11:31:10 +00:00
parent 5396d90d16
commit d2ed47fd9f
@@ -9,6 +9,7 @@
#include <Alert.h> #include <Alert.h>
#include <Catalog.h> #include <Catalog.h>
#include <CheckBox.h> #include <CheckBox.h>
#include <ControlLook.h>
#include <Country.h> #include <Country.h>
#include <GroupLayout.h> #include <GroupLayout.h>
#include <GroupLayoutBuilder.h> #include <GroupLayoutBuilder.h>
@@ -179,19 +180,18 @@ FormatView::FormatView(BCountry* country)
BBox* clockBox = new BBox("Clock"); BBox* clockBox = new BBox("Clock");
clockBox->SetLabel(B_TRANSLATE("Clock")); clockBox->SetLabel(B_TRANSLATE("Clock"));
{ f24HrRadioButton = new BRadioButton("", B_TRANSLATE("24 hour"),
f24HrRadioButton = new BRadioButton("", B_TRANSLATE("24 hour"), new BMessage(kSettingsContentsModified));
new BMessage(kSettingsContentsModified));
f12HrRadioButton = new BRadioButton("", B_TRANSLATE("12 hour"), f12HrRadioButton = new BRadioButton("", B_TRANSLATE("12 hour"),
new BMessage(kSettingsContentsModified)); new BMessage(kSettingsContentsModified));
clockBox->AddChild(BGroupLayoutBuilder(B_VERTICAL, 3) float spacing = be_control_look->DefaultItemSpacing();
.Add(f24HrRadioButton)
.Add(f12HrRadioButton) clockBox->AddChild(BGroupLayoutBuilder(B_VERTICAL)
.SetInsets(3, 3, 3, 3) .Add(f24HrRadioButton)
); .Add(f12HrRadioButton)
} .SetInsets(spacing, 0, spacing, 0));
fLongTimeExampleView = new BStringView("", ""); fLongTimeExampleView = new BStringView("", "");
fShortTimeExampleView = new BStringView("", ""); fShortTimeExampleView = new BStringView("", "");
@@ -231,19 +231,16 @@ FormatView::FormatView(BCountry* country)
BBox* formatBox = new BBox("Symbol position"); BBox* formatBox = new BBox("Symbol position");
formatBox->SetLabel(B_TRANSLATE("Symbol position")); formatBox->SetLabel(B_TRANSLATE("Symbol position"));
{ BRadioButton* beforeRadioButton = new BRadioButton("",
BRadioButton* beforeRadioButton = new BRadioButton("", B_TRANSLATE("Before"), new BMessage(kSettingsContentsModified));
B_TRANSLATE("Before"), new BMessage(kSettingsContentsModified));
BRadioButton* afterRadioButton = new BRadioButton("", BRadioButton* afterRadioButton = new BRadioButton("",
B_TRANSLATE("After"), new BMessage(kSettingsContentsModified)); B_TRANSLATE("After"), new BMessage(kSettingsContentsModified));
formatBox->AddChild(BGroupLayoutBuilder(B_VERTICAL, 3) formatBox->AddChild(BGroupLayoutBuilder(B_VERTICAL)
.Add(beforeRadioButton) .Add(beforeRadioButton)
.Add(afterRadioButton) .Add(afterRadioButton)
.SetInsets(3, 3, 3, 3) .SetInsets(spacing, 0, spacing, 0));
);
}
_UpdateExamples(); _UpdateExamples();
_ParseDateFormat(); _ParseDateFormat();
@@ -258,31 +255,31 @@ FormatView::FormatView(BCountry* country)
fNumbersBox->SetLabel(B_TRANSLATE("Numbers")); fNumbersBox->SetLabel(B_TRANSLATE("Numbers"));
fCurrencyBox->SetLabel(B_TRANSLATE("Currency")); fCurrencyBox->SetLabel(B_TRANSLATE("Currency"));
fDateBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 5) fDateBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL)
.AddGroup(B_VERTICAL, 5) .AddGroup(B_VERTICAL, spacing / 2)
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(new BStringView("",B_TRANSLATE("Long format:"))) .Add(new BStringView("", B_TRANSLATE("Long format:")))
.Add(fLongDateExampleView) .Add(fLongDateExampleView)
.AddGlue() .AddGlue()
.End() .End()
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(fLongDateMenu[0]) .Add(fLongDateMenu[0])
.Add(fLongDateSeparator[0]) .Add(fLongDateSeparator[0])
.End() .End()
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(fLongDateMenu[1]) .Add(fLongDateMenu[1])
.Add(fLongDateSeparator[1]) .Add(fLongDateSeparator[1])
.End() .End()
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(fLongDateMenu[2]) .Add(fLongDateMenu[2])
.Add(fLongDateSeparator[2]) .Add(fLongDateSeparator[2])
.End() .End()
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(fLongDateMenu[3]) .Add(fLongDateMenu[3])
.Add(fLongDateSeparator[3]) .Add(fLongDateSeparator[3])
.End() .End()
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(new BStringView("",B_TRANSLATE("Short format:"))) .Add(new BStringView("", B_TRANSLATE("Short format:")))
.Add(fShortDateExampleView) .Add(fShortDateExampleView)
.AddGlue() .AddGlue()
.End() .End()
@@ -290,36 +287,31 @@ FormatView::FormatView(BCountry* country)
.Add(fDateMenu[1]) .Add(fDateMenu[1])
.Add(fDateMenu[2]) .Add(fDateMenu[2])
.End() .End()
.SetInsets(5, 5, 5, 5) .SetInsets(spacing, spacing, spacing, spacing));
.View()
);
fTimeBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 5) fTimeBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, spacing)
.AddGroup(B_VERTICAL, 5) .AddGroup(B_VERTICAL, spacing / 2)
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(new BStringView("",B_TRANSLATE("Long format:"))) .Add(new BStringView("", B_TRANSLATE("Long format:")))
.Add(fLongTimeExampleView) .Add(fLongTimeExampleView)
.AddGlue() .AddGlue()
.End() .End()
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(new BStringView("",B_TRANSLATE("Short format:"))) .Add(new BStringView("", B_TRANSLATE("Short format:")))
.Add(fShortTimeExampleView) .Add(fShortTimeExampleView)
.AddGlue() .AddGlue()
.End() .End()
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(clockBox) .Add(clockBox)
.AddGlue() .AddGlue()
.End() .End()
.AddGlue()
.End() .End()
.SetInsets(5, 5, 5, 5) .SetInsets(spacing, spacing, spacing, spacing));
.View()
);
fNumbersBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 5) fNumbersBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, spacing)
.AddGroup(B_VERTICAL, 5) .AddGroup(B_VERTICAL, spacing / 2)
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(new BStringView("",B_TRANSLATE("Example:"))) .Add(new BStringView("", B_TRANSLATE("Example:")))
.Add(fNumberFormatExampleView) .Add(fNumberFormatExampleView)
.AddGlue() .AddGlue()
.End() .End()
@@ -327,42 +319,33 @@ FormatView::FormatView(BCountry* country)
.Add(numberDecimal) .Add(numberDecimal)
.Add(numberLeadingZero) .Add(numberLeadingZero)
.Add(numberList) .Add(numberList)
.AddGlue()
.End() .End()
.SetInsets(5, 5, 5, 5) .SetInsets(spacing, spacing, spacing, spacing));
.View()
);
fCurrencyBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 5) fCurrencyBox->AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, spacing)
.AddGroup(B_VERTICAL, 5) .AddGroup(B_VERTICAL, spacing / 2)
.Add(currencySymbol) .Add(currencySymbol)
.Add(currencyNegative) .Add(currencyNegative)
.Add(currencyDecimal) .Add(currencyDecimal)
.Add(currencyLeadingZero) .Add(currencyLeadingZero)
.AddGroup(B_HORIZONTAL, 3) .AddGroup(B_HORIZONTAL, spacing)
.Add(formatBox) .Add(formatBox)
.AddGlue() .AddGlue()
.End() .End()
.AddGlue()
.End() .End()
.SetInsets(5, 5, 5, 5) .SetInsets(spacing, spacing, spacing, spacing));
.View()
);
AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, 5) AddChild(BLayoutBuilder::Group<>(B_HORIZONTAL, spacing)
.AddGroup(B_VERTICAL, 5) .AddGroup(B_VERTICAL, spacing)
.Add(fDateBox) .Add(fDateBox)
.Add(fTimeBox) .Add(fTimeBox)
.AddGlue() .AddGlue()
.End() .End()
.AddGroup(B_VERTICAL, 5) .AddGroup(B_VERTICAL, spacing)
.Add(fNumbersBox) .Add(fNumbersBox)
.Add(fCurrencyBox) .Add(fCurrencyBox)
.AddGlue() .AddGlue()
.End() .End());
.SetInsets(5, 5, 5, 5)
.View()
);
} }