[meld] gutterrendererchunk: Add hack for drawing chunk actions as button-like
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] gutterrendererchunk: Add hack for drawing chunk actions as button-like
- Date: Sat, 15 Oct 2016 22:56:29 +0000 (UTC)
commit bcaa21ffd2e235dd10f3c4e91753cac63dc3efee
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Sep 25 08:55:48 2016 +1000
gutterrendererchunk: Add hack for drawing chunk actions as button-like
meld/gutterrendererchunk.py | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index d9f2dbc..5df8da3 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -226,6 +226,25 @@ class GutterRendererChunkAction(
self.views_editable = [v.get_editable() for v in self.views]
def do_draw(self, context, background_area, cell_area, start, end, state):
+ if self.is_action:
+ stylecontext = self.props.view.get_style_context()
+ stylecontext.save()
+ stylecontext.set_state(renderer_to_gtk_state(state))
+ stylecontext.add_class(Gtk.STYLE_CLASS_BUTTON)
+ stylecontext.add_class(Gtk.STYLE_CLASS_FLAT)
+
+ button_area = background_area.copy()
+ button_area.x += 1
+ button_area.width -= 2
+
+ Gtk.render_background(
+ stylecontext, context, button_area.x, button_area.y,
+ button_area.width, button_area.height)
+ Gtk.render_frame(
+ stylecontext, context, button_area.x, button_area.y,
+ button_area.width, button_area.height)
+ stylecontext.restore()
+
GtkSource.GutterRendererPixbuf.do_draw(
self, context, background_area, cell_area, start, end, state)
self.draw_chunks(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]