* Use layout management in the AntialiasingSettingsView.
* Remove unused code. * Remove INSTANT_UPDATE define, I guess instant update is always wanted. * Replaced text control for setting the "averaging strength" with a slider and hopefully improved label. * Simplified other labels a bit as well. * Added detection of subpixel rendering availability by peeking into the Freetype option header. If it's not turned on, then the controls are not displayed and instead there is a text explaining the problem and hinting at what needs to be done in order to enable the feature. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27634 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2008, Stephan Aßmus, <[email protected]>
|
||||||
* Copyright 2008, Andrej Spielmann, <[email protected]>
|
* Copyright 2008, Andrej Spielmann, <[email protected]>
|
||||||
* All rights reserved. Distributed under the terms of the MIT License.
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
@@ -8,18 +9,24 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <freetype/config/ftoption.h>
|
||||||
|
// for detected the availablility of subpixel anti-aliasing
|
||||||
|
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
|
#include <CardLayout.h>
|
||||||
|
#include <GridLayoutBuilder.h>
|
||||||
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <PopUpMenu.h>
|
#include <PopUpMenu.h>
|
||||||
|
#include <Slider.h>
|
||||||
|
#include <SpaceLayoutItem.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <TextControl.h>
|
#include <TextView.h>
|
||||||
|
|
||||||
#include "APRWindow.h"
|
#include "APRWindow.h"
|
||||||
|
|
||||||
|
|
||||||
#define INSTANT_UPDATE
|
|
||||||
// if defined, the changes will take place immediately and not only on exit
|
|
||||||
//#define DISABLE_HINTING_CONTROL
|
//#define DISABLE_HINTING_CONTROL
|
||||||
// if defined, the hinting menu is disabled (hinting not properly
|
// if defined, the hinting menu is disabled (hinting not properly
|
||||||
// implemented)
|
// implemented)
|
||||||
@@ -27,11 +34,15 @@
|
|||||||
static const int32 kMsgSetAntialiasing = 'anti';
|
static const int32 kMsgSetAntialiasing = 'anti';
|
||||||
static const int32 kMsgSetHinting = 'hint';
|
static const int32 kMsgSetHinting = 'hint';
|
||||||
static const int32 kMsgSetAverageWeight = 'avrg';
|
static const int32 kMsgSetAverageWeight = 'avrg';
|
||||||
static const char* kSubpixelLabel = "Subpixel antialiasing";
|
static const char* kSubpixelLabel = "LCD subpixel";
|
||||||
static const char* kGrayscaleLabel = "Grayscale antialiasing";
|
static const char* kGrayscaleLabel = "Grayscale";
|
||||||
static const char* kNoHintingLabel = "Off";
|
static const char* kNoHintingLabel = "Off";
|
||||||
static const char* kFullHintingLabel = "On";
|
static const char* kFullHintingLabel = "On";
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - private libbe API
|
||||||
|
|
||||||
|
|
||||||
extern void set_subpixel_antialiasing(bool subpix);
|
extern void set_subpixel_antialiasing(bool subpix);
|
||||||
extern status_t get_subpixel_antialiasing(bool* subpix);
|
extern status_t get_subpixel_antialiasing(bool* subpix);
|
||||||
extern void set_hinting(bool hinting);
|
extern void set_hinting(bool hinting);
|
||||||
@@ -43,9 +54,10 @@ extern status_t get_average_weight(unsigned char* averageWeight);
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
AntialiasingSettingsView::AntialiasingSettingsView(BRect _rect, const char* name)
|
AntialiasingSettingsView::AntialiasingSettingsView(BRect rect, const char* name)
|
||||||
: BView(_rect, name, B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW)
|
: BView(rect, name, B_FOLLOW_ALL, B_SUPPORTS_LAYOUT)
|
||||||
{
|
{
|
||||||
|
// collect the current system settings
|
||||||
if (get_subpixel_antialiasing(&fCurrentSubpixelAntialiasing) != B_OK)
|
if (get_subpixel_antialiasing(&fCurrentSubpixelAntialiasing) != B_OK)
|
||||||
fCurrentSubpixelAntialiasing = false;
|
fCurrentSubpixelAntialiasing = false;
|
||||||
fSavedSubpixelAntialiasing = fCurrentSubpixelAntialiasing;
|
fSavedSubpixelAntialiasing = fCurrentSubpixelAntialiasing;
|
||||||
@@ -58,107 +70,92 @@ AntialiasingSettingsView::AntialiasingSettingsView(BRect _rect, const char* name
|
|||||||
fCurrentAverageWeight = 100;
|
fCurrentAverageWeight = 100;
|
||||||
fSavedAverageWeight = fCurrentAverageWeight;
|
fSavedAverageWeight = fCurrentAverageWeight;
|
||||||
|
|
||||||
fDivider = StringWidth("Strength of colours in sbpx AA:") + 5;
|
// create the controls
|
||||||
|
|
||||||
fAntialiasingMenu = new BPopUpMenu("Antialiasing menu");
|
|
||||||
fHintingMenu = new BPopUpMenu("Hinting menu");
|
|
||||||
|
|
||||||
// antialiasing menu
|
// antialiasing menu
|
||||||
BRect rect(Bounds());
|
|
||||||
fAntialiasingMenuField = new BMenuField(rect, "antialiasing",
|
|
||||||
"Antialiasing type:", fAntialiasingMenu, false);
|
|
||||||
fAntialiasingMenuField->SetDivider(fDivider);
|
|
||||||
fAntialiasingMenuField->SetAlignment(B_ALIGN_RIGHT);
|
|
||||||
fAntialiasingMenuField->ResizeToPreferred();
|
|
||||||
AddChild(fAntialiasingMenuField);
|
|
||||||
_BuildAntialiasingMenu();
|
_BuildAntialiasingMenu();
|
||||||
|
fAntialiasingMenuField = new BMenuField("antialiasing",
|
||||||
|
"Anti-aliasing type:", fAntialiasingMenu, NULL);
|
||||||
|
|
||||||
//Average weight in subpixel filtering
|
// "average weight" in subpixel filtering
|
||||||
float shift = fAntialiasingMenuField->Bounds().Height()+5;
|
fAverageWeightControl = new BSlider("averageWeightControl",
|
||||||
rect.top +=shift;
|
"Reduce colored edges filter strength:",
|
||||||
rect.bottom += shift;
|
new BMessage(kMsgSetAverageWeight), 0, 255, B_HORIZONTAL);
|
||||||
fAverageWeightControl = new BTextControl(rect, "averageWeightControl",
|
fAverageWeightControl->SetLimitLabels("Off", "Strong");
|
||||||
"Strength of colours in sbpx AA:", NULL,
|
fAverageWeightControl->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
new BMessage(kMsgSetAverageWeight), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
|
fAverageWeightControl->SetHashMarkCount(255 / 15);
|
||||||
fAverageWeightControl -> SetDivider(fDivider);
|
fAverageWeightControl->SetEnabled(false);
|
||||||
fAverageWeightControl -> TextView() -> SetMaxBytes(3);
|
|
||||||
fAverageWeightControl -> ResizeToPreferred();
|
|
||||||
AddChild(fAverageWeightControl);
|
|
||||||
for (int i = 0; i < 256; i++) {
|
|
||||||
if (i < '0' || i > '9') {
|
|
||||||
fAverageWeightControl->TextView()->DisallowChar(i);
|
|
||||||
fAverageWeightControl->TextView()->DisallowChar(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fAverageWeightControl -> SetEnabled(false);
|
|
||||||
|
|
||||||
// hinting menu
|
// hinting menu
|
||||||
shift = fAverageWeightControl->Bounds().Height()+5;
|
|
||||||
rect.top += shift;
|
|
||||||
rect.bottom += shift;
|
|
||||||
fHintingMenuField = new BMenuField(rect, "hinting",
|
|
||||||
"Character hinting:", fHintingMenu, false);
|
|
||||||
fHintingMenuField->SetDivider(fDivider);
|
|
||||||
fHintingMenuField->SetAlignment(B_ALIGN_RIGHT);
|
|
||||||
fHintingMenuField->ResizeToPreferred();
|
|
||||||
AddChild(fHintingMenuField);
|
|
||||||
_BuildHintingMenu();
|
_BuildHintingMenu();
|
||||||
|
fHintingMenuField = new BMenuField("hinting", "Character hinting:",
|
||||||
|
fHintingMenu, NULL);
|
||||||
|
|
||||||
#ifdef DISABLE_HINTING_CONTROL
|
#ifdef DISABLE_HINTING_CONTROL
|
||||||
fHintingMenuField->SetEnabled(false);
|
fHintingMenuField->SetEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// subpixelAntialiasingDisabledLabel
|
||||||
|
// TODO: Replace with layout friendly constructor once available.
|
||||||
|
BTextView* subpixelAntialiasingDisabledLabel = new BTextView(
|
||||||
|
rect.OffsetToCopy(B_ORIGIN), "unavailable label",
|
||||||
|
rect.OffsetToCopy(B_ORIGIN).InsetBySelf(10, 10),
|
||||||
|
B_FOLLOW_NONE, B_WILL_DRAW | B_SUPPORTS_LAYOUT);
|
||||||
|
subpixelAntialiasingDisabledLabel->SetText("Subpixel based anti-aliasing "
|
||||||
|
"is not available in this build of Haiku to avoid possible patent "
|
||||||
|
"issues. To enable this feature, you have to build Haiku yourself "
|
||||||
|
"and enable certain options in the libfreetype configuration header.");
|
||||||
|
subpixelAntialiasingDisabledLabel->SetViewColor(
|
||||||
|
ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
subpixelAntialiasingDisabledLabel->MakeEditable(false);
|
||||||
|
subpixelAntialiasingDisabledLabel->MakeSelectable(false);
|
||||||
|
|
||||||
|
BCardLayout* cardLayout = new BCardLayout();
|
||||||
|
SetLayout(cardLayout);
|
||||||
|
|
||||||
|
// controls pane
|
||||||
|
AddChild(BGridLayoutBuilder(10, 10)
|
||||||
|
.Add(BSpaceLayoutItem::CreateGlue(), 0, 0, 2)
|
||||||
|
|
||||||
|
.Add(fHintingMenuField->CreateLabelLayoutItem(), 0, 1)
|
||||||
|
.Add(fHintingMenuField->CreateMenuBarLayoutItem(), 1, 1)
|
||||||
|
|
||||||
|
.Add(fAntialiasingMenuField->CreateLabelLayoutItem(), 0, 2)
|
||||||
|
.Add(fAntialiasingMenuField->CreateMenuBarLayoutItem(), 1, 2)
|
||||||
|
|
||||||
|
.Add(fAverageWeightControl, 0, 3, 2)
|
||||||
|
|
||||||
|
.Add(BSpaceLayoutItem::CreateGlue(), 0, 4, 2)
|
||||||
|
|
||||||
|
.SetInsets(10, 10, 10, 10)
|
||||||
|
);
|
||||||
|
|
||||||
|
// unavailable info pane
|
||||||
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
|
||||||
|
.Add(BSpaceLayoutItem::CreateGlue())
|
||||||
|
.Add(subpixelAntialiasingDisabledLabel)
|
||||||
|
.Add(BSpaceLayoutItem::CreateGlue())
|
||||||
|
);
|
||||||
|
|
||||||
_SetCurrentAntialiasing();
|
_SetCurrentAntialiasing();
|
||||||
_SetCurrentHinting();
|
_SetCurrentHinting();
|
||||||
_SetCurrentAverageWeight();
|
_SetCurrentAverageWeight();
|
||||||
|
|
||||||
|
// TODO: Remove once these two lines once the entire window uses
|
||||||
|
// layout management.
|
||||||
|
MoveTo(rect.LeftTop());
|
||||||
|
ResizeTo(rect.Width(), rect.Height());
|
||||||
|
|
||||||
|
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
||||||
|
cardLayout->SetVisibleItem(0L);
|
||||||
|
#else
|
||||||
|
cardLayout->SetVisibleItem(1L);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AntialiasingSettingsView::~AntialiasingSettingsView()
|
AntialiasingSettingsView::~AntialiasingSettingsView()
|
||||||
{
|
{
|
||||||
#ifndef INSTANT_UPDATE
|
|
||||||
set_subpixel_antialiasing(fCurrentSubpixelAntialiasing);
|
|
||||||
set_hinting(fCurrentHinting);
|
|
||||||
set_average_weight(fCurrentAverageWeight);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AntialiasingSettingsView::GetPreferredSize(float *_width, float *_height)
|
|
||||||
{
|
|
||||||
// don't change the width if it is large enough
|
|
||||||
if (_width) {
|
|
||||||
*_width = (StringWidth(kSubpixelLabel) > StringWidth(kGrayscaleLabel) ?
|
|
||||||
StringWidth(kSubpixelLabel) : StringWidth(kGrayscaleLabel))
|
|
||||||
+ fDivider + 30;
|
|
||||||
if (*_width < Bounds().Width())
|
|
||||||
*_width = Bounds().Width();
|
|
||||||
}
|
|
||||||
|
|
||||||
*_height = fHintingMenuField->Frame().bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AntialiasingSettingsView::SetDivider(float divider)
|
|
||||||
{
|
|
||||||
fAntialiasingMenuField -> SetDivider(divider);
|
|
||||||
fHintingMenuField -> SetDivider(divider);
|
|
||||||
fAverageWeightControl -> SetDivider(divider);
|
|
||||||
fDivider = divider;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
AntialiasingSettingsView::RelayoutIfNeeded()
|
|
||||||
{
|
|
||||||
float width, height;
|
|
||||||
GetPreferredSize(&width, &height);
|
|
||||||
|
|
||||||
if (width > Bounds().Width() || height > Bounds().Height()) {
|
|
||||||
ResizeTo(width, height);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -169,9 +166,10 @@ AntialiasingSettingsView::AttachedToWindow()
|
|||||||
SetViewColor(Parent()->ViewColor());
|
SetViewColor(Parent()->ViewColor());
|
||||||
else
|
else
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
fAntialiasingMenu -> SetTargetForItems(this);
|
|
||||||
fHintingMenu -> SetTargetForItems(this);
|
fAntialiasingMenu->SetTargetForItems(this);
|
||||||
fAverageWeightControl -> SetTarget(this);
|
fHintingMenu->SetTargetForItems(this);
|
||||||
|
fAverageWeightControl->SetTarget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -186,10 +184,10 @@ AntialiasingSettingsView::MessageReceived(BMessage *msg)
|
|||||||
|| subpixelAntialiasing == fCurrentSubpixelAntialiasing)
|
|| subpixelAntialiasing == fCurrentSubpixelAntialiasing)
|
||||||
break;
|
break;
|
||||||
fCurrentSubpixelAntialiasing = subpixelAntialiasing;
|
fCurrentSubpixelAntialiasing = subpixelAntialiasing;
|
||||||
fAverageWeightControl -> SetEnabled(fCurrentSubpixelAntialiasing);
|
fAverageWeightControl->SetEnabled(fCurrentSubpixelAntialiasing);
|
||||||
#ifdef INSTANT_UPDATE
|
|
||||||
set_subpixel_antialiasing(fCurrentSubpixelAntialiasing);
|
set_subpixel_antialiasing(fCurrentSubpixelAntialiasing);
|
||||||
#endif
|
|
||||||
Window()->PostMessage(kMsgUpdate);
|
Window()->PostMessage(kMsgUpdate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -200,32 +198,22 @@ AntialiasingSettingsView::MessageReceived(BMessage *msg)
|
|||||||
|| hinting == fCurrentHinting)
|
|| hinting == fCurrentHinting)
|
||||||
break;
|
break;
|
||||||
fCurrentHinting = hinting;
|
fCurrentHinting = hinting;
|
||||||
#ifdef INSTANT_UPDATE
|
|
||||||
set_hinting(fCurrentHinting);
|
set_hinting(fCurrentHinting);
|
||||||
#endif
|
|
||||||
Window()->PostMessage(kMsgUpdate);
|
Window()->PostMessage(kMsgUpdate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kMsgSetAverageWeight:
|
case kMsgSetAverageWeight:
|
||||||
{
|
{
|
||||||
int subpixelWeight;
|
int32 averageWeight = fAverageWeightControl->Value();
|
||||||
unsigned char averageWeight;
|
if (averageWeight == fCurrentAverageWeight)
|
||||||
if (fAverageWeightControl -> Text() != NULL) {
|
break;
|
||||||
subpixelWeight = atoi(fAverageWeightControl -> Text());
|
|
||||||
if (subpixelWeight > 255) {
|
|
||||||
subpixelWeight = 255;
|
|
||||||
BString subpixelWeightString;
|
|
||||||
subpixelWeightString << subpixelWeight;
|
|
||||||
fAverageWeightControl -> SetText(
|
|
||||||
subpixelWeightString.String());
|
|
||||||
}
|
|
||||||
averageWeight = 255 - subpixelWeight;
|
|
||||||
if (averageWeight == fCurrentAverageWeight) break;
|
|
||||||
} else break;
|
|
||||||
fCurrentAverageWeight = averageWeight;
|
fCurrentAverageWeight = averageWeight;
|
||||||
#ifdef INSTANT_UPDATE
|
|
||||||
set_average_weight(fCurrentAverageWeight);
|
set_average_weight(fCurrentAverageWeight);
|
||||||
#endif
|
|
||||||
Window()->PostMessage(kMsgUpdate);
|
Window()->PostMessage(kMsgUpdate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -238,6 +226,8 @@ AntialiasingSettingsView::MessageReceived(BMessage *msg)
|
|||||||
void
|
void
|
||||||
AntialiasingSettingsView::_BuildAntialiasingMenu()
|
AntialiasingSettingsView::_BuildAntialiasingMenu()
|
||||||
{
|
{
|
||||||
|
fAntialiasingMenu = new BPopUpMenu("Antialiasing menu");
|
||||||
|
|
||||||
BMessage* message = new BMessage(kMsgSetAntialiasing);
|
BMessage* message = new BMessage(kMsgSetAntialiasing);
|
||||||
message->AddBool("antialiasing", false);
|
message->AddBool("antialiasing", false);
|
||||||
|
|
||||||
@@ -245,18 +235,20 @@ AntialiasingSettingsView::_BuildAntialiasingMenu()
|
|||||||
|
|
||||||
fAntialiasingMenu->AddItem(item);
|
fAntialiasingMenu->AddItem(item);
|
||||||
|
|
||||||
BMessage* message2 = new BMessage(kMsgSetAntialiasing);
|
message = new BMessage(kMsgSetAntialiasing);
|
||||||
message2->AddBool("antialiasing", true);
|
message->AddBool("antialiasing", true);
|
||||||
|
|
||||||
BMenuItem* item2 = new BMenuItem(kSubpixelLabel, message2);
|
item = new BMenuItem(kSubpixelLabel, message);
|
||||||
|
|
||||||
fAntialiasingMenu->AddItem(item2);
|
fAntialiasingMenu->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AntialiasingSettingsView::_BuildHintingMenu()
|
AntialiasingSettingsView::_BuildHintingMenu()
|
||||||
{
|
{
|
||||||
|
fHintingMenu = new BPopUpMenu("Hinting menu");
|
||||||
|
|
||||||
BMessage* message = new BMessage(kMsgSetHinting);
|
BMessage* message = new BMessage(kMsgSetHinting);
|
||||||
message->AddBool("hinting", false);
|
message->AddBool("hinting", false);
|
||||||
|
|
||||||
@@ -264,12 +256,12 @@ AntialiasingSettingsView::_BuildHintingMenu()
|
|||||||
|
|
||||||
fHintingMenu->AddItem(item);
|
fHintingMenu->AddItem(item);
|
||||||
|
|
||||||
BMessage* message2 = new BMessage(kMsgSetHinting);
|
message = new BMessage(kMsgSetHinting);
|
||||||
message2->AddBool("hinting", true);
|
message->AddBool("hinting", true);
|
||||||
|
|
||||||
BMenuItem* item2 = new BMenuItem(kFullHintingLabel, message2);
|
item = new BMenuItem(kFullHintingLabel, message);
|
||||||
|
|
||||||
fHintingMenu->AddItem(item2);
|
fHintingMenu->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -280,7 +272,8 @@ AntialiasingSettingsView::_SetCurrentAntialiasing()
|
|||||||
fCurrentSubpixelAntialiasing ? kSubpixelLabel : kGrayscaleLabel);
|
fCurrentSubpixelAntialiasing ? kSubpixelLabel : kGrayscaleLabel);
|
||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
if (fCurrentSubpixelAntialiasing) fAverageWeightControl -> SetEnabled(true);
|
if (fCurrentSubpixelAntialiasing)
|
||||||
|
fAverageWeightControl->SetEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -297,9 +290,7 @@ AntialiasingSettingsView::_SetCurrentHinting()
|
|||||||
void
|
void
|
||||||
AntialiasingSettingsView::_SetCurrentAverageWeight()
|
AntialiasingSettingsView::_SetCurrentAverageWeight()
|
||||||
{
|
{
|
||||||
BString subpixelWeightString;
|
fAverageWeightControl->SetValue(fCurrentAverageWeight);
|
||||||
subpixelWeightString << (255 - fCurrentAverageWeight);
|
|
||||||
fAverageWeightControl -> SetText(subpixelWeightString.String());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -334,11 +325,11 @@ AntialiasingSettingsView::Revert()
|
|||||||
fCurrentSubpixelAntialiasing = fSavedSubpixelAntialiasing;
|
fCurrentSubpixelAntialiasing = fSavedSubpixelAntialiasing;
|
||||||
fCurrentHinting = fSavedHinting;
|
fCurrentHinting = fSavedHinting;
|
||||||
fCurrentAverageWeight = fSavedAverageWeight;
|
fCurrentAverageWeight = fSavedAverageWeight;
|
||||||
#ifdef INSTANT_UPDATE
|
|
||||||
set_subpixel_antialiasing(fCurrentSubpixelAntialiasing);
|
set_subpixel_antialiasing(fCurrentSubpixelAntialiasing);
|
||||||
set_hinting(fCurrentHinting);
|
set_hinting(fCurrentHinting);
|
||||||
set_average_weight(fCurrentAverageWeight);
|
set_average_weight(fCurrentAverageWeight);
|
||||||
#endif
|
|
||||||
_SetCurrentAntialiasing();
|
_SetCurrentAntialiasing();
|
||||||
_SetCurrentHinting();
|
_SetCurrentHinting();
|
||||||
_SetCurrentAverageWeight();
|
_SetCurrentAverageWeight();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
class BBox;
|
class BBox;
|
||||||
class BMenuField;
|
class BMenuField;
|
||||||
class BPopUpMenu;
|
class BPopUpMenu;
|
||||||
class BTextControl;
|
class BSlider;
|
||||||
|
|
||||||
|
|
||||||
class AntialiasingSettingsView : public BView {
|
class AntialiasingSettingsView : public BView {
|
||||||
@@ -20,12 +20,8 @@ public:
|
|||||||
const char* name);
|
const char* name);
|
||||||
virtual ~AntialiasingSettingsView();
|
virtual ~AntialiasingSettingsView();
|
||||||
|
|
||||||
virtual void GetPreferredSize(float *_width, float *_height);
|
|
||||||
virtual void RelayoutIfNeeded();
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void MessageReceived(BMessage *msg);
|
virtual void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
void SetDivider(float divider);
|
|
||||||
|
|
||||||
void SetDefaults();
|
void SetDefaults();
|
||||||
void Revert();
|
void Revert();
|
||||||
@@ -46,7 +42,7 @@ protected:
|
|||||||
BPopUpMenu* fAntialiasingMenu;
|
BPopUpMenu* fAntialiasingMenu;
|
||||||
BMenuField* fHintingMenuField;
|
BMenuField* fHintingMenuField;
|
||||||
BPopUpMenu* fHintingMenu;
|
BPopUpMenu* fHintingMenu;
|
||||||
BTextControl* fAverageWeightControl;
|
BSlider* fAverageWeightControl;
|
||||||
|
|
||||||
bool fSavedSubpixelAntialiasing;
|
bool fSavedSubpixelAntialiasing;
|
||||||
bool fCurrentSubpixelAntialiasing;
|
bool fCurrentSubpixelAntialiasing;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ SubDir HAIKU_TOP src preferences appearance ;
|
|||||||
|
|
||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
UsePrivateHeaders app [ FDirName servers app ] ;
|
UsePrivateHeaders app [ FDirName servers app ] ;
|
||||||
|
UseFreeTypeHeaders ;
|
||||||
|
|
||||||
Preference Appearance :
|
Preference Appearance :
|
||||||
APRMain.cpp
|
APRMain.cpp
|
||||||
|
|||||||
Reference in New Issue
Block a user