3fedf15
From 7cd58dbe32e5421986216dd7c6b24a4bb0b9c1e5 Mon Sep 17 00:00:00 2001
3fedf15
From: Luboš Luňák <l.lunak@suse.cz>
3fedf15
Date: Tue, 18 Oct 2011 14:52:47 +0000
3fedf15
Subject: style tooltips properly with KDE4 vclplug (fdo#40461)
3fedf15
3fedf15
---
3fedf15
(limited to 'vcl/unx/kde4')
3fedf15
3fedf15
diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx
3fedf15
index 10e7350..4dd54e5 100644
3fedf15
--- a/vcl/unx/kde4/KDESalFrame.cxx
3fedf15
+++ b/vcl/unx/kde4/KDESalFrame.cxx
3fedf15
@@ -38,6 +38,8 @@
3fedf15
 #include <kmainwindow.h>
3fedf15
 #include <kapplication.h>
3fedf15
 #include <ktoolbar.h>
3fedf15
+#include <qdebug.h>
3fedf15
+#include <qtooltip.h>
3fedf15
 
3fedf15
 #undef Region
3fedf15
 
3fedf15
@@ -239,11 +241,9 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
3fedf15
     style.SetFieldTextColor( aText );
3fedf15
     style.SetFieldRolloverTextColor( aText );
3fedf15
     style.SetWindowTextColor( aText );
3fedf15
-    style.SetHelpTextColor( aText );
3fedf15
 
3fedf15
     // Base
3fedf15
     style.SetFieldColor( aBase );
3fedf15
-    style.SetHelpColor( aBase );
3fedf15
     style.SetWindowColor( aBase );
3fedf15
     style.SetActiveTabColor( aBase );
3fedf15
 
3fedf15
@@ -268,11 +268,14 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
3fedf15
     style.SetHighlightColor( aHigh );
3fedf15
     style.SetHighlightTextColor( toColor(pal.color( QPalette::HighlightedText))  );
3fedf15
 
3fedf15
+    // Tooltip
3fedf15
+    style.SetHelpColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipBase )));
3fedf15
+    style.SetHelpTextColor( toColor( QToolTip::palette().color( QPalette::Active, QPalette::ToolTipText )));
3fedf15
+
3fedf15
     // Font
3fedf15
     Font aFont = toFont( kapp->font(), rSettings.GetUILocale() );
3fedf15
 
3fedf15
     style.SetAppFont( aFont );
3fedf15
-    style.SetHelpFont( aFont );
3fedf15
 
3fedf15
     style.SetMenuFont( aFont ); // will be changed according to pMenuBar
3fedf15
     //style.SetToolFont( aFont ); //already set above
3fedf15
@@ -291,6 +294,8 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
3fedf15
     }
3fedf15
     style.SetFloatTitleFont( aFont );
3fedf15
 
3fedf15
+    style.SetHelpFont( toFont( QToolTip::font(), rSettings.GetUILocale()));
3fedf15
+
3fedf15
     int flash_time = QApplication::cursorFlashTime();
3fedf15
     style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
3fedf15
 
3fedf15
--
3fedf15
cgit v0.9.0.2-2-gbebe