[meld] Highlight currently focused change
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Highlight currently focused change
- Date: Tue, 24 Aug 2010 09:51:12 +0000 (UTC)
commit bb198226199d322521e84c38473132efd746f505
Author: Kai Willadsen <kai willadsen gmail com>
Date: Fri Aug 6 09:06:33 2010 +1000
Highlight currently focused change
Now that we have keyboard actions on the currently selected commit, we
also need to show which change Meld thinks the cursor is in. This patch
indicates the current change by adding a highlight to the linkmap and
textview fills.
Note that ideally we shouldn't queue_draw everything when the focused
chunk changes.
meld/filediff.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index d609685..e657dd4 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -308,6 +308,8 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
self.actiongroup.get_action("PullLeft").set_sensitive(pull_left)
self.actiongroup.get_action("PullRight").set_sensitive(pull_right)
self.actiongroup.get_action("Delete").set_sensitive(delete)
+ # FIXME: don't queue_draw() on everything... just on what changed
+ self.queue_draw()
def push_change(self, direction):
src = self._get_focused_pane()
@@ -949,6 +951,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
if change[1] != change[2]:
context.set_source_rgb(*self.fill_colors[change[0]])
context.fill_preserve()
+ if self.linediffer.locate_chunk(pane, change[1])[0] == self.cursor.chunk:
+ context.set_source_rgba(1.0, 1.0, 1.0, 0.5)
+ context.fill_preserve()
+
context.set_source_rgb(*self.line_colors[change[0]])
context.stroke()
@@ -1324,6 +1330,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
context.set_source_rgb(*self.fill_colors[c[0]])
context.fill_preserve()
+ if self.linediffer.locate_chunk(which, c[1])[0] == self.cursor.chunk:
+ context.set_source_rgba(1.0, 1.0, 1.0, 0.5)
+ context.fill_preserve()
+
context.set_source_rgb(*self.line_colors[c[0]])
context.stroke()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]