mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-09-06 00:35:04 +00:00
Render gutter separators externally to fill all expanded area
This commit is contained in:
parent
c5ce8ba7a2
commit
c415a0982c
|
@ -221,6 +221,34 @@ class Gitg.DiffViewFile : Gtk.Grid
|
|||
d_sourceview_hunks.draw.connect_after(sourceview_hunks_on_draw);
|
||||
}
|
||||
|
||||
private bool sourceview_hunks_on_draw(Cairo.Context cr)
|
||||
{
|
||||
var win = d_sourceview_hunks.get_window(Gtk.TextWindowType.LEFT);
|
||||
|
||||
if (!Gtk.cairo_should_draw_window(cr, win))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var ctx = d_sourceview_hunks.get_style_context();
|
||||
|
||||
var old_lines_width = d_old_lines.size + d_old_lines.xpad * 2;
|
||||
var new_lines_width = d_new_lines.size + d_new_lines.xpad * 2;
|
||||
var sym_lines_width = d_sym_lines.size + d_sym_lines.xpad * 2;
|
||||
|
||||
ctx.save();
|
||||
ctx.add_class("diff-lines-separator");
|
||||
ctx.render_frame(cr, 0, 0, old_lines_width, win.get_height());
|
||||
ctx.restore();
|
||||
|
||||
ctx.save();
|
||||
ctx.add_class("diff-lines-gutter-border");
|
||||
ctx.render_frame(cr, old_lines_width + new_lines_width, 0, sym_lines_width, win.get_height());
|
||||
ctx.restore();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void update_theme()
|
||||
{
|
||||
var header_attributes = new Gtk.SourceMarkAttributes();
|
||||
|
|
|
@ -186,36 +186,6 @@ class Gitg.DiffViewLinesRenderer : Gtk.SourceGutterRendererText
|
|||
d_num_digits_fill = string.nfill(num_digits, ' ');
|
||||
}
|
||||
|
||||
public override void begin(Cairo.Context cr,
|
||||
Gdk.Rectangle background_area,
|
||||
Gdk.Rectangle cell_area,
|
||||
Gtk.TextIter start,
|
||||
Gtk.TextIter end)
|
||||
{
|
||||
base.begin(cr, background_area, cell_area, start, end);
|
||||
|
||||
if (style == Style.OLD || style == Style.SYMBOL)
|
||||
{
|
||||
var ctx = get_view().get_style_context();
|
||||
|
||||
ctx.save();
|
||||
ctx.add_class("diff-lines-border");
|
||||
|
||||
if (style == Style.SYMBOL)
|
||||
{
|
||||
ctx.add_class("symbol");
|
||||
}
|
||||
|
||||
ctx.render_frame(cr,
|
||||
background_area.x,
|
||||
background_area.y,
|
||||
background_area.width,
|
||||
background_area.height);
|
||||
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
|
||||
private string[] precalculate_line_strings(Ggit.DiffHunk hunk, Gee.ArrayList<Ggit.DiffLine> lines)
|
||||
{
|
||||
var oldn = hunk.get_old_start();
|
||||
|
|
|
@ -12,14 +12,11 @@
|
|||
border-top: 1px solid @borders;
|
||||
}
|
||||
|
||||
.diff-lines-border {
|
||||
border-top: 0;
|
||||
border-left: 0;
|
||||
border-bottom: 0;
|
||||
.diff-lines-separator {
|
||||
border-right: 1px solid shade(@theme_bg_color, 0.95);
|
||||
}
|
||||
|
||||
.diff-lines-border.symbol {
|
||||
.diff-lines-gutter-border {
|
||||
border-right: 2px solid shade(@theme_bg_color, 0.95);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue