* Don't disable the controls completely if subpixel anti-aliasing is not

available for hinted font rendering. Instead, display the information that
  only this combination has no effect on Haiku builds without subpixel based
  freetype rendering. Better fix for 2753.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27653 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-09-20 14:25:07 +00:00
parent 60497da7e0
commit 8121345989
2 changed files with 26 additions and 31 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
APRApplication::APRApplication(void)
: BApplication(APPEARANCE_APP_SIGNATURE)
{
fWindow = new APRWindow(BRect(100,100,540,390));
fWindow = new APRWindow(BRect(100, 100, 550, 420));
fWindow->Show();
}
@@ -13,7 +13,6 @@
// for detected the availablility of subpixel anti-aliasing
#include <Box.h>
#include <CardLayout.h>
#include <GridLayoutBuilder.h>
#include <GroupLayoutBuilder.h>
#include <MenuField.h>
@@ -88,55 +87,57 @@ AntialiasingSettingsView::AntialiasingSettingsView(BRect rect, const char* name)
// hinting menu
_BuildHintingMenu();
fHintingMenuField = new BMenuField("hinting", "Character hinting:",
fHintingMenuField = new BMenuField("hinting", "Glyph hinting:",
fHintingMenu, NULL);
#ifdef DISABLE_HINTING_CONTROL
fHintingMenuField->SetEnabled(false);
#endif
#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
// subpixelAntialiasingDisabledLabel
BFont infoFont(*be_plain_font);
infoFont.SetFace(B_ITALIC_FACE);
rgb_color infoColor = tint_color(ui_color(B_PANEL_BACKGROUND_COLOR),
B_DARKEN_4_TINT);
// TODO: Replace with layout friendly constructor once available.
BRect textBounds = rect.InsetByCopy(10, 10).OffsetToSelf(B_ORIGIN);
BTextView* subpixelAntialiasingDisabledLabel = new BTextView(
rect.OffsetToCopy(B_ORIGIN), "unavailable label",
rect.OffsetToCopy(B_ORIGIN).InsetBySelf(10, 10),
textBounds, "unavailable label", textBounds, &infoFont, &infoColor,
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.");
"in combination with glyph hinting 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);
#endif // !FT_CONFIG_OPTION_SUBPIXEL_RENDERING
BCardLayout* cardLayout = new BCardLayout();
SetLayout(cardLayout);
SetLayout(new BGroupLayout(B_VERTICAL));
// controls pane
AddChild(BGridLayoutBuilder(10, 10)
.Add(BSpaceLayoutItem::CreateGlue(), 0, 0, 2)
.Add(fHintingMenuField->CreateLabelLayoutItem(), 0, 0)
.Add(fHintingMenuField->CreateMenuBarLayoutItem(), 1, 0)
.Add(fHintingMenuField->CreateLabelLayoutItem(), 0, 1)
.Add(fHintingMenuField->CreateMenuBarLayoutItem(), 1, 1)
.Add(fAntialiasingMenuField->CreateLabelLayoutItem(), 0, 1)
.Add(fAntialiasingMenuField->CreateMenuBarLayoutItem(), 1, 1)
.Add(fAntialiasingMenuField->CreateLabelLayoutItem(), 0, 2)
.Add(fAntialiasingMenuField->CreateMenuBarLayoutItem(), 1, 2)
.Add(fAverageWeightControl, 0, 2, 2)
.Add(fAverageWeightControl, 0, 3, 2)
.Add(BSpaceLayoutItem::CreateGlue(), 0, 4, 2)
#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
// hinting+subpixel unavailable info
.Add(subpixelAntialiasingDisabledLabel, 0, 3, 2)
#else
.Add(BSpaceLayoutItem::CreateGlue(), 0, 3, 2)
#endif
.SetInsets(10, 10, 10, 10)
);
// unavailable info pane
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
.Add(BSpaceLayoutItem::CreateGlue())
.Add(subpixelAntialiasingDisabledLabel)
.Add(BSpaceLayoutItem::CreateGlue())
);
_SetCurrentAntialiasing();
_SetCurrentHinting();
_SetCurrentAverageWeight();
@@ -145,12 +146,6 @@ AntialiasingSettingsView::AntialiasingSettingsView(BRect rect, const char* name)
// layout management.
MoveTo(rect.LeftTop());
ResizeTo(rect.Width(), rect.Height());
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
cardLayout->SetVisibleItem(0L);
#else
cardLayout->SetVisibleItem(1L);
#endif
}