[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jan 17 12:41:45 UTC 2019


 vcl/unx/gtk3/gtk3gtkinst.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 2e0f991f2eb57c0c25f32f759853195f9764a529
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jan 16 12:36:25 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jan 17 13:41:22 2019 +0100

    Resolves: tdf#122623 theme unwanted tab into invisibility
    
    its nigh impossible to have a GtkNotebook without an active tab, so
    try and theme it into invisibility with no width
    
    Change-Id: I312b81ae51abe9fdd222fb5d5c45cb41603b80cb
    Reviewed-on: https://gerrit.libreoffice.org/66471
    Tested-by: Jenkins
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 4ea6de898734..83794ade2efd 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3153,7 +3153,7 @@ private:
     {
         disable_notify_events();
 
-        GtkWidget *pTabWidget = gtk_image_new_from_icon_name("pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
+        GtkWidget *pTabWidget = gtk_fixed_new();
         gtk_buildable_set_name(GTK_BUILDABLE(pTabWidget), "useless");
 
         GtkWidget *pChild = gtk_grid_new();
@@ -3383,6 +3383,16 @@ public:
         else
             m_nSizeAllocateSignalId = 0;
         gtk_notebook_set_show_border(m_pOverFlowNotebook, false);
+
+        // tdf#122623 it's nigh impossible to have a GtkNotebook without an active (checked) tab, so try and theme
+        // the unwanted tab into invisibility
+        GtkStyleContext *pNotebookContext = gtk_widget_get_style_context(GTK_WIDGET(m_pOverFlowNotebook));
+        GtkCssProvider *pProvider = gtk_css_provider_new();
+        static const gchar data[] = "header.top > tabs > tab:checked { box-shadow: none; padding: 0 0 0 0; margin: 0 0 0 0; border-image: none; border-image-width: 0 0 0 0; background-image: none; background-color: transparent; border-radius: 0 0 0 0; border-width: 0 0 0 0; border-style: none; border-color: transparent; opacity: 0; min-height: 0; min-width: 0; }";
+        static const gchar olddata[] = "tab.top:active { box-shadow: none; padding: 0 0 0 0; margin: 0 0 0 0; border-image: none; border-image-width: 0 0 0 0; background-image: none; background-color: transparent; border-radius: 0 0 0 0; border-width: 0 0 0 0; border-style: none; border-color: transparent; opacity: 0; }";
+        gtk_css_provider_load_from_data(pProvider, gtk_check_version(3, 20, 0) == nullptr ? data : olddata, -1, nullptr);
+        gtk_style_context_add_provider(pNotebookContext, GTK_STYLE_PROVIDER(pProvider),
+                                       GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
     }
 
     virtual int get_current_page() const override


More information about the Libreoffice-commits mailing list