[baobab/wip/valacharts] Ringschart: clear subfolder tips on zoom



commit 3aab11fedd381b7283ebb3598a42233d448ebf53
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Tue Jun 11 16:31:53 2013 +0200

    Ringschart: clear subfolder tips on zoom

 src/baobab-ringschart.vala |   45 +++++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 21 deletions(-)
---
diff --git a/src/baobab-ringschart.vala b/src/baobab-ringschart.vala
index 8b339f4..d481d1d 100644
--- a/src/baobab-ringschart.vala
+++ b/src/baobab-ringschart.vala
@@ -23,30 +23,33 @@ namespace Baobab {
         bool drawing_subtips = false;
         List<ChartItem> subtip_items;
 
-        construct {
-            subtip_timeout = Gtk.Settings.get_default ().gtk_tooltip_timeout * 2;
+        void subtips_update () {
+            if (drawing_subtips) {
+                queue_draw ();
+            }
+            drawing_subtips = false;
 
-            notify["highlighted-item"].connect (() => {
-                    if (drawing_subtips) {
-                        queue_draw ();
-                    }
-                    drawing_subtips = false;
+            if (tips_timeout_id != 0) {
+                Source.remove (tips_timeout_id);
+                tips_timeout_id = 0;
+            }
 
-                    if (tips_timeout_id != 0) {
-                        Source.remove (tips_timeout_id);
-                        tips_timeout_id = 0;
-                    }
+            subtip_items = null;
 
-                    subtip_items = null;
+            if (highlighted_item != null) {
+                tips_timeout_id = Timeout.add (subtip_timeout, () => {
+                        drawing_subtips = true;
+                        queue_draw ();
+                        return false;
+                    });
+            }
+        }
 
-                    if (highlighted_item != null) {
-                        tips_timeout_id = Timeout.add (subtip_timeout, () => {
-                            drawing_subtips = true;
-                            queue_draw ();
-                            return false;
-                        });
-                    }
-                });
+        construct {
+            subtip_timeout = Gtk.Settings.get_default ().gtk_tooltip_timeout * 2;
+
+            notify["max-depth"].connect (subtips_update);
+            notify["highlighted-item"].connect (subtips_update);
         }
 
         protected override ChartItem create_new_chartitem () {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]