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

Unified Diff: ui/views/controls/link.h

Issue 11143024: Add ability to underline links on hover in Views (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge master Created 8 years, 2 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
« no previous file with comments | « chrome/browser/ui/views/web_intent_picker_views.cc ('k') | ui/views/controls/link.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/link.h
diff --git a/ui/views/controls/link.h b/ui/views/controls/link.h
index 5fcce6feada23132279a43f5955d438014966657..9e8631e76448bc4f1c9c1c1c78227c62d2b688cd 100644
--- a/ui/views/controls/link.h
+++ b/ui/views/controls/link.h
@@ -39,6 +39,9 @@ class VIEWS_EXPORT Link : public Label {
virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
virtual void OnMouseCaptureLost() OVERRIDE;
+ virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
+
virtual ui::EventResult OnGestureEvent(
const ui::GestureEvent& event) OVERRIDE;
virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
@@ -51,6 +54,7 @@ class VIEWS_EXPORT Link : public Label {
virtual void SetEnabledColor(SkColor color) OVERRIDE;
void SetPressedColor(SkColor color);
+ void SetUnderlineOnHover(bool underline_on_hover);
static const char kViewClassName[];
@@ -66,6 +70,12 @@ class VIEWS_EXPORT Link : public Label {
// Whether the link is currently pressed.
bool pressed_;
+ // Whether the link is underlined only on hover.
+ bool underline_on_hover_;
+
+ // Whether the mouse is hovering over the link.
+ bool mouse_inside_;
+
// The color when the link is neither pressed nor disabled.
SkColor requested_enabled_color_;
« no previous file with comments | « chrome/browser/ui/views/web_intent_picker_views.cc ('k') | ui/views/controls/link.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698