From 7f277d7dee067ca12b021e52a3825cf49b02f544 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 14 Aug 2002 11:08:01 +0000 Subject: [PATCH] Set background colour when hiding/showing. git-svn-id: http://dom-editor.googlecode.com/svn/branches/Gtk2@406 ef21e15d-ca94-4315-9c45-0d95b1b2e117 --- Dome/Display.py | 3 +++ Dome/List.py | 17 ++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Dome/Display.py b/Dome/Display.py index 2c1c683..12a729c 100644 --- a/Dome/Display.py +++ b/Dome/Display.py @@ -59,14 +59,17 @@ class Display(canvas.Canvas): def size_allocate(self, canvas, size): x, y, width, height = self.get_allocation() + chains = self.parent_window.list.chains if self.visible: if width < 40: self.visible = 0 + chains.set_active(0) print "hide" else: if width > 40: self.visible = 1 self.update_all() + chains.set_active(1) print "show" def set_view(self, view): diff --git a/Dome/List.py b/Dome/List.py index 845e3c0..eb9b444 100644 --- a/Dome/List.py +++ b/Dome/List.py @@ -332,12 +332,7 @@ class ChainDisplay(canvas.Canvas): self.exec_point = None # CanvasItem, or None self.rec_point = None - s = self.get_style().copy() - if mono: - s.bg[g.STATE_NORMAL] = g.gdk.color_parse('white') - else: - s.bg[g.STATE_NORMAL] = g.gdk.color_parse('light green') - self.set_style(s) + self.set_active(1) self.nodes = None self.subs = None @@ -349,6 +344,14 @@ class ChainDisplay(canvas.Canvas): self.switch_to(prog) + def set_active(self, active): + if active: + self.modify_bg(g.STATE_NORMAL, g.gdk.color_parse('#F7F7F7')) + elif mono: + self.modify_bg(g.STATE_NORMAL, g.gdk.color_parse('white')) + else: + self.modify_bg(g.STATE_NORMAL, g.gdk.color_parse('#FFC0C0')) + def update_points(self): self.put_point('rec_point') self.put_point('exec_point') @@ -698,7 +701,7 @@ class ChainDisplay(canvas.Canvas): self.drag_last_pos = None self.program_changed(None) elif event.type == g.gdk.ENTER_NOTIFY: - item.set(fill_color = 'white') + item.set(fill_color = '#339900') elif event.type == g.gdk.LEAVE_NOTIFY: item.set(fill_color = self.op_colour(op)) elif event.type == g.gdk.MOTION_NOTIFY and self.drag_last_pos: -- 2.11.4.GIT