[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    
From:       Stanislav Kljuhhin <crz () starman ! ee>
Date:       2003-08-24 21:20:01
[Download RAW message or body]

hi,

here goes a patch (attached) that prevents taskbar tooltips from splitting in 
many lines thus being ugly as hell :) it also make taskbar not to show empty 
tooltips.
please review and consider applying.

-- 
cu,
crz

["kdebase-kicker-taskbar.diff" (text/x-diff)]

? kdebase-kicker-taskbar.diff
Index: taskcontainer.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/taskbar/taskcontainer.cpp,v
retrieving revision 1.86
diff -u -3 -p -d -r1.86 taskcontainer.cpp
--- taskcontainer.cpp	20 Aug 2003 18:54:35 -0000	1.86
+++ taskcontainer.cpp	24 Aug 2003 21:10:31 -0000
@@ -109,7 +109,10 @@ void TaskContainer::init()
 
     connect( this, SIGNAL( clicked() ), SLOT( slotClicked() ) );
 
-    QToolTip::add( this, "<qt>" + QStyleSheet::escape(name()) + "</qt>" );
+    if (!name().isEmpty())
+        QToolTip::add( this, currentTooltip="<qt><nobr>" + \
QStyleSheet::escape(name()) + "</nobr></qt>" ); +    else
+        currentTooltip="";
 
     animBg = QPixmap( 16, 16 );
 
@@ -137,15 +140,18 @@ void TaskContainer::taskChanged()
 
 void TaskContainer::update()
 {
-    QString tooltip = "<qt>" + QStyleSheet::escape(name()) + "</qt>";
+    QString tooltip = name().isEmpty() ? "" : "<qt><nobr>" + \
QStyleSheet::escape(name()) + "</nobr></qt>";  if (currentTooltip == tooltip)
     {
         repaint();
         return;
     }
 
+    if (!currentTooltip.isEmpty())
+        QToolTip::remove( this );
+
     currentTooltip = tooltip;
-    QToolTip::remove( this );
+
     QToolTip::add( this, tooltip );
     repaint();
 }



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic