Improve/fix tab view layout as discussed
See http://www.freelists.org/post/haiku-development/Unifying-visuals-of-BTabView-usage Besides the tab bar going the full width of the window, also some layouting tweaks to several apps and prefs. Still missing: the first (and last) tabs in the tab bar should be inset by B_USE_WINDOW_SPACING so the controls in the tab view line up nicely. I think I remember stippi wanting to look into it... :)
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <MenuItem.h>
|
||||
#include <MenuField.h>
|
||||
@@ -81,8 +82,6 @@ SettingsWindow::SettingsWindow(BRect frame, SettingsMessage* settings)
|
||||
| B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE),
|
||||
fSettings(settings)
|
||||
{
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
|
||||
fApplyButton = new BButton(B_TRANSLATE("Apply"), new BMessage(MSG_APPLY));
|
||||
fCancelButton = new BButton(B_TRANSLATE("Cancel"),
|
||||
new BMessage(MSG_CANCEL));
|
||||
@@ -92,17 +91,19 @@ SettingsWindow::SettingsWindow(BRect frame, SettingsMessage* settings)
|
||||
float spacing = be_control_look->DefaultItemSpacing();
|
||||
|
||||
BTabView* tabView = new BTabView("settings pages", B_WIDTH_FROM_LABEL);
|
||||
tabView->SetBorder(B_NO_BORDER);
|
||||
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, spacing)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, B_USE_WINDOW_SPACING)
|
||||
.Add(tabView)
|
||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL, spacing)
|
||||
.Add(new BSeparatorView(B_HORIZONTAL))
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_WINDOW_SPACING, 0)
|
||||
.Add(fRevertButton)
|
||||
.AddGlue()
|
||||
.Add(fCancelButton)
|
||||
.Add(fApplyButton)
|
||||
)
|
||||
.SetInsets(spacing, spacing, spacing, spacing)
|
||||
);
|
||||
.Add(fApplyButton);
|
||||
|
||||
tabView->AddTab(_CreateGeneralPage(spacing));
|
||||
tabView->AddTab(_CreateFontsPage(spacing));
|
||||
@@ -484,6 +485,7 @@ SettingsWindow::_CreateProxyPage(float spacing)
|
||||
.Add(fProxyPortControl->CreateLabelLayoutItem(), 0, 1)
|
||||
.Add(fProxyPortControl->CreateTextViewLayoutItem(), 1, 1)
|
||||
)
|
||||
.Add(BSpaceLayoutItem::CreateVerticalStrut(spacing))
|
||||
.Add(fUseProxyAuthCheckBox)
|
||||
.Add(BGridLayoutBuilder(spacing / 2, spacing / 2)
|
||||
.Add(fProxyUsernameControl->CreateLabelLayoutItem(), 0, 0)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <Directory.h>
|
||||
#include <Entry.h>
|
||||
#include <File.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <Messenger.h>
|
||||
#include <Path.h>
|
||||
@@ -96,18 +96,13 @@ APRView::APRView(const char* name)
|
||||
fPicker = new BColorControl(B_ORIGIN, B_CELLS_32x8, 8.0,
|
||||
"picker", new BMessage(UPDATE_COLOR));
|
||||
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
|
||||
.Add(fScrollView)
|
||||
.Add(BSpaceLayoutItem::CreateVerticalStrut(5))
|
||||
.Add(BGroupLayoutBuilder(B_HORIZONTAL)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.Add(fScrollView, 10.0)
|
||||
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
|
||||
.Add(fColorPreview)
|
||||
.Add(BSpaceLayoutItem::CreateHorizontalStrut(5))
|
||||
.Add(fPicker)
|
||||
)
|
||||
.SetInsets(10, 10, 10, 10)
|
||||
);
|
||||
.End()
|
||||
.SetInsets(B_USE_WINDOW_SPACING);
|
||||
|
||||
fColorPreview->Parent()->SetExplicitMaxSize(
|
||||
BSize(B_SIZE_UNSET, fPicker->Bounds().Height()));
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <Messenger.h>
|
||||
#include <SeparatorView.h>
|
||||
#include <TabView.h>
|
||||
|
||||
#include "AntialiasingSettingsView.h"
|
||||
@@ -61,15 +62,19 @@ APRWindow::APRWindow(BRect frame)
|
||||
tabView->AddTab(fColorsView);
|
||||
tabView->AddTab(fLookAndFeelSettings);
|
||||
tabView->AddTab(fAntialiasingSettings);
|
||||
tabView->SetBorder(B_NO_BORDER);
|
||||
|
||||
_UpdateButtons();
|
||||
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, B_USE_DEFAULT_SPACING)
|
||||
.Add(tabView)
|
||||
.Add(new BSeparatorView(B_HORIZONTAL))
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.Add(fDefaultsButton)
|
||||
.Add(fRevertButton)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, 0)
|
||||
.AddGlue();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
#include <Box.h>
|
||||
#include <Catalog.h>
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <MenuField.h>
|
||||
#include <MenuItem.h>
|
||||
@@ -136,10 +135,8 @@ AntialiasingSettingsView::AntialiasingSettingsView(const char* name)
|
||||
subpixelAntialiasingDisabledLabel->MakeSelectable(false);
|
||||
#endif // !FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
||||
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
|
||||
BLayoutBuilder::Grid<>(this, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
// controls pane
|
||||
AddChild(BGridLayoutBuilder(10, 10)
|
||||
.Add(fHintingMenuField->CreateLabelLayoutItem(), 0, 0)
|
||||
.Add(fHintingMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
||||
|
||||
@@ -154,9 +151,8 @@ AntialiasingSettingsView::AntialiasingSettingsView(const char* name)
|
||||
#else
|
||||
.Add(BSpaceLayoutItem::CreateGlue(), 0, 3, 2)
|
||||
#endif
|
||||
|
||||
.SetInsets(10, 10, 10, 10)
|
||||
);
|
||||
.AddGlue(0, 4)
|
||||
.SetInsets(B_USE_WINDOW_SPACING);
|
||||
|
||||
_SetCurrentAntialiasing();
|
||||
_SetCurrentHinting();
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <Catalog.h>
|
||||
#include <ControlLook.h>
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
@@ -71,7 +72,7 @@ FontView::FontView(const char* name)
|
||||
fMenuView = new FontSelectionView("menu", B_TRANSLATE("Menu font:"));
|
||||
|
||||
BGridLayout* layout = new BGridLayout(5, 5);
|
||||
layout->SetInsets(10, 10, 10, 10);
|
||||
layout->SetInsets(B_USE_WINDOW_SPACING);
|
||||
SetLayout(layout);
|
||||
|
||||
int32 row = 0;
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include <Button.h>
|
||||
#include <Catalog.h>
|
||||
#include <CheckBox.h>
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <InterfaceDefs.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
@@ -95,7 +93,7 @@ LookAndFeelSettingsView::LookAndFeelSettingsView(const char* name)
|
||||
.AddGroup(B_VERTICAL, 1)
|
||||
.Add(new BStringView("single", B_TRANSLATE("Single:")))
|
||||
.Add(fArrowStyleSingle)
|
||||
.Add(new BStringView("spacer", ""))
|
||||
.AddStrut(B_USE_DEFAULT_SPACING)
|
||||
.Add(new BStringView("double", B_TRANSLATE("Double:")))
|
||||
.Add(fArrowStyleDouble)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
@@ -105,32 +103,23 @@ LookAndFeelSettingsView::LookAndFeelSettingsView(const char* name)
|
||||
arrowStyleBox->AddChild(arrowStyleView);
|
||||
arrowStyleBox->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||
B_ALIGN_VERTICAL_CENTER));
|
||||
arrowStyleBox->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
||||
|
||||
BStringView* scrollBarLabel
|
||||
= new BStringView("scroll bar", B_TRANSLATE("Scroll bar:"));
|
||||
scrollBarLabel->SetExplicitAlignment(
|
||||
BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP));
|
||||
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
|
||||
// control layout
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, B_USE_DEFAULT_SPACING)
|
||||
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
|
||||
.Add(BGridLayoutBuilder(B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING)
|
||||
.Add(fDecorMenuField->CreateLabelLayoutItem(), 0, 0)
|
||||
.Add(fDecorMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
||||
.Add(fDecorInfoButton, 2, 0)
|
||||
)
|
||||
.AddGroup(B_HORIZONTAL, B_USE_DEFAULT_SPACING)
|
||||
.Add(scrollBarLabel)
|
||||
.Add(arrowStyleBox)
|
||||
.End()
|
||||
.AddGlue()
|
||||
.End()
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
);
|
||||
BLayoutBuilder::Grid<>(this, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
.Add(fDecorMenuField->CreateLabelLayoutItem(), 0, 0)
|
||||
.Add(fDecorMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
||||
.Add(fDecorInfoButton, 2, 0)
|
||||
.Add(scrollBarLabel, 0, 1)
|
||||
.Add(arrowStyleBox, 1, 1)
|
||||
.AddGlue(0, 2)
|
||||
.SetInsets(B_USE_WINDOW_SPACING);
|
||||
|
||||
// TODO : Decorator Preview Image?
|
||||
}
|
||||
|
||||
|
||||
@@ -227,17 +227,13 @@ FormatSettingsView::FormatSettingsView()
|
||||
.Add(BSpaceLayoutItem::CreateGlue(), 2, 1)
|
||||
.View());
|
||||
|
||||
BGroupLayout* rootLayout = new BGroupLayout(B_VERTICAL, spacing);
|
||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||
SetLayout(rootLayout);
|
||||
BLayoutBuilder::Group<>(rootLayout)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.Add(fUseLanguageStringsCheckBox)
|
||||
.Add(fDateBox)
|
||||
.Add(fTimeBox)
|
||||
.AddGroup(B_HORIZONTAL, spacing)
|
||||
.Add(fNumberBox)
|
||||
.Add(fMonetaryBox)
|
||||
.AddGlue()
|
||||
.End()
|
||||
.AddGlue();
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <MutableLocaleRoster.h>
|
||||
#include <Screen.h>
|
||||
#include <ScrollView.h>
|
||||
#include <SeparatorView.h>
|
||||
#include <StringView.h>
|
||||
#include <TabView.h>
|
||||
#include <UnicodeChar.h>
|
||||
@@ -78,6 +79,8 @@ LocaleWindow::LocaleWindow()
|
||||
float spacing = be_control_look->DefaultItemSpacing();
|
||||
|
||||
BTabView* tabView = new BTabView("tabview", B_WIDTH_FROM_WIDEST);
|
||||
tabView->SetBorder(B_NO_BORDER);
|
||||
|
||||
BGroupView* languageTab = new BGroupView(B_TRANSLATE("Language"),
|
||||
B_HORIZONTAL, spacing);
|
||||
|
||||
@@ -165,15 +168,16 @@ LocaleWindow::LocaleWindow()
|
||||
new BMessage(kMsgPreferredLanguageDragged));
|
||||
|
||||
BLayoutBuilder::Group<>(languageTab)
|
||||
.AddGroup(B_VERTICAL, spacing)
|
||||
.AddGroup(B_VERTICAL)
|
||||
.Add(new BStringView("", B_TRANSLATE("Available languages")))
|
||||
.Add(scrollView)
|
||||
.End()
|
||||
.AddGroup(B_VERTICAL, spacing)
|
||||
.AddGroup(B_VERTICAL)
|
||||
.Add(new BStringView("", B_TRANSLATE("Preferred languages")))
|
||||
.Add(scrollViewEnabled)
|
||||
.End()
|
||||
.SetInsets(spacing, spacing, spacing, spacing);
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING);
|
||||
|
||||
BView* countryTab = new BView(B_TRANSLATE("Formatting"), B_WILL_DRAW);
|
||||
countryTab->SetLayout(new BGroupLayout(B_VERTICAL, 0));
|
||||
@@ -242,7 +246,8 @@ LocaleWindow::LocaleWindow()
|
||||
.Add(scrollView)
|
||||
.End()
|
||||
.Add(fFormatView)
|
||||
.SetInsets(spacing, spacing, spacing, spacing));
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING));
|
||||
|
||||
BView* optionsTab = new BView(B_TRANSLATE("Options"), B_WILL_DRAW);
|
||||
optionsTab->SetLayout(new BGroupLayout(B_VERTICAL, 0));
|
||||
@@ -254,10 +259,11 @@ LocaleWindow::LocaleWindow()
|
||||
fFilesystemTranslationCheckbox->SetValue(
|
||||
BLocaleRoster::Default()->IsFilesystemTranslationPreferred());
|
||||
|
||||
optionsTab->AddChild(BLayoutBuilder::Group<>(B_VERTICAL, spacing)
|
||||
optionsTab->AddChild(BLayoutBuilder::Group<>(B_VERTICAL)
|
||||
.Add(fFilesystemTranslationCheckbox)
|
||||
.AddGlue()
|
||||
.SetInsets(spacing, spacing, spacing, spacing));
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING));
|
||||
|
||||
tabView->AddTab(languageTab);
|
||||
tabView->AddTab(countryTab);
|
||||
@@ -270,15 +276,16 @@ LocaleWindow::LocaleWindow()
|
||||
= new BButton(B_TRANSLATE("Revert"), new BMessage(kMsgRevert));
|
||||
fRevertButton->SetEnabled(false);
|
||||
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, spacing)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, B_USE_WINDOW_SPACING)
|
||||
.Add(tabView)
|
||||
.AddGroup(B_HORIZONTAL, spacing)
|
||||
.Add(new BSeparatorView(B_HORIZONTAL))
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.Add(button)
|
||||
.Add(fRevertButton)
|
||||
.AddGlue()
|
||||
.End()
|
||||
.SetInsets(spacing, spacing, spacing, spacing)
|
||||
.End();
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_WINDOW_SPACING, 0)
|
||||
.AddGlue();
|
||||
|
||||
_Refresh(true);
|
||||
_SettingsReverted();
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <Roster.h>
|
||||
#include <Screen.h>
|
||||
#include <ScrollView.h>
|
||||
#include <SeparatorView.h>
|
||||
#include <StringView.h>
|
||||
#include <TabView.h>
|
||||
#include <TextControl.h>
|
||||
@@ -208,6 +209,7 @@ ConfigWindow::ConfigWindow()
|
||||
fSaveSettings(false)
|
||||
{
|
||||
BTabView* tabView = new BTabView("tab");
|
||||
tabView->SetBorder(B_NO_BORDER);
|
||||
|
||||
// accounts listview
|
||||
|
||||
@@ -231,7 +233,8 @@ ConfigWindow::ConfigWindow()
|
||||
false, true);
|
||||
|
||||
BLayoutBuilder::Group<>(view, B_HORIZONTAL)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING)
|
||||
.AddGroup(B_VERTICAL)
|
||||
.Add(scroller)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
@@ -287,11 +290,13 @@ ConfigWindow::ConfigWindow()
|
||||
editMenuButton->SetEnabled(false);
|
||||
|
||||
BLayoutBuilder::Group<>(view, B_VERTICAL)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||
.AddGlue()
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING)
|
||||
// .AddGlue()
|
||||
.AddGroup(B_HORIZONTAL, 0.f)
|
||||
.AddGlue()
|
||||
.Add(fCheckMailCheckBox)
|
||||
.AddStrut(be_control_look->DefaultLabelSpacing())
|
||||
.Add(fIntervalControl->CreateTextViewLayoutItem())
|
||||
.AddStrut(be_control_look->DefaultLabelSpacing())
|
||||
.Add(fIntervalControl->CreateLabelLayoutItem())
|
||||
@@ -313,13 +318,16 @@ ConfigWindow::ConfigWindow()
|
||||
BButton* revertButton = new BButton("revert", B_TRANSLATE("Revert"),
|
||||
new BMessage(kMsgRevertSettings));
|
||||
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, B_USE_WINDOW_SPACING)
|
||||
.Add(tabView)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.Add(new BSeparatorView(B_HORIZONTAL))
|
||||
.AddGroup(B_HORIZONTAL, 0)
|
||||
.Add(revertButton)
|
||||
.AddGlue()
|
||||
.Add(applyButton);
|
||||
.Add(applyButton)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_WINDOW_SPACING, 0);
|
||||
|
||||
_LoadSettings();
|
||||
// this will also move our window to the stored position
|
||||
|
||||
@@ -13,19 +13,19 @@
|
||||
#include <Alert.h>
|
||||
#include <Catalog.h>
|
||||
#include <Directory.h>
|
||||
#include <Message.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <GridLayoutBuilder.h>
|
||||
#include <SpaceLayoutItem.h>
|
||||
#include <TextControl.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Menu.h>
|
||||
#include <MenuItem.h>
|
||||
#include <MenuField.h>
|
||||
#include <Message.h>
|
||||
#include <Mime.h>
|
||||
#include <Node.h>
|
||||
#include <notification/Notifications.h>
|
||||
#include <Path.h>
|
||||
#include <SpaceLayoutItem.h>
|
||||
#include <TextControl.h>
|
||||
|
||||
#include <notification/Notifications.h>
|
||||
|
||||
#include "DisplayView.h"
|
||||
#include "SettingsHost.h"
|
||||
@@ -52,18 +52,13 @@ DisplayView::DisplayView(SettingsHost* host)
|
||||
fIconSize->SetLabelFromMarked(true);
|
||||
fIconSizeField = new BMenuField(B_TRANSLATE("Icon size:"), fIconSize);
|
||||
|
||||
// Calculate inset
|
||||
float inset = ceilf(be_plain_font->Size() * 0.7f);
|
||||
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
AddChild(BGridLayoutBuilder(inset, inset)
|
||||
BLayoutBuilder::Grid<>(this, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
|
||||
.Add(fWindowWidth->CreateLabelLayoutItem(), 0, 0)
|
||||
.Add(fWindowWidth->CreateTextViewLayoutItem(), 1, 0)
|
||||
.Add(fIconSizeField->CreateLabelLayoutItem(), 0, 1)
|
||||
.Add(fIconSizeField->CreateMenuBarLayoutItem(), 1, 1)
|
||||
.Add(BSpaceLayoutItem::CreateGlue(), 0, 2, 2, 1)
|
||||
.SetInsets(inset, inset, inset, inset)
|
||||
);
|
||||
.AddGlue(0, 2)
|
||||
.SetInsets(B_USE_WINDOW_SPACING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,27 +12,27 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <Roster.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <Alert.h>
|
||||
#include <Font.h>
|
||||
#include <Button.h>
|
||||
#include <Catalog.h>
|
||||
#include <StringView.h>
|
||||
#include <TextControl.h>
|
||||
#include <CheckBox.h>
|
||||
#include <String.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <Node.h>
|
||||
#include <notification/Notifications.h>
|
||||
#include <Path.h>
|
||||
#include <File.h>
|
||||
#include <Directory.h>
|
||||
#include <VolumeRoster.h>
|
||||
#include <Volume.h>
|
||||
#include <File.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <Font.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Node.h>
|
||||
#include <Path.h>
|
||||
#include <Query.h>
|
||||
#include <Roster.h>
|
||||
#include <String.h>
|
||||
#include <StringView.h>
|
||||
#include <SymLink.h>
|
||||
#include <TextControl.h>
|
||||
#include <Volume.h>
|
||||
#include <VolumeRoster.h>
|
||||
|
||||
#include <notification/Notifications.h>
|
||||
|
||||
#include "GeneralView.h"
|
||||
#include "SettingsHost.h"
|
||||
@@ -62,20 +62,15 @@ GeneralView::GeneralView(SettingsHost* host)
|
||||
B_TRANSLATE("seconds of inactivity"));
|
||||
|
||||
// Default position
|
||||
// TODO: Here will come a screen representation with the four corners
|
||||
// TODO: Here will come a screen representation with the four corners
|
||||
// clickable
|
||||
|
||||
// Calculate inset
|
||||
float inset = ceilf(be_plain_font->Size() * 0.7f);
|
||||
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, inset)
|
||||
.AddGroup(B_HORIZONTAL, inset)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.AddGroup(B_HORIZONTAL, B_USE_WINDOW_SPACING)
|
||||
.Add(fNotificationBox)
|
||||
.AddGlue()
|
||||
.End()
|
||||
|
||||
.AddGroup(B_VERTICAL, inset)
|
||||
.AddGroup(B_VERTICAL, B_USE_WINDOW_SPACING)
|
||||
.Add(fAutoStart)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.AddGroup(B_HORIZONTAL, 2)
|
||||
@@ -84,9 +79,8 @@ GeneralView::GeneralView(SettingsHost* host)
|
||||
.End()
|
||||
.End()
|
||||
.End()
|
||||
.SetInsets(inset, inset, inset, inset)
|
||||
.AddGlue()
|
||||
);
|
||||
.SetInsets(B_USE_WINDOW_SPACING)
|
||||
.AddGlue();
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +159,7 @@ GeneralView::MessageReceived(BMessage* msg)
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
case kSettingChanged:
|
||||
SettingsPane::MessageReceived(msg);
|
||||
break;
|
||||
|
||||
@@ -9,20 +9,19 @@
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Catalog.h>
|
||||
#include <Directory.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <Window.h>
|
||||
#include <CheckBox.h>
|
||||
#include <TextControl.h>
|
||||
#include <Path.h>
|
||||
#include <Notification.h>
|
||||
#include <notification/Notifications.h>
|
||||
#include <notification/NotificationReceived.h>
|
||||
|
||||
#include <ColumnListView.h>
|
||||
#include <ColumnTypes.h>
|
||||
#include <Directory.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Notification.h>
|
||||
#include <Path.h>
|
||||
#include <TextControl.h>
|
||||
#include <Window.h>
|
||||
|
||||
#include <notification/Notifications.h>
|
||||
#include <notification/NotificationReceived.h>
|
||||
|
||||
#include "NotificationsView.h"
|
||||
|
||||
@@ -59,23 +58,23 @@ NotificationsView::NotificationsView(SettingsHost* host)
|
||||
new BMessage(kSettingChanged));
|
||||
|
||||
// Applications list
|
||||
fApplications = new BColumnListView(rect, B_TRANSLATE("Applications"),
|
||||
0, B_WILL_DRAW, B_FANCY_BORDER, true);
|
||||
fApplications = new BColumnListView(B_TRANSLATE("Applications"),
|
||||
0, B_FANCY_BORDER, true);
|
||||
fApplications->SetSelectionMode(B_SINGLE_SELECTION_LIST);
|
||||
|
||||
fAppCol = new BStringColumn(B_TRANSLATE("Application"), 200,
|
||||
be_plain_font->StringWidth(B_TRANSLATE("Application")) +
|
||||
be_plain_font->StringWidth(B_TRANSLATE("Application")) +
|
||||
(kCLVTitlePadding * 2), rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT);
|
||||
fApplications->AddColumn(fAppCol, kAppIndex);
|
||||
|
||||
fAppEnabledCol = new BStringColumn(B_TRANSLATE("Enabled"), 10,
|
||||
be_plain_font->StringWidth(B_TRANSLATE("Enabled")) +
|
||||
be_plain_font->StringWidth(B_TRANSLATE("Enabled")) +
|
||||
(kCLVTitlePadding * 2), rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT);
|
||||
fApplications->AddColumn(fAppEnabledCol, kAppEnabledIndex);
|
||||
|
||||
// Notifications list
|
||||
fNotifications = new BColumnListView(rect, B_TRANSLATE("Notifications"),
|
||||
0, B_WILL_DRAW, B_FANCY_BORDER, true);
|
||||
fNotifications = new BColumnListView(B_TRANSLATE("Notifications"),
|
||||
0, B_FANCY_BORDER, true);
|
||||
fNotifications->SetSelectionMode(B_SINGLE_SELECTION_LIST);
|
||||
|
||||
fTitleCol = new BStringColumn(B_TRANSLATE("Title"), 100,
|
||||
@@ -98,22 +97,16 @@ NotificationsView::NotificationsView(SettingsHost* host)
|
||||
(kCLVTitlePadding * 2), rect.Width(), B_TRUNCATE_END, B_ALIGN_LEFT);
|
||||
fNotifications->AddColumn(fAllowCol, kAllowIndex);
|
||||
|
||||
// Calculate inset
|
||||
float inset = ceilf(be_plain_font->Size() * 0.7f);
|
||||
|
||||
// Set layout
|
||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||
|
||||
// Add views
|
||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, inset)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.AddGlue()
|
||||
.Add(fSearch)
|
||||
.End()
|
||||
.Add(fApplications)
|
||||
.Add(fNotifications)
|
||||
.SetInsets(inset, inset, inset, inset)
|
||||
);
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
*/
|
||||
|
||||
#include <Catalog.h>
|
||||
#include <Message.h>
|
||||
#include <CardLayout.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <CardLayout.h>
|
||||
#include <LayoutItem.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include "SettingsHost.h"
|
||||
#include "PrefletView.h"
|
||||
#include "GeneralView.h"
|
||||
#include "DisplayView.h"
|
||||
#include "GeneralView.h"
|
||||
#include "NotificationsView.h"
|
||||
#include "PrefletView.h"
|
||||
#include "SettingsHost.h"
|
||||
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <FindDirectory.h>
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Path.h>
|
||||
#include <SeparatorView.h>
|
||||
|
||||
#include <notification/Notifications.h>
|
||||
|
||||
@@ -33,11 +34,12 @@ const int32 kApply = '_APY';
|
||||
PrefletWin::PrefletWin()
|
||||
:
|
||||
BWindow(BRect(0, 0, 1, 1), B_TRANSLATE_SYSTEM_NAME("Notifications"),
|
||||
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE
|
||||
| B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS)
|
||||
B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS
|
||||
| B_AUTO_UPDATE_SIZE_LIMITS)
|
||||
{
|
||||
// Preflet container view
|
||||
fMainView = new PrefletView(this);
|
||||
fMainView->SetBorder(B_NO_BORDER);
|
||||
|
||||
// Apply and revert buttons
|
||||
fRevert = new BButton("revert", B_TRANSLATE("Revert"),
|
||||
@@ -47,13 +49,16 @@ PrefletWin::PrefletWin()
|
||||
fApply->SetEnabled(false);
|
||||
|
||||
// Build the layout
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, 0)
|
||||
.Add(fMainView)
|
||||
.Add(new BSeparatorView(B_HORIZONTAL))
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.Add(fRevert)
|
||||
.AddGlue()
|
||||
.Add(fApply);
|
||||
.Add(fApply)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING);
|
||||
|
||||
ReloadSettings();
|
||||
|
||||
|
||||
@@ -67,7 +67,8 @@ ClockView::ClockView(const char* name)
|
||||
.AddGroup(B_VERTICAL, 0)
|
||||
.Add(showClockBox)
|
||||
.End()
|
||||
.SetInsets(B_USE_DEFAULT_SPACING);
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -186,18 +186,18 @@ DateTimeView::_InitView()
|
||||
B_WILL_DRAW | B_FRAME_EVENTS, B_FANCY_BORDER);
|
||||
divider->SetExplicitMaxSize(BSize(1, B_SIZE_UNLIMITED));
|
||||
|
||||
const float kInset = be_control_look->DefaultItemSpacing();
|
||||
BLayoutBuilder::Group<>(this)
|
||||
.AddGroup(B_VERTICAL, kInset / 2)
|
||||
BLayoutBuilder::Group<>(this, B_HORIZONTAL, B_USE_DEFAULT_SPACING)
|
||||
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
|
||||
.Add(fDateEdit)
|
||||
.Add(fCalendarView)
|
||||
.End()
|
||||
.Add(divider)
|
||||
.AddGroup(B_VERTICAL, 0)
|
||||
.AddGroup(B_VERTICAL)
|
||||
.Add(fTimeEdit)
|
||||
.Add(fClock)
|
||||
.End()
|
||||
.SetInsets(kInset, kInset, kInset, kInset);
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -524,7 +524,8 @@ NetworkTimeView::_InitView()
|
||||
.Add(fResetButton)
|
||||
.Add(fSynchronizeButton)
|
||||
.End()
|
||||
.SetInsets(B_USE_DEFAULT_SPACING);
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <LayoutBuilder.h>
|
||||
#include <Message.h>
|
||||
#include <Screen.h>
|
||||
#include <SeparatorView.h>
|
||||
#include <TabView.h>
|
||||
|
||||
#include "BaseView.h"
|
||||
@@ -129,6 +130,7 @@ TTimeWindow::_InitWindow()
|
||||
fTabView->AddTab(fTimeZoneView);
|
||||
fTabView->AddTab(fNetworkTimeView);
|
||||
fTabView->AddTab(fClockView);
|
||||
fTabView->SetBorder(B_NO_BORDER);
|
||||
|
||||
fBaseView->AddChild(fTabView);
|
||||
|
||||
@@ -139,10 +141,14 @@ TTimeWindow::_InitWindow()
|
||||
fRevertButton->SetExplicitAlignment(
|
||||
BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
||||
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL)
|
||||
.SetInsets(B_USE_DEFAULT_SPACING)
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
|
||||
.SetInsets(0, B_USE_DEFAULT_SPACING, 0, 0)
|
||||
.Add(fBaseView)
|
||||
.Add(fRevertButton);
|
||||
.Add(new BSeparatorView(B_HORIZONTAL))
|
||||
.AddGroup(B_HORIZONTAL)
|
||||
.Add(fRevertButton)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_WINDOW_SPACING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -238,8 +238,6 @@ TimeZoneView::_InitView()
|
||||
_ShowOrHidePreview();
|
||||
fOldUseGmtTime = fUseGmtTime;
|
||||
|
||||
const float kIndentSpacing
|
||||
= be_control_look->DefaultItemSpacing() * 2;
|
||||
BLayoutBuilder::Group<>(this)
|
||||
.Add(scrollList)
|
||||
.AddGroup(B_VERTICAL, 0)
|
||||
@@ -248,7 +246,7 @@ TimeZoneView::_InitView()
|
||||
.AddGroup(B_VERTICAL, 0)
|
||||
.Add(fLocalTime)
|
||||
.Add(fGmtTime)
|
||||
.SetInsets(kIndentSpacing, 0, 0, 0)
|
||||
.SetInsets(B_USE_WINDOW_SPACING, 0, 0, 0)
|
||||
.End()
|
||||
.AddGlue()
|
||||
.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
|
||||
@@ -257,8 +255,8 @@ TimeZoneView::_InitView()
|
||||
.End()
|
||||
.Add(fSetZone)
|
||||
.End()
|
||||
.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
|
||||
B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING);
|
||||
.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
|
||||
B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user