diff options
author | Philip Chimento <philip@endlessm.com> | 2014-08-14 17:50:10 -0700 |
---|---|---|
committer | Philip Chimento <philip@endlessm.com> | 2014-08-14 17:50:10 -0700 |
commit | bb8639e049b9df3df9c8a5563fc0b13a7243ba84 (patch) | |
tree | 77b2279d4100b52e2a20d01f0764906e4b69ca00 /overrides/endless_private/topbar_nav_button.js | |
parent | 1aba52ae2af0bea733b4fa0b2fa5e3fa3392d392 (diff) |
Set hand cursor on search box and topbar nav
This changes the mouse pointer to be a 'hand' cursor when hovering over
certain clickable UI elements: the back/forward buttons on the title
bar, and the magnifying glass icon in the search box.
[endlessm/eos-sdk#1483]
Diffstat (limited to 'overrides/endless_private/topbar_nav_button.js')
-rw-r--r-- | overrides/endless_private/topbar_nav_button.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/overrides/endless_private/topbar_nav_button.js b/overrides/endless_private/topbar_nav_button.js index 7af7c07..541b122 100644 --- a/overrides/endless_private/topbar_nav_button.js +++ b/overrides/endless_private/topbar_nav_button.js @@ -1,3 +1,4 @@ +const Gdk = imports.gi.Gdk; const GObject = imports.gi.GObject; const Gtk = imports.gi.Gtk; const Lang = imports.lang; @@ -32,6 +33,16 @@ const TopbarNavButton = new Lang.Class({ [this._back_button, this._forward_button].forEach(function (button) { button.can_focus = false; + button.add_events(Gdk.EventMask.ENTER_NOTIFY_MASK | + Gdk.EventMask.LEAVE_NOTIFY_MASK); + button.connect('enter-notify-event', function (widget) { + let cursor = Gdk.Cursor.new_for_display(Gdk.Display.get_default(), + Gdk.CursorType.HAND1); + widget.window.set_cursor(cursor); + }); + button.connect('leave-notify-event', function (widget) { + widget.window.set_cursor(null); + }); button.get_style_context().add_class(Gtk.STYLE_CLASS_LINKED); }); |