aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetooltipitem.h
AgeCommit message (Collapse)Author
2015-01-17Reduce the refresh rate of the toolTipItem to 25fps.Gravatar Tomaz Canabrava
This reduces a lot of CPU time and makes the overall use of the tooltip a breeze. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Implement the paint method to draw the rounded rectangle.Gravatar Tomaz Canabrava
The rectangle is now correct, but the collors are still wrong. I'm tracking that down - most probably I've set the wrong pen or brush ( or both ) somewhere. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Remove the background and the separatorGravatar Tomaz Canabrava
Those items were used to fake the background of the path item but since the rectangle can be painted with a border and a fill, this is uneeded. The rect is still ugly. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Inherit from QGraphicsRectItem instead of QGraphicsShapeItemGravatar Tomaz Canabrava
a rectangle is *much* faster to paint than a simple ShapeItem, so this is a safer choice. We still need to create the paint method so we can use the correct roundness for the rectangle. Currently it's white with a 1px solid line - terrible. :) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15Reuse the entry tooltip item and do fewer calls for each mouse moveGravatar Tomaz Canabrava
While analizing the code for the mouse movement I've discovered that we did a lot of uneeded things: Set the color, the pen, the size of a fixed-colored line, twice. We also deleted-newed the same Pixmap / Text for every mouse movement so now we reuse the 'entryToolTip' that consists of a huge line and a pixmap, and after that we add the other tooltips that are not static Also, reduced a lot the number of calls to expand() (that did a lot of math). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-15Fix memory leakGravatar Tomaz Canabrava
The QPainter and the QPixmap were being created but never freed. A QPixmap and a QPainter don't need to be created by new, they can be safely created on the stack. So, create them on the stack, pass them via const-reference and use them correctly. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Unify icon metricsGravatar Giuseppe Bilotta
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-18Dynamic ToolTipItem metricsGravatar Giuseppe Bilotta
Instead of hard-coding the icon sizes and spacing, compute them from the font sizes, that Qt auto-computes from the displya DPI. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19Add tissue saturation plot to tooltipGravatar Robert C. Helling
This adds a graphical representation of tissue loadings at the current moment during the dive to the tooltip box. The layout is inspired by the Sherwater Petrel.Add tissue saturation plot to tooltip Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-24Fixe movement of DiveHandlers when moving the NotificationAreaGravatar Tomaz Canabrava
The QGraphicsView system moves every selected item when the user clicks and drags one. This patch makes a cache of all selected items and removes the selection on them. When the user stops dragging the Notification, the selection is restored. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-07Remove a Lot of Dead Code.Gravatar Tomaz Canabrava
This is just removal of dead code from the old profile, probably there's still a bit more to remove, but this is a very good cleanup already. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-19Only recalculate the tooltip if time has changedGravatar Dirk Hohndel
Small optimization, but seems to make sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Put include guard to every headerGravatar Boris Barbulovski
* ensure include guard to every header * comment endif guard block Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11Clean up include filesGravatar Dirk Hohndel
They should have a newline at the end. Forward declarations of classes should be 'class'. Function / method definitions don't end on a ';' Remove obsolete QStateMachine forward reference. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Adapt the ToolTip to work on the new profileGravatar Tomaz Canabrava
With this patch the tooltip is ready to work on the new profile, we just need to actually use it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Move the divetooltipitem to its own file.Gravatar Tomaz Canabrava
This is needed so we can share the dive tooltip item with the new and old profile at the same time. Next few commits will be setting the functionality of the tooltip item on the new one. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>