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

List:       kde-panel-devel
Subject:    Re: [PATCH] Don't show tooltips after a click
From:       Jason Stubbs <jasonbstubbs () gmail ! com>
Date:       2008-07-25 15:40:58
Message-ID: 200807260040.58710.jasonbstubbs () gmail ! com
[Download RAW message or body]

On Saturday 26 July 2008 00:22:08 JST, Jason Stubbs wrote:
> On Friday 25 July 2008 23:53:29 JST, Alex Merry wrote:
> > On Friday 25 July 2008 15:36:27 Jason Stubbs wrote:
> > > Hey,
> > >
> > > Just a quickie so going direct to the ML.
> > >
> > > Basically, having a tooltip pop up after moving the mouse into the
> > > tasks and clicking a task to switch to it is really bugging me. This
> > > patch fixes it (and cleans up a little whitespace too). Okay to commit?
> >
> > Please do!  It's driving me bats.
>
> Done. For some reason, it doesn't fix the Icon applet. Nothing looks
> strange code-wise though... Will have a closer look.

The icon widget (a child of the icon applet) handles clicks, moves, etc so the 
event never reaches the icon applet and is thus not filterable by the tooltip 
manager. This patch changes the tooltip registration to the icon widget.

Unless! The tooltip manager should be smart enough to filter child widgets 
(and watch for new children) as well? I personally think it's more trouble 
than it's worth, but it'd be the better way to go if it is possible without 
much effort.

-- 
Jason Stubbs

["icon-tooltip-owner.patch" (text/x-diff)]

Index: icon.cpp
===================================================================
--- icon.cpp	(revision 837691)
+++ icon.cpp	(working copy)
@@ -67,8 +67,6 @@
 
 void IconApplet::init()
 {
-    Plasma::ToolTipManager::self()->registerWidget(this);
-
     QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this);
     layout->setContentsMargins(0, 0, 0, 0);
     layout->setSpacing(0);
@@ -83,6 +81,7 @@
     setDisplayLines(2);
 
     registerAsDragHandle(m_icon);
+    Plasma::ToolTipManager::self()->registerWidget(m_icon);
 
     setAspectRatioMode(Plasma::ConstrainedSquare);
 
@@ -164,7 +163,7 @@
             data.mainText = m_text;
             data.subText = m_genericName;
             data.image = m_icon->icon().pixmap(IconSize(KIconLoader::Desktop));
-            Plasma::ToolTipManager::self()->setToolTipContent(this, data);
+            Plasma::ToolTipManager::self()->setToolTipContent(m_icon, data);
             m_icon->setDrawBackground(false);
         }
     }


_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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