Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3877)

Unified Diff: ash/sticky_keys/sticky_keys_overlay.cc

Issue 341713002: Remove Label::PaintText overrides. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a comment typo. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/sticky_keys/sticky_keys_overlay.cc
diff --git a/ash/sticky_keys/sticky_keys_overlay.cc b/ash/sticky_keys/sticky_keys_overlay.cc
index 7720ad68f8e17080979f8a60beccbbda34d16114..2e853da74b220163b9462a8a0fa192d12de21e3e 100644
--- a/ash/sticky_keys/sticky_keys_overlay.cc
+++ b/ash/sticky_keys/sticky_keys_overlay.cc
@@ -54,12 +54,6 @@ class StickyKeyOverlayLabel : public views::Label {
void SetKeyState(StickyKeyState state);
private:
- // views::Label overrides:
- virtual void PaintText(gfx::Canvas* canvas,
- const base::string16& text,
- const gfx::Rect& text_bounds,
- int flags) OVERRIDE;
-
StickyKeyState state_;
DISALLOW_COPY_AND_ASSIGN(StickyKeyOverlayLabel);
@@ -76,6 +70,8 @@ StickyKeyOverlayLabel::StickyKeyOverlayLabel(const std::string& key_name)
SetFocusable(false);
SetEnabledColor(SkColorSetARGB(0x80, 0xFF, 0xFF, 0xFF));
SetDisabledColor(SkColorSetARGB(0x80, 0xFF, 0xFF, 0xFF));
+ // Use a transparent background color to avoid subpixel rendering.
+ SetBackgroundColor(SK_ColorTRANSPARENT);
}
StickyKeyOverlayLabel::~StickyKeyOverlayLabel() {
@@ -104,19 +100,8 @@ void StickyKeyOverlayLabel::SetKeyState(StickyKeyState state) {
SetFontList(font_list().DeriveWithStyle(style));
}
-void StickyKeyOverlayLabel::PaintText(gfx::Canvas* canvas,
- const base::string16& text,
- const gfx::Rect& text_bounds,
- int flags) {
- views::Label::PaintText(canvas,
- text,
- text_bounds,
- flags | gfx::Canvas::NO_SUBPIXEL_RENDERING);
-}
-
-
///////////////////////////////////////////////////////////////////////////////
-// StickyKeyOverlayLabel
+// StickyKeysOverlayView
class StickyKeysOverlayView : public views::WidgetDelegateView {
public:
StickyKeysOverlayView();

Powered by Google App Engine
This is Rietveld 408576698