[libpanel] frame: restore visible child in case it changes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpanel] frame: restore visible child in case it changes
- Date: Sat, 17 Sep 2022 05:05:11 +0000 (UTC)
commit 7b49990e20b256dfc58309f933db43c861e567b5
Author: Christian Hergert <chergert redhat com>
Date: Fri Sep 16 22:05:05 2022 -0700
frame: restore visible child in case it changes
src/panel-frame.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/src/panel-frame.c b/src/panel-frame.c
index 9e60b6a..eac48b2 100644
--- a/src/panel-frame.c
+++ b/src/panel-frame.c
@@ -960,6 +960,7 @@ panel_frame_remove (PanelFrame *self,
PanelWidget *panel)
{
PanelFramePrivate *priv = panel_frame_get_instance_private (self);
+ PanelWidget *old_visible_child;
GtkWidget *dock_child;
GtkWidget *grid;
AdwTabPage *page;
@@ -967,6 +968,11 @@ panel_frame_remove (PanelFrame *self,
g_return_if_fail (PANEL_IS_FRAME (self));
g_return_if_fail (PANEL_IS_WIDGET (panel));
+ old_visible_child = panel_frame_get_visible_child (self);
+
+ if (old_visible_child == panel)
+ old_visible_child = NULL;
+
page = adw_tab_view_get_page (priv->tab_view, GTK_WIDGET (panel));
adw_tab_view_close_page (priv->tab_view, page);
@@ -981,6 +987,9 @@ panel_frame_remove (PanelFrame *self,
}
}
+ if (old_visible_child != NULL)
+ panel_frame_set_visible_child (self, old_visible_child);
+
if ((grid = gtk_widget_get_ancestor (GTK_WIDGET (self), PANEL_TYPE_GRID)))
_panel_grid_update_closeable (PANEL_GRID (grid));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]