Expand last diff view to fill parent

This commit is contained in:
Jesse van den Kieboom 2015-12-21 11:06:09 +01:00
parent ff7c2bbc79
commit c5ce8ba7a2
2 changed files with 12 additions and 1 deletions

View file

@ -215,6 +215,10 @@ class Gitg.DiffViewFile : Gtk.Grid
}
d_lines = new Gee.HashMap<int, PatchSet.Patch?>();
this.bind_property("vexpand", d_sourceview_hunks, "vexpand", BindingFlags.SYNC_CREATE);
d_sourceview_hunks.draw.connect_after(sourceview_hunks_on_draw);
}
private void update_theme()

View file

@ -410,8 +410,10 @@ public class Gitg.DiffView : Gtk.Grid
d_commit_details.expander_visible = (files.size > 1);
}
foreach (var file in files)
for (var i = 0; i < files.size; i++)
{
var file = files[i];
file.expanded = d_commit_details.expanded;
file.maxlines = maxlines;
@ -421,6 +423,11 @@ public class Gitg.DiffView : Gtk.Grid
this.bind_property("wrap", file, "wrap", BindingFlags.DEFAULT | BindingFlags.SYNC_CREATE);
this.bind_property("tab-width", file, "tab-width", BindingFlags.DEFAULT | BindingFlags.SYNC_CREATE);
if (i == files.size - 1)
{
file.vexpand = true;
}
}
}