From b56f32b235124f8afa2942cd97ebe2f7d434fef7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 26 May 2021 15:35:46 +0100 Subject: gtk4: reenable Notebook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5342e5ef35f9d270d8ac51c3d696beddc8b67529 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116203 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sfx2/source/dialog/dinfdlg.cxx | 8 +++++++- vcl/unx/gtk3/gtkinst.cxx | 33 ++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 40bd42c63f6e..97d472a89ff8 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1113,7 +1113,13 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog(weld::Window* pParent, const SfxIte // Property Pages AddTabPage("general", SfxDocumentPage::Create, nullptr); AddTabPage("description", SfxDocumentDescPage::Create, nullptr); - AddTabPage("customprops", SfxCustomPropertiesPage::Create, nullptr); + if (Application::GetToolkitName() == "gtk4") + { + SAL_WARN( "sfx.dialog", "temp bootstrapping gtk4 disabled page for menubutton"); + RemoveTabPage("customprops"); + } + else + AddTabPage("customprops", SfxCustomPropertiesPage::Create, nullptr); if (rInfoItem.isCmisDocument()) AddTabPage("cmisprops", SfxCmisPropertiesPage::Create, nullptr); else diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 948e22c044dd..582bb1f91d2a 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -7157,8 +7157,6 @@ public: } -#if !GTK_CHECK_VERSION(4, 0, 0) - namespace { class GtkInstanceNotebook : public GtkInstanceWidget, public virtual weld::Notebook @@ -7902,24 +7900,29 @@ public: #if !GTK_CHECK_VERSION(4, 0, 0) gtk_widget_destroy(GTK_WIDGET(m_pOverFlowNotebook)); #else - g_clear_pointer(&m_pOverFlowNotebook, gtk_widget_unparent); + GtkWidget* pOverFlowWidget = GTK_WIDGET(m_pOverFlowNotebook); + g_clear_pointer(&pOverFlowWidget, gtk_widget_unparent); #endif if (m_pOverFlowBox) { +#if !GTK_CHECK_VERSION(4, 0, 0) // put it back to how we found it initially GtkWidget* pParent = gtk_widget_get_parent(GTK_WIDGET(m_pOverFlowBox)); g_object_ref(m_pNotebook); -#if !GTK_CHECK_VERSION(4, 0, 0) gtk_container_remove(GTK_CONTAINER(m_pOverFlowBox), GTK_WIDGET(m_pNotebook)); gtk_container_add(GTK_CONTAINER(pParent), GTK_WIDGET(m_pNotebook)); -#endif g_object_unref(m_pNotebook); +#endif +#if !GTK_CHECK_VERSION(4, 0, 0) gtk_widget_destroy(GTK_WIDGET(m_pOverFlowBox)); +#else + GtkWidget* pOverFlowBox = GTK_WIDGET(m_pOverFlowBox); + g_clear_pointer(&pOverFlowBox, gtk_widget_unparent); +#endif } } }; -#endif void update_attr_list(PangoAttrList* pAttrList, const vcl::Font& rFont) { @@ -8002,12 +8005,8 @@ void set_font(GtkLabel* pLabel, const vcl::Font& rFont) pango_attr_list_unref(pAttrList); } -#if !GTK_CHECK_VERSION(4, 0, 0) - } -#endif - namespace { class GtkInstanceButton : public GtkInstanceWidget, public virtual weld::Button @@ -19474,16 +19473,11 @@ public: virtual std::unique_ptr weld_notebook(const OString &id) override { -#if !GTK_CHECK_VERSION(4, 0, 0) GtkNotebook* pNotebook = GTK_NOTEBOOK(gtk_builder_get_object(m_pBuilder, id.getStr())); if (!pNotebook) return nullptr; auto_add_parentless_widgets_to_container(GTK_WIDGET(pNotebook)); return std::make_unique(pNotebook, this, false); -#else - (void)id; - return nullptr; -#endif } virtual std::unique_ptr weld_button(const OString &id) override @@ -19885,8 +19879,16 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIFile != "cui/ui/percentdialog.ui" && rUIFile != "cui/ui/signatureline.ui" && rUIFile != "cui/ui/tipofthedaydialog.ui" && + rUIFile != "sfx/ui/custominfopage.ui" && + rUIFile != "svt/ui/datewindow.ui" && + rUIFile != "sfx/ui/descriptioninfopage.ui" && + rUIFile != "sfx/ui/documentfontspage.ui" && + rUIFile != "sfx/ui/documentinfopage.ui" && + rUIFile != "sfx/ui/documentpropertiesdialog.ui" && rUIFile != "sfx/ui/querysavedialog.ui" && rUIFile != "sfx/ui/licensedialog.ui" && + rUIFile != "sfx/ui/linefragment.ui" && + rUIFile != "sfx/ui/securityinfopage.ui" && rUIFile != "svt/ui/javadisableddialog.ui" && rUIFile != "svx/ui/fontworkgallerydialog.ui" && rUIFile != "modules/scalc/ui/deletecells.ui" && @@ -19905,6 +19907,7 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIFile != "modules/swriter/ui/gotopagedialog.ui" && rUIFile != "modules/swriter/ui/insertfootnote.ui" && rUIFile != "modules/swriter/ui/inserttable.ui" && + rUIFile != "modules/swriter/ui/statisticsinfopage.ui" && rUIFile != "modules/swriter/ui/wordcount.ui") { SAL_WARN( "vcl.gtk", rUIFile); -- cgit