File tooltips.diff of Package kde4-plasma-addons

--- applets/showdashboard/showdashboard.cpp	2008/11/04 11:55:06	1.1
+++ applets/showdashboard/showdashboard.cpp	2008/11/04 11:59:41
@@ -28,6 +28,7 @@
 // KDE
 #include <KIcon>
 #include <plasma/widgets/icon.h>
+#include <plasma/tooltipmanager.h>
 #include <KIconLoader>
 
 
@@ -48,6 +49,10 @@
     Plasma::Icon *icon = new Plasma::Icon(KIcon("dashboard-show"), QString(), this);
     layout->addItem(icon);
 
+    Plasma::ToolTipManager::self()->registerWidget(this);
+    Plasma::ToolTipContent toolTipData(i18n("Show the Plasma Dashboard"), QString(),
+                                       icon->icon().pixmap(IconSize(KIconLoader::Desktop)));
+    Plasma::ToolTipManager::self()->setToolTipContent(this, toolTipData);
     setAspectRatioMode(Plasma::ConstrainedSquare);
 
     connect(icon, SIGNAL(pressed(bool)),this, SLOT(toggleShowDashboard(bool)));
--- applets/showdesktop/showdesktop.cpp	2008/11/04 11:54:58	1.1
+++ applets/showdesktop/showdesktop.cpp	2008/11/04 11:57:03
@@ -18,6 +18,7 @@
 #include "showdesktop.h"
 #include <plasma/widgets/icon.h>
 #include <plasma/containment.h>
+#include <plasma/tooltipmanager.h>
 #include <KIcon>
 #include <kwindowsystem.h>
 #include <netwm.h>
@@ -50,9 +51,16 @@
     Plasma::Icon *icon = new Plasma::Icon(KIcon("user-desktop"), QString(), this);
     layout->addItem(icon);
     connect(icon, SIGNAL(clicked()), this, SLOT(pressed()));
+  
+    Plasma::ToolTipManager::self()->registerWidget(this);
+    Plasma::ToolTipManager::ToolTipContent toolTipData;
+    toolTipData.mainText = i18n("Show the Desktop");
+    toolTipData.subText = i18n("Minimize all open windows and show the Desktop");
+    toolTipData.image = icon->icon().pixmap(IconSize(KIconLoader::Desktop));
+    Plasma::ToolTipManager::self()->setToolTipContent(this, toolTipData);
 
     NETRootInfo info(QX11Info::display(), NET::Supported);
-    m_wm2ShowingDesktop = info.isSupported(NET::WM2ShowingDesktop);
+    m_wm2ShowingDesktop = info.isSupported(NET::WM2ShowingDesktop);
 
 #ifndef MINIMIZE_ONLY
     if (m_wm2ShowingDesktop) {
--- applets/showdashboard/showdashboard.cpp	2008/11/04 12:01:43	1.11
+++ applets/showdashboard/showdashboard.cpp	2008/11/04 12:17:58
@@ -50,8 +50,9 @@
     layout->addItem(icon);
 
     Plasma::ToolTipManager::self()->registerWidget(this);
-    Plasma::ToolTipContent toolTipData(i18n("Show the Plasma Dashboard"), QString(),
-                                       icon->icon().pixmap(IconSize(KIconLoader::Desktop)));
+    Plasma::ToolTipManager::ToolTipContent toolTipData;
+    toolTipData.mainText = i18n ("Show the Plasma Dashboard");
+    toolTipData.image = m_icon->icon().pixmap(IconSize(KIconLoader::Desktop));
     Plasma::ToolTipManager::self()->setToolTipContent(this, toolTipData);
     setAspectRatioMode(Plasma::ConstrainedSquare);
 
openSUSE Build Service is sponsored by