Skip to content

Commit 538f811

Browse files
Louis des Landeskaiw
authored andcommitted
Allow customization of current chunk highlight colour (bgo#701574)
1 parent e79f561 commit 538f811

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

data/gtkrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ style "meld-color-scheme"
2929
color["current-line-highlight"] = "#ffff00"
3030

3131
color["syncpoint-outline"] = "#555555"
32+
33+
color["current-chunk-highlight"] = "#ffffff"
3234
}
3335
widget "meldapp.*" style : lowest "meld-color-scheme"
3436

meld/filediff.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ def on_style_set(self, widget, prev_style):
352352
self.fill_colors = {"insert" : lookup("insert-bg", "DarkSeaGreen1"),
353353
"delete" : lookup("insert-bg", "DarkSeaGreen1"),
354354
"conflict": lookup("conflict-bg", "Pink"),
355-
"replace" : lookup("replace-bg", "#ddeeff")}
355+
"replace" : lookup("replace-bg", "#ddeeff"),
356+
"current-chunk-highlight":
357+
lookup("current-chunk-highlight", '#ffffff')}
356358
self.line_colors = {"insert" : lookup("insert-outline", "#77f077"),
357359
"delete" : lookup("insert-outline", "#77f077"),
358360
"conflict": lookup("conflict-outline", "#f0768b"),
@@ -1433,7 +1435,9 @@ def on_textview_expose_event(self, textview, event):
14331435
context.set_source_color(self.fill_colors[change[0]])
14341436
context.fill_preserve()
14351437
if self.linediffer.locate_chunk(pane, change[1])[0] == self.cursor.chunk:
1436-
context.set_source_rgba(1.0, 1.0, 1.0, 0.5)
1438+
h = self.fill_colors['current-chunk-highlight']
1439+
context.set_source_rgba(
1440+
h.red_float, h.green_float, h.blue_float, 0.5)
14371441
context.fill_preserve()
14381442

14391443
context.set_source_color(self.line_colors[change[0]])

meld/linkmap.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ def do_expose_event(self, event):
222222

223223
chunk_idx = self.filediff.linediffer.locate_chunk(left, c[1])[0]
224224
if chunk_idx == self.filediff.cursor.chunk:
225-
context.set_source_rgba(1.0, 1.0, 1.0, 0.5)
225+
h = self.fill_colors['current-chunk-highlight']
226+
context.set_source_rgba(
227+
h.red_float, h.green_float, h.blue_float, 0.5)
226228
context.fill_preserve()
227229

228230
context.set_source_color(self.line_colors[c[0]])

0 commit comments

Comments
 (0)