[meld] gutterrendererchunk: Fix current chunk highlight colour



commit 7c192e68392a8afdefaa5f62fbf9fa1d5dade554
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Oct 2 10:08:04 2016 +1000

    gutterrendererchunk: Fix current chunk highlight colour

 meld/gutterrendererchunk.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 5948990..91f6dba 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -63,6 +63,12 @@ class MeldGutterRenderer(object):
         if key == 'style-scheme':
             # meldsettings.style_scheme
             self.fill_colors, self.line_colors = get_common_theme()
+            alpha = self.fill_colors['current-chunk-highlight'].alpha
+            make_highlight = lambda color: Gdk.RGBA(
+                *[alpha + c * (1.0 - alpha) for c in color])
+            self.chunk_highlights = {
+                k: make_highlight(v) for k, v in self.fill_colors.items()
+            }
 
     def draw_chunks(
             self, context, background_area, cell_area, start, end, state):
@@ -104,7 +110,7 @@ class MeldGutterRenderer(object):
             if chunk[1] == chunk[2]:
                 background_rgba = get_background_rgba(self)
             elif self.props.view.current_chunk_check(chunk):
-                background_rgba = self.fill_colors['current-chunk-highlight']
+                background_rgba = self.chunk_highlights[chunk[0]]
             else:
                 background_rgba = self.fill_colors[chunk[0]]
         else:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]