mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-14 11:52:29 +00:00
Set normal cursor on diff with handles_selection
This commit is contained in:
parent
2e580e7857
commit
65e3fd2e1c
|
@ -131,6 +131,9 @@ class Gitg.DiffViewHunk : Gtk.Grid
|
|||
d_sourceview_hunk.button_release_event.connect(button_release_event_on_view);
|
||||
|
||||
d_sourceview_hunk.get_style_context().add_class("handle-selection");
|
||||
|
||||
d_sourceview_hunk.realize.connect(update_cursor);
|
||||
d_sourceview_hunk.notify["state-flags"].connect(update_cursor);
|
||||
}
|
||||
|
||||
update_hunk_label();
|
||||
|
@ -147,6 +150,17 @@ class Gitg.DiffViewHunk : Gtk.Grid
|
|||
update_theme();
|
||||
}
|
||||
|
||||
private void update_cursor() {
|
||||
var window = d_sourceview_hunk.get_window(Gtk.TextWindowType.TEXT);
|
||||
|
||||
if (window == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var cursor = new Gdk.Cursor.for_display(d_sourceview_hunk.get_display(), Gdk.CursorType.LEFT_PTR);
|
||||
window.set_cursor(cursor);
|
||||
}
|
||||
|
||||
private void update_theme()
|
||||
{
|
||||
var selection_attributes = new Gtk.SourceMarkAttributes();
|
||||
|
|
Loading…
Reference in a new issue