[PATCH] tooltip: add update parametr to updateToolTip function

Rob Scheepmaker r.scheepmaker at student.utwente.nl
Tue Apr 1 18:54:09 CEST 2008


On Tue, Apr 01, 2008 at 06:18:12PM +0200, Rafa?? Mi??ecki wrote:
> 2008/4/1, Rafa?? Mi??ecki <zajec5 at gmail.com>:
> >  void updateToolTip(bool update) {
> >  m_isToolTipShown = update;
> >  }
> >
> >  That is something we need in digital clock. We use Plasma::DataEngine
> >  to update time in panel but we have no idea when updating tooltip
> >  content is needed. With this updateToolTip(bool update) we will know.
> 
> Question from IRC:
> <pinda> Zajec: I've just looked at it, but it's not clear to me why
> that's necesarry.. according to the comments, updateToolTip get's
> called just before showing the tooltip. why do you also want to know
> when the tooltip get's hidden?
> 
> To make clear why I need this for digital clock:
> 
> In digital clock we use Plasma::DataEngine and connectSource(...) with
> interval 1sec or 60secs (depending on user's configuration).
> DataEngine calls dataUpdated(...) every that interval and inside this
> function we update displayed time in panel + displayed time in tooltip
> - even if it's not displayed (tooltip). That causes a lot of unneeded
> updates when tooltip is not visible.
> 
> Problem will be even bigger when we introduce multizones support (I
> have patch 90% ready). For each timezone we will use single query and
> we will add response to tooltip. That will cause horribly big amount
> on unneeded operations.
> 
> With this patch I can track visibility on tooltip and avoid updating
> text inside tooltip (I won't update it when tooltip is invisible).

That makes sense. Some of the more experienced plasma hackers out there
should however probably also comment on this...

Just one idea: what if there were a seperate dataUpdatedToolTip, which
also gets called when the dateEngine updates, but only if a tooltip is
being displayed? I could see that being useful for these kinds of
situations. Just some random tought...

Rob Scheepmaker
(pinda)
> 
> -- 
> Rafa?? Mi??ecki
> _______________________________________________
> Panel-devel mailing list
> Panel-devel at kde.org
> https://mail.kde.org/mailman/listinfo/panel-devel


More information about the Panel-devel mailing list