[meld] gutterrendererchunk: Use renderer backgrounds for chunks as well
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] gutterrendererchunk: Use renderer backgrounds for chunks as well
- Date: Sun, 2 Oct 2016 00:12:55 +0000 (UTC)
commit ab2484f1ce4b73150a7642177396b2bd031e6289
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Oct 1 10:09:56 2016 +1000
gutterrendererchunk: Use renderer backgrounds for chunks as well
This currently breaks the background rendering for the line-number
gutter, but that's easily fixable.
meld/gutterrendererchunk.py | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index ccb2081..e84b36f 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -61,14 +61,11 @@ class MeldGutterRenderer(object):
width = background_area.width + 2
height = 1 if chunk[1] == chunk[2] else background_area.height
- context.rectangle(x, y, width, height)
- context.set_source_rgba(*self.fill_colors[chunk[0]])
-
if self.props.view.current_chunk_check(chunk):
- context.fill_preserve()
highlight = self.fill_colors['current-chunk-highlight']
+ context.rectangle(x, y, width, height)
context.set_source_rgba(*highlight)
- context.fill()
+ context.fill()
if line == chunk[1] or line == chunk[2] - 1:
context.set_line_width(1.0)
@@ -165,10 +162,10 @@ class GutterRendererChunkAction(
return copy_menu
def do_draw(self, context, background_area, cell_area, start, end, state):
+ GtkSource.GutterRendererPixbuf.do_draw(
+ self, context, background_area, cell_area, start, end, state)
self.draw_chunks(
context, background_area, cell_area, start, end, state)
- return GtkSource.GutterRendererPixbuf.do_draw(
- self, context, background_area, cell_area, start, end, state)
def do_query_activatable(self, start, area, event):
line = start.get_line()
@@ -191,7 +188,8 @@ class GutterRendererChunkAction(
if chunk and chunk[1] == line:
action = self._classify_change_actions(chunk)
pixbuf = self.action_map.get(action)
- self.set_background(None)
+ self.set_background(self.fill_colors[chunk[0]])
+
else:
# TODO: Remove when fixed in upstream GTK+
stylecontext = self.props.view.get_style_context()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]