[meld] gutterrendererchunk: Style and typo fixes
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] gutterrendererchunk: Style and typo fixes
- Date: Sat, 18 Nov 2017 22:19:13 +0000 (UTC)
commit ea164869e2c0562814b1c8b065211456473b6d1a
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Nov 17 07:19:27 2017 +1000
gutterrendererchunk: Style and typo fixes
meld/gutterrendererchunk.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 4d64d2f..b0cc37c 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -24,7 +24,7 @@ from meld.conf import _
from meld.const import MODE_REPLACE, MODE_DELETE, MODE_INSERT
from meld.misc import get_common_theme
from meld.settings import meldsettings
-from meld.ui.gtkcompat import draw_style_common, get_style
+from meld.ui.gtkcompat import get_style
# Fixed size of the renderer. Ideally this would be font-dependent and
# would adjust to other textview attributes, but that's both quite difficult
@@ -53,7 +53,7 @@ def get_background_rgba(renderer):
gutters with the actual expected widget background, which causes
them to look wrong when put next to any other widgets. This hack
just gets the background from the renderer's view, and then caches
- in for performance, and on the basis that all renderers will be
+ it for performance, and on the basis that all renderers will be
assigned to similarly-styled views. This is fragile, but the
alternative is really significantly slower.
'''
@@ -64,6 +64,8 @@ def get_background_rgba(renderer):
background_set, _background_rgba = (
stylecontext.lookup_color('theme_bg_color'))
return _background_rgba
+
+
_background_rgba = None
@@ -79,13 +81,11 @@ class MeldGutterRenderer(object):
def on_setting_changed(self, meldsettings, key):
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()
+ state: Gdk.RGBA(*[alpha + c * (1.0 - alpha) for c in colour])
+ for state, colour in self.fill_colors.items()
}
def draw_chunks(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]