Only update selection attributes/tag when handle_selection

This commit is contained in:
Jesse van den Kieboom 2015-12-20 13:24:48 +01:00
parent 1c4ea3543e
commit 2d09ac2cf0

View file

@ -194,7 +194,6 @@ class Gitg.DiffViewFile : Gtk.Grid
private void update_theme()
{
var selection_attributes = new Gtk.SourceMarkAttributes();
var header_attributes = new Gtk.SourceMarkAttributes();
var added_attributes = new Gtk.SourceMarkAttributes();
var removed_attributes = new Gtk.SourceMarkAttributes();
@ -214,6 +213,9 @@ class Gitg.DiffViewFile : Gtk.Grid
removed_attributes.background = Gdk.RGBA() { red = 1.0, green = 220.0 / 255.0, blue = 220.0 / 255.0, alpha = 1.0 };
}
if (handle_selection)
{
var selection_attributes = new Gtk.SourceMarkAttributes();
var context = d_sourceview_hunks.get_style_context();
Gdk.RGBA theme_selected_bg_color, theme_selected_fg_color;
@ -229,6 +231,7 @@ class Gitg.DiffViewFile : Gtk.Grid
}
d_sourceview_hunks.set_mark_attributes(d_selection_category, selection_attributes, 0);
}
d_sourceview_hunks.set_mark_attributes("header", header_attributes, 0);
d_sourceview_hunks.set_mark_attributes("added", added_attributes, 0);