From 59fbb0d49dc9dcdc9bb76214949ac0ab4332b9c2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 15 Oct 2021 14:16:31 +0100 Subject: gtk4: get toolbar popovers in sidebar working MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7ef95a3207c3a10cd541a529c80ef70d55ea2185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123657 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- vcl/unx/gtk3/gtkinst.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index c648bfee534d..bd84f41b2d1e 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -2236,11 +2236,13 @@ namespace #if !GTK_CHECK_VERSION(4, 0, 0) gtk_container_remove(GTK_CONTAINER(pContainer), pChild); #else - assert(GTK_IS_BOX(pContainer) || GTK_IS_GRID(pContainer)); + assert(GTK_IS_BOX(pContainer) || GTK_IS_GRID(pContainer) || GTK_IS_POPOVER(pContainer)); if (GTK_IS_BOX(pContainer)) gtk_box_remove(GTK_BOX(pContainer), pChild); else if (GTK_IS_GRID(pContainer)) gtk_grid_remove(GTK_GRID(pContainer), pChild); + else if (GTK_IS_POPOVER(pContainer)) + gtk_popover_set_child(GTK_POPOVER(pContainer), nullptr); #endif } @@ -2249,11 +2251,13 @@ namespace #if !GTK_CHECK_VERSION(4, 0, 0) gtk_container_add(GTK_CONTAINER(pContainer), pChild); #else - assert(GTK_IS_BOX(pContainer) || GTK_IS_GRID(pContainer)); + assert(GTK_IS_BOX(pContainer) || GTK_IS_GRID(pContainer) || GTK_IS_POPOVER(pContainer)); if (GTK_IS_BOX(pContainer)) gtk_box_append(GTK_BOX(pContainer), pChild); else if (GTK_IS_GRID(pContainer)) gtk_grid_attach(GTK_GRID(pContainer), pChild, 0, 0, 1, 1); + else if (GTK_IS_POPOVER(pContainer)) + gtk_popover_set_child(GTK_POPOVER(pContainer), pChild); #endif } -- cgit