Set normal cursor on diff with handles_selection

This commit is contained in:
Jesse van den Kieboom 2015-12-17 23:42:46 +01:00
parent 2e580e7857
commit 65e3fd2e1c

View file

@ -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();