Commit 2745d3ce authored by Philipp Hörist's avatar Philipp Hörist
parent c51e8498
......@@ -667,11 +667,11 @@ class ChatControl(ChatControlBase):
"""
Just moved the mouse so show the cursor
"""
cursor = get_cursor('LEFT_PTR')
cursor = get_cursor('default')
self.parent_win.window.get_window().set_cursor(cursor)
def on_location_eventbox_enter_notify_event(self, widget, event):
cursor = get_cursor('HAND2')
cursor = get_cursor('pointer')
self.parent_win.window.get_window().set_cursor(cursor)
def update_ui(self):
......
......@@ -332,11 +332,11 @@ class ConversationTextview(GObject.GObject):
if len(text) > 50:
text = text[:47] + '…'
tooltip.set_text(text)
window.set_cursor(get_cursor('HAND2'))
window.set_cursor(get_cursor('pointer'))
self._cursor_changed = True
return True
if tag_name in ('url', 'mail', 'xmpp', 'sth_at_sth'):
window.set_cursor(get_cursor('HAND2'))
window.set_cursor(get_cursor('pointer'))
self._cursor_changed = True
return False
try:
......@@ -346,7 +346,7 @@ class ConversationTextview(GObject.GObject):
except KeyError:
pass
if self._cursor_changed:
window.set_cursor(get_cursor('XTERM'))
window.set_cursor(get_cursor('text'))
self._cursor_changed = False
return False
......
......@@ -881,18 +881,18 @@ class HtmlTextView(Gtk.TextView):
if len(text) > 50:
text = text[:47] + '…'
tooltip.set_text(text)
window.set_cursor(get_cursor('HAND2'))
window.set_cursor(get_cursor('pointer'))
self._cursor_changed = True
return True
tag_name = tag.get_property('name')
if tag_name in ('url', 'mail', 'xmpp', 'sth_at_sth'):
window.set_cursor(get_cursor('HAND2'))
window.set_cursor(get_cursor('pointer'))
self._cursor_changed = True
return False
if self._cursor_changed:
window.set_cursor(get_cursor('XTERM'))
window.set_cursor(get_cursor('text'))
self._cursor_changed = False
return False
......
......@@ -356,10 +356,12 @@ def get_completion_liststore(entry: Gtk.Entry) -> Gtk.ListStore:
return liststore
def get_cursor(attr: str) -> Gdk.Cursor:
def get_cursor(name: str) -> Gdk.Cursor:
display = Gdk.Display.get_default()
cursor = getattr(Gdk.CursorType, attr)
return Gdk.Cursor.new_for_display(display, cursor)
cursor = Gdk.Cursor.new_from_name(display, name)
if cursor is not None:
return cursor
return Gdk.Cursor.new_from_name(display, 'default')
def scroll_to_end(widget: Gtk.ScrolledWindow) -> bool:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment