The tooltip state. Not that good. Proposal for improvement.

Marco Martin notmart at gmail.com
Sun May 27 11:43:04 UTC 2012


On Sunday 27 May 2012, Ben Cooksley wrote:
> > however, do we really need radically different visual styles?
> > 
> > all three application have a pixmap on the left and text on the right.
> > the text on the right changes a fair amount from app to app, though: in
> > systemsettings it is a category, a separator and a listing; in dolpin,
> > it's a title, a separator, and a nicely aligned table of metadata. in
> > Plasma we see very similar arrangements in the clock with multiple
> > timezones and in the pager displaying multiple windows.
> 
> For System Settings, the listing has icons as well. Is this possible
> with Plasma's tooltip classes?

would be possible with the usual limited html set of qtextdocument even if not 
uberpretty, that's what the pager applet does

> > * ToolTipManager uses QMetaObject::invokeMethod to call
> > toolTipAboutToShow and toolTipAboutToHide in items that have tooltips.
> > it would be nice to have a more elegant way to do this, in particular a
> > mechanism that would work nicely with QML2 and which allows the widget
> > with the tooltip to define the connection.
> 
> For System Settings, the items are in a QGridView, so not sure where
> the toolTipAboutToShow, etc methods would go here (on the items
> themselves, or the view?)

on itemviews i think the only place you can hook those things up are the view 
qwidget events themselves (forcing a bit of manual calculations :/)

> > so there are certainly some design issues to be addressed.
> > 
> > as for content, it would be interesting to see if ToolTipContent could be
> > extended in some way to more easily accomodate the needs of things like
> > showing a table of data (perhaps a QHash<QString, QString> .. what does
> > dolphin use for this datastructure?)
> > 
> >> The current one is _way_ to much tailored at tooltips for the tasks
> >> plasmoid and doesn't leave much room for customization (correct me if
> >> i'm wrong).
> > 
> > the tooltips in Plasma are used by pretty much everything in Plasma. the
> > only thing specific to the tasks plasmoid in them is the ability to view
> > previews of windows.
> > 
> > most things that use the tooltips ignore this feature cmpletely as it is
> > not relevant to them. it is a requirement of some uses, such as in the
> > tasks widget.
> > 
> > so i wouldn't say that the current tooltips are too tailored to the tasks
> > widget as they are used, well, everywhere.
> > 
> >> I would like to suggest a ToolTipManager with styles! Not themes! I
> > 
> > perhaps this can be determined by the content rather than by explicitly
> > setting the style in the application, which is probably just asking for
> > inconsistencies. i also don't like the idea of having to subclass things
> > just to get a nice tooltip in an application. it's both too much effort
> > and too much of an invitation for inconsistency.
> > 
> > i realy wonder if the existing Plasma::ToolTipManager could not just be
> > used in system settings already? if it is because it is too
> > QGraphicsView centric, let's fix that first ...
> 
> Plasma::ToolTipManager probably could be used I imagine. Other than
> the existing layouting code, etc. there is no QWidget based
> connection. The only connection is that the ToolTipManager is passed
> QAbstractItemView pointers, and expected to set itself up
> appropriately to trigger.

i thnk i would like the tooltipmanager work with pure qobjects even if would 
become not too type-safe (so would work with qgraphicswidget as now, but also 
with qwidgets, qdeclarativeitems and the future qquickitem (yeah, that's a 
silly name :p) that scene-graph will have in place of qdeclarativeitem. 
The mostly same implementation of an evenfilter should work on all of them.

and tooltipmanager can check by itself if the filtered item if a qwidget, the 
tooltip would be rendered as qwidget tooltips are now

Cheers,
Marco Martin


More information about the Plasma-devel mailing list