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.
This commit is contained in:
Christian Hergert
2020-01-23 12:36:04 -08:00
parent bcfaa6caa8
commit 460df56fa5
4 changed files with 14 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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

View File

@ -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"/>