changeset 27120:c2a8365c73fc

add workaround for missing editor tab close buttons on macos (bug #56158) * file-editor.cc (notice-settings): add style sheet with tab close button if on macos
author Torsten Lilge <ttl-octave@mailbox.org>
date Tue, 28 May 2019 06:44:55 +0200
parents 99adef2c6e10
children a7c570394f1d
files libgui/src/m-editor/file-editor.cc
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc	Mon May 27 10:06:24 2019 -0700
+++ b/libgui/src/m-editor/file-editor.cc	Tue May 28 06:44:55 2019 +0200
@@ -1146,6 +1146,19 @@
       {
         m_tab_widget->setElideMode (Qt::ElideNone);
       }
+
+#if defined (Q_OS_MAC)
+    // FIXME: This is a workaround for missing tab close buttons on MacOS
+    // in several Qt versions (https://bugreports.qt.io/browse/QTBUG-61092)
+    QString close_button_css (
+      "QTabBar::close-button"
+      "  { width: 6px; image: url(:/actions/icons/widget-close.png);}\n"
+      "QTabBar::close-button:hover"
+      "  { background-color: #cccccc; }"
+      );
+    style_sheet = style_sheet + close_button_css;
+#endif
+
     m_tab_widget->setStyleSheet (style_sheet);
 
     bool show_it;