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

Side by Side Diff: views/controls/link.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/label_unittest.cc ('k') | views/controls/listbox/native_listbox_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/controls/link.h" 5 #include "views/controls/link.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gdk/gdk.h> 8 #include <gdk/gdk.h>
9 #endif 9 #endif
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 void Link::SetHighlighted(bool f) { 204 void Link::SetHighlighted(bool f) {
205 if (f != highlighted_) { 205 if (f != highlighted_) {
206 highlighted_ = f; 206 highlighted_ = f;
207 ValidateStyle(); 207 ValidateStyle();
208 SchedulePaint(); 208 SchedulePaint();
209 } 209 }
210 } 210 }
211 211
212 void Link::ValidateStyle() { 212 void Link::ValidateStyle() {
213 if (enabled_) { 213 if (enabled_) {
214 if (!(font().style() & gfx::Font::UNDERLINED)) { 214 if (!(font().GetStyle() & gfx::Font::UNDERLINED)) {
215 Label::SetFont( 215 Label::SetFont(
216 font().DeriveFont(0, font().style() | gfx::Font::UNDERLINED)); 216 font().DeriveFont(0, font().GetStyle() | gfx::Font::UNDERLINED));
217 } 217 }
218 Label::SetColor(highlighted_ ? highlighted_color_ : normal_color_); 218 Label::SetColor(highlighted_ ? highlighted_color_ : normal_color_);
219 } else { 219 } else {
220 if (font().style() & gfx::Font::UNDERLINED) { 220 if (font().GetStyle() & gfx::Font::UNDERLINED) {
221 Label::SetFont( 221 Label::SetFont(
222 font().DeriveFont(0, font().style() & ~gfx::Font::UNDERLINED)); 222 font().DeriveFont(0, font().GetStyle() & ~gfx::Font::UNDERLINED));
223 } 223 }
224 Label::SetColor(disabled_color_); 224 Label::SetColor(disabled_color_);
225 } 225 }
226 } 226 }
227 227
228 } // namespace views 228 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/label_unittest.cc ('k') | views/controls/listbox/native_listbox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698