From 81213459891a2c1818db6ed9827e5b370ca7232f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 20 Sep 2008 14:25:07 +0000 Subject: [PATCH] * 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 --- src/preferences/appearance/APRMain.cpp | 2 +- .../appearance/AntialiasingSettingsView.cpp | 55 +++++++++---------- 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/src/preferences/appearance/APRMain.cpp b/src/preferences/appearance/APRMain.cpp index 323d559726..4ef3989d6f 100644 --- a/src/preferences/appearance/APRMain.cpp +++ b/src/preferences/appearance/APRMain.cpp @@ -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(); } diff --git a/src/preferences/appearance/AntialiasingSettingsView.cpp b/src/preferences/appearance/AntialiasingSettingsView.cpp index cb347b46a8..4dbe469fee 100644 --- a/src/preferences/appearance/AntialiasingSettingsView.cpp +++ b/src/preferences/appearance/AntialiasingSettingsView.cpp @@ -13,7 +13,6 @@ // for detected the availablility of subpixel anti-aliasing #include -#include #include #include #include @@ -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 }