Blame 0001-Resolves-tdf-122623-theme-unwanted-tab-into-invisibi.patch

2d01c68
From 2e0f991f2eb57c0c25f32f759853195f9764a529 Mon Sep 17 00:00:00 2001
2d01c68
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
2d01c68
Date: Wed, 16 Jan 2019 12:36:25 +0000
2d01c68
Subject: [PATCH] Resolves: tdf#122623 theme unwanted tab into invisibility
2d01c68
MIME-Version: 1.0
2d01c68
Content-Type: text/plain; charset=UTF-8
2d01c68
Content-Transfer-Encoding: 8bit
2d01c68
2d01c68
its nigh impossible to have a GtkNotebook without an active tab, so
2d01c68
try and theme it into invisibility with no width
2d01c68
2d01c68
Change-Id: I312b81ae51abe9fdd222fb5d5c45cb41603b80cb
2d01c68
Reviewed-on: https://gerrit.libreoffice.org/66471
2d01c68
Tested-by: Jenkins
2d01c68
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
2d01c68
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2d01c68
Tested-by: Caolán McNamara <caolanm@redhat.com>
2d01c68
---
2d01c68
 vcl/unx/gtk3/gtk3gtkinst.cxx | 12 +++++++++++-
2d01c68
 1 file changed, 11 insertions(+), 1 deletion(-)
2d01c68
2d01c68
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
2d01c68
index 4ea6de898734..83794ade2efd 100644
2d01c68
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
2d01c68
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
2d01c68
@@ -3153,7 +3153,7 @@ private:
2d01c68
     {
2d01c68
         disable_notify_events();
2d01c68
 
2d01c68
-        GtkWidget *pTabWidget = gtk_image_new_from_icon_name("pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
2d01c68
+        GtkWidget *pTabWidget = gtk_fixed_new();
2d01c68
         gtk_buildable_set_name(GTK_BUILDABLE(pTabWidget), "useless");
2d01c68
 
2d01c68
         GtkWidget *pChild = gtk_grid_new();
2d01c68
@@ -3383,6 +3383,16 @@ public:
2d01c68
         else
2d01c68
             m_nSizeAllocateSignalId = 0;
2d01c68
         gtk_notebook_set_show_border(m_pOverFlowNotebook, false);
2d01c68
+
2d01c68
+        // tdf#122623 it's nigh impossible to have a GtkNotebook without an active (checked) tab, so try and theme
2d01c68
+        // the unwanted tab into invisibility
2d01c68
+        GtkStyleContext *pNotebookContext = gtk_widget_get_style_context(GTK_WIDGET(m_pOverFlowNotebook));
2d01c68
+        GtkCssProvider *pProvider = gtk_css_provider_new();
2d01c68
+        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; }";
2d01c68
+        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; }";
2d01c68
+        gtk_css_provider_load_from_data(pProvider, gtk_check_version(3, 20, 0) == nullptr ? data : olddata, -1, nullptr);
2d01c68
+        gtk_style_context_add_provider(pNotebookContext, GTK_STYLE_PROVIDER(pProvider),
2d01c68
+                                       GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
2d01c68
     }
2d01c68
 
2d01c68
     virtual int get_current_page() const override
2d01c68
-- 
2d01c68
2.21.0.rc1
2d01c68