Appearance preflet: Add a double scrollbar arrows setting.
Rename the 'Decorators' tab to 'Look and feel'. Fixes #8926.
This commit is contained in:
parent
f25372e2d2
commit
4143336284
@ -55,7 +55,7 @@ APRWindow::APRWindow(BRect frame)
|
|||||||
fColorsView = new APRView(B_TRANSLATE("Colors"));
|
fColorsView = new APRView(B_TRANSLATE("Colors"));
|
||||||
|
|
||||||
fDecorSettings = new DecorSettingsView(
|
fDecorSettings = new DecorSettingsView(
|
||||||
B_TRANSLATE("Decorators"));
|
B_TRANSLATE("Look and feel"));
|
||||||
|
|
||||||
fAntialiasingSettings = new AntialiasingSettingsView(
|
fAntialiasingSettings = new AntialiasingSettingsView(
|
||||||
B_TRANSLATE("Antialiasing"));
|
B_TRANSLATE("Antialiasing"));
|
||||||
|
@ -17,8 +17,10 @@
|
|||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
|
#include <CheckBox.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
|
#include <InterfaceDefs.h>
|
||||||
#include <Locale.h>
|
#include <Locale.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
@ -36,6 +38,9 @@
|
|||||||
|
|
||||||
static const int32 kMsgSetDecor = 'deco';
|
static const int32 kMsgSetDecor = 'deco';
|
||||||
static const int32 kMsgDecorInfo = 'idec';
|
static const int32 kMsgDecorInfo = 'idec';
|
||||||
|
static const int32 kMsgDoubleScrollbarArrows = 'dsba';
|
||||||
|
|
||||||
|
static const bool kDefaultDoubleScrollbarArrowsSetting = false;
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
@ -43,7 +48,11 @@ static const int32 kMsgDecorInfo = 'idec';
|
|||||||
|
|
||||||
DecorSettingsView::DecorSettingsView(const char* name)
|
DecorSettingsView::DecorSettingsView(const char* name)
|
||||||
:
|
:
|
||||||
BView(name, 0)
|
BView(name, 0),
|
||||||
|
fDecorInfoButton(NULL),
|
||||||
|
fDecorMenuField(NULL),
|
||||||
|
fDecorMenu(NULL),
|
||||||
|
fDoubleScrollbarArrowsCheckBox(NULL)
|
||||||
{
|
{
|
||||||
// Decorator menu
|
// Decorator menu
|
||||||
_BuildDecorMenu();
|
_BuildDecorMenu();
|
||||||
@ -53,6 +62,13 @@ DecorSettingsView::DecorSettingsView(const char* name)
|
|||||||
fDecorInfoButton = new BButton(B_TRANSLATE("About"),
|
fDecorInfoButton = new BButton(B_TRANSLATE("About"),
|
||||||
new BMessage(kMsgDecorInfo));
|
new BMessage(kMsgDecorInfo));
|
||||||
|
|
||||||
|
fDoubleScrollbarArrowsCheckBox = new BCheckBox("doubleScrollbarArrows",
|
||||||
|
B_TRANSLATE("Use double scrollbar arrows"),
|
||||||
|
new BMessage(kMsgDoubleScrollbarArrows));
|
||||||
|
|
||||||
|
fSavedDoubleArrowsValue = _GetDoubleScrollbarArrowsSetting();
|
||||||
|
fDoubleScrollbarArrowsCheckBox->SetValue(fSavedDoubleArrowsValue);
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
|
|
||||||
// control layout
|
// control layout
|
||||||
@ -61,9 +77,10 @@ DecorSettingsView::DecorSettingsView(const char* name)
|
|||||||
.Add(fDecorMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
.Add(fDecorMenuField->CreateMenuBarLayoutItem(), 1, 0)
|
||||||
.Add(fDecorInfoButton, 2, 0)
|
.Add(fDecorInfoButton, 2, 0)
|
||||||
|
|
||||||
.Add(BSpaceLayoutItem::CreateGlue(), 0, 3, 2)
|
.Add(fDoubleScrollbarArrowsCheckBox, 0, 3, 2)
|
||||||
.SetInsets(10, 10, 10, 10)
|
.Add(BSpaceLayoutItem::CreateGlue(), 0, 4, 2)
|
||||||
);
|
.SetInsets(10, 10, 10, 10)
|
||||||
|
);
|
||||||
// TODO : Decorator Preview Image?
|
// TODO : Decorator Preview Image?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +100,7 @@ DecorSettingsView::AttachedToWindow()
|
|||||||
|
|
||||||
fDecorMenu->SetTargetForItems(this);
|
fDecorMenu->SetTargetForItems(this);
|
||||||
fDecorInfoButton->SetTarget(this);
|
fDecorInfoButton->SetTarget(this);
|
||||||
|
fDoubleScrollbarArrowsCheckBox->SetTarget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -125,6 +143,9 @@ DecorSettingsView::MessageReceived(BMessage *msg)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case kMsgDoubleScrollbarArrows:
|
||||||
|
_SetDoubleScrollbarArrowsSetting(fDoubleScrollbarArrowsCheckBox->Value());
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(msg);
|
BView::MessageReceived(msg);
|
||||||
@ -197,24 +218,53 @@ DecorSettingsView::_AdoptInterfaceToCurrentDecor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
DecorSettingsView::_GetDoubleScrollbarArrowsSetting()
|
||||||
|
{
|
||||||
|
scroll_bar_info info;
|
||||||
|
get_scroll_bar_info(&info);
|
||||||
|
|
||||||
|
return info.double_arrows;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
DecorSettingsView::_SetDoubleScrollbarArrowsSetting(bool value)
|
||||||
|
{
|
||||||
|
scroll_bar_info info;
|
||||||
|
get_scroll_bar_info(&info);
|
||||||
|
|
||||||
|
info.double_arrows = value;
|
||||||
|
set_scroll_bar_info(&info);
|
||||||
|
|
||||||
|
Window()->PostMessage(kMsgUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DecorSettingsView::SetDefaults()
|
DecorSettingsView::SetDefaults()
|
||||||
{
|
{
|
||||||
_SetDecor(fDecorUtility.DefaultDecorator());
|
_SetDecor(fDecorUtility.DefaultDecorator());
|
||||||
|
_SetDoubleScrollbarArrowsSetting(kDefaultDoubleScrollbarArrowsSetting);
|
||||||
|
fDoubleScrollbarArrowsCheckBox->SetValue(
|
||||||
|
kDefaultDoubleScrollbarArrowsSetting);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DecorSettingsView::IsDefaultable()
|
DecorSettingsView::IsDefaultable()
|
||||||
{
|
{
|
||||||
return fCurrentDecor != fDecorUtility.DefaultDecorator()->Name();
|
return fCurrentDecor != fDecorUtility.DefaultDecorator()->Name() ||
|
||||||
|
fDoubleScrollbarArrowsCheckBox->Value() !=
|
||||||
|
kDefaultDoubleScrollbarArrowsSetting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DecorSettingsView::IsRevertable()
|
DecorSettingsView::IsRevertable()
|
||||||
{
|
{
|
||||||
return fCurrentDecor != fSavedDecor;
|
return fCurrentDecor != fSavedDecor ||
|
||||||
|
fDoubleScrollbarArrowsCheckBox->Value() != fSavedDoubleArrowsValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -222,4 +272,6 @@ void
|
|||||||
DecorSettingsView::Revert()
|
DecorSettingsView::Revert()
|
||||||
{
|
{
|
||||||
_SetDecor(fSavedDecor);
|
_SetDecor(fSavedDecor);
|
||||||
|
_SetDoubleScrollbarArrowsSetting(fSavedDoubleArrowsValue);
|
||||||
|
fDoubleScrollbarArrowsCheckBox->SetValue(fSavedDoubleArrowsValue);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class BButton;
|
class BButton;
|
||||||
|
class BCheckBox;
|
||||||
class BMenuField;
|
class BMenuField;
|
||||||
class BPopUpMenu;
|
class BPopUpMenu;
|
||||||
|
|
||||||
@ -40,6 +41,8 @@ private:
|
|||||||
void _BuildDecorMenu();
|
void _BuildDecorMenu();
|
||||||
void _AdoptToCurrentDecor();
|
void _AdoptToCurrentDecor();
|
||||||
void _AdoptInterfaceToCurrentDecor();
|
void _AdoptInterfaceToCurrentDecor();
|
||||||
|
bool _GetDoubleScrollbarArrowsSetting();
|
||||||
|
void _SetDoubleScrollbarArrowsSetting(bool value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DecorInfoUtility fDecorUtility;
|
DecorInfoUtility fDecorUtility;
|
||||||
@ -47,9 +50,11 @@ private:
|
|||||||
BButton* fDecorInfoButton;
|
BButton* fDecorInfoButton;
|
||||||
BMenuField* fDecorMenuField;
|
BMenuField* fDecorMenuField;
|
||||||
BPopUpMenu* fDecorMenu;
|
BPopUpMenu* fDecorMenu;
|
||||||
|
BCheckBox* fDoubleScrollbarArrowsCheckBox;
|
||||||
|
|
||||||
BString fSavedDecor;
|
BString fSavedDecor;
|
||||||
BString fCurrentDecor;
|
BString fCurrentDecor;
|
||||||
|
bool fSavedDoubleArrowsValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DECOR_SETTINGS_VIEW_H
|
#endif // DECOR_SETTINGS_VIEW_H
|
||||||
|
Loading…
Reference in New Issue
Block a user