[sysprof] visualizers: clear selected row when showing details



commit 460df56fa5e8571e5d4e2ef40325507d0db6aeb6
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 23 12:36:04 2020 -0800

    visualizers: clear selected row when showing details
    
    The details don't correspond to any selected row, so clear the row when
    we switch to the details page.

 src/libsysprof-ui/sysprof-display.c            | 4 ++++
 src/libsysprof-ui/sysprof-visualizers-frame.c  | 8 ++++++++
 src/libsysprof-ui/sysprof-visualizers-frame.h  | 1 +
 src/libsysprof-ui/sysprof-visualizers-frame.ui | 2 +-
 4 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/src/libsysprof-ui/sysprof-display.c b/src/libsysprof-ui/sysprof-display.c
index 463364c..0fe44af 100644
--- a/src/libsysprof-ui/sysprof-display.c
+++ b/src/libsysprof-ui/sysprof-display.c
@@ -327,7 +327,11 @@ change_page_cb (GSimpleAction *action,
   if (g_variant_is_of_type (param, G_VARIANT_TYPE_STRING))
     {
       const gchar *str = g_variant_get_string (param, NULL);
+
       gtk_stack_set_visible_child_name (priv->pages, str);
+
+      if (g_str_equal (str, "details"))
+        sysprof_visualizers_frame_unselect_row (priv->visualizers);
     }
 }
 
diff --git a/src/libsysprof-ui/sysprof-visualizers-frame.c b/src/libsysprof-ui/sysprof-visualizers-frame.c
index d2baf7e..95b990c 100644
--- a/src/libsysprof-ui/sysprof-visualizers-frame.c
+++ b/src/libsysprof-ui/sysprof-visualizers-frame.c
@@ -747,3 +747,11 @@ sysprof_visualizers_frame_get_hadjustment (SysprofVisualizersFrame *self)
 
   return gtk_range_get_adjustment (GTK_RANGE (self->hscrollbar));
 }
+
+void
+sysprof_visualizers_frame_unselect_row (SysprofVisualizersFrame *self)
+{
+  g_return_if_fail (SYSPROF_IS_VISUALIZERS_FRAME (self));
+
+  gtk_list_box_unselect_all (self->groups);
+}
diff --git a/src/libsysprof-ui/sysprof-visualizers-frame.h b/src/libsysprof-ui/sysprof-visualizers-frame.h
index d0501ce..103953f 100644
--- a/src/libsysprof-ui/sysprof-visualizers-frame.h
+++ b/src/libsysprof-ui/sysprof-visualizers-frame.h
@@ -45,5 +45,6 @@ gboolean                sysprof_visualizers_frame_load_finish        (SysprofVis
                                                                       GError                  **error);
 GtkSizeGroup           *sysprof_visualizers_frame_get_size_group     (SysprofVisualizersFrame  *self);
 GtkAdjustment          *sysprof_visualizers_frame_get_hadjustment    (SysprofVisualizersFrame  *self);
+void                    sysprof_visualizers_frame_unselect_row       (SysprofVisualizersFrame  *self);
 
 G_END_DECLS
diff --git a/src/libsysprof-ui/sysprof-visualizers-frame.ui b/src/libsysprof-ui/sysprof-visualizers-frame.ui
index 60c5940..f1d5777 100644
--- a/src/libsysprof-ui/sysprof-visualizers-frame.ui
+++ b/src/libsysprof-ui/sysprof-visualizers-frame.ui
@@ -193,7 +193,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="hexpand">False</property>
-                        <property name="selection_mode">browse</property>
+                        <property name="selection_mode">single</property>
                         <style>
                           <class name="left-column"/>
                           <class name="visualizer-groups"/>


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