shell: Fix bug when multiple panels use custom sidebar widget
This is not currently a problem because the feature is only used in the Applications panel, but this fixes the behavior if a custom sidebar is used in more than one panel.
This commit is contained in:
parent
e9cc111854
commit
b804fdb01a
1 changed files with 6 additions and 7 deletions
|
@ -1068,20 +1068,19 @@ void
|
|||
cc_panel_list_add_sidebar_widget (CcPanelList *self,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkWidget *previous;
|
||||
|
||||
g_return_if_fail (CC_IS_PANEL_LIST (self));
|
||||
|
||||
previous = get_widget_from_view (self, CC_PANEL_LIST_WIDGET);
|
||||
if (previous)
|
||||
gtk_container_remove (GTK_CONTAINER (self), previous);
|
||||
|
||||
if (widget)
|
||||
{
|
||||
gtk_stack_add_named (GTK_STACK (self), widget, "custom-widget");
|
||||
switch_to_view (self, CC_PANEL_LIST_WIDGET);
|
||||
}
|
||||
else
|
||||
{
|
||||
widget = get_widget_from_view (self, CC_PANEL_LIST_WIDGET);
|
||||
|
||||
if (widget)
|
||||
gtk_container_remove (GTK_CONTAINER (self), widget);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue