[baobab/issue_14_pie_chart_gone_further_cleanup: 4/5] Do not return from highlight_item_at_point.




commit 47ce554d186e80c9adc282922985b6831181b305
Author: Eduard Nicodei <eddnicodei gmail com>
Date:   Sat Jan 9 16:48:59 2021 +0000

    Do not return from highlight_item_at_point.

 data/ui/baobab-main-window.ui | 2 ++
 src/baobab-chart.vala         | 6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/data/ui/baobab-main-window.ui b/data/ui/baobab-main-window.ui
index 62b705f..978ee5a 100644
--- a/data/ui/baobab-main-window.ui
+++ b/data/ui/baobab-main-window.ui
@@ -364,6 +364,7 @@
                                   <property name="visible">True</property>
                                   <property name="hexpand">True</property>
                                   <property name="vexpand">True</property>
+                                  <property name="has_tooltip">True</property>
                                 </object>
                                 <packing>
                                   <property name="name">rings</property>
@@ -376,6 +377,7 @@
                                   <property name="visible">True</property>
                                   <property name="hexpand">True</property>
                                   <property name="vexpand">True</property>
+                                  <property name="has_tooltip">True</property>
                                 </object>
                                 <packing>
                                   <property name="name">treemap</property>
diff --git a/src/baobab-chart.vala b/src/baobab-chart.vala
index 2e53174..8ba1d18 100644
--- a/src/baobab-chart.vala
+++ b/src/baobab-chart.vala
@@ -218,21 +218,19 @@ namespace Baobab {
             }
         }
 
-        bool highlight_item_at_point (double x, double y) {
+        void highlight_item_at_point (double x, double y) {
             for (unowned List<ChartItem> node = items.last (); node != null; node = node.prev) {
                 var item = node.data;
                 if (item.visible && is_point_over_item (item, x, y)) {
                     highlighted_item = item;
-                    return true;
                 }
             }
 
             highlighted_item = null;
-            return false;
         }
 
         public override bool motion_notify_event (Gdk.EventMotion event) {
-            has_tooltip = highlight_item_at_point (event.x, event.y);
+            highlight_item_at_point (event.x, event.y);
 
             Gdk.Event.request_motions (event);
 


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