Index: ash/accelerators/exit_warning_handler.cc |
diff --git a/ash/accelerators/exit_warning_handler.cc b/ash/accelerators/exit_warning_handler.cc |
index d2dc0f56a6266b6f8f81f03a6c876e9d829570bd..2be12b081f158f7f03ead98967a8a029ef6d6d03 100644 |
--- a/ash/accelerators/exit_warning_handler.cc |
+++ b/ash/accelerators/exit_warning_handler.cc |
@@ -38,27 +38,6 @@ const int kWindowCornerRadius = 2; |
const int kHorizontalMarginAroundText = 100; |
const int kVerticalMarginAroundText = 100; |
-class ExitWarningLabel : public views::Label { |
- public: |
- ExitWarningLabel() {} |
- |
- virtual ~ExitWarningLabel() {} |
- |
- private: |
- virtual void PaintText(gfx::Canvas* canvas, |
- const base::string16& text, |
- const gfx::Rect& text_bounds, |
- int flags) OVERRIDE { |
- // Turn off subpixel rendering. |
- views::Label::PaintText(canvas, |
- text, |
- text_bounds, |
- flags | gfx::Canvas::NO_SUBPIXEL_RENDERING); |
- } |
- |
- DISALLOW_COPY_AND_ASSIGN(ExitWarningLabel); |
-}; |
- |
class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { |
public: |
ExitWarningWidgetDelegateView() : text_width_(0), width_(0), height_(0) { |
@@ -77,13 +56,15 @@ class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { |
text_width_ = gfx::GetStringWidth(text_, font_list); |
width_ = text_width_ + kHorizontalMarginAroundText; |
height_ = font_list.GetHeight() + kVerticalMarginAroundText; |
- views::Label* label = new ExitWarningLabel; |
+ views::Label* label = new views::Label(); |
label->SetText(text_); |
label->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
label->SetFontList(font_list); |
label->SetEnabledColor(kTextColor); |
label->SetDisabledColor(kTextColor); |
label->SetAutoColorReadabilityEnabled(false); |
+ // Use a transparent background color to avoid subpixel rendering. |
+ label->SetBackgroundColor(SK_ColorTRANSPARENT); |
sky
2014/06/18 03:16:29
Having transparent mean no subpixel rendering seem
msw
2014/06/18 04:34:29
AFAIK, there's no way to use subpixel rendering wi
|
AddChildView(label); |
SetLayoutManager(new views::FillLayout); |
} |