summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetextitem.cpp
AgeCommit message (Collapse)Author
2015-01-17Clean up the header filesGravatar Dirk Hohndel
Lots and lots and lots of header files were being included without being needed. This attempts to clean some of that crud up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Only update text if something changedGravatar Tomaz Canabrava
We were calling this even if we didn't really change anything and paths are expensive to paint. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Fix the colors - brush wasn't being set anymore.Gravatar Tomaz Canabrava
Also a bit of code cleanup. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Reduce the amount of new/delete when setting a new text on DiveTextItemGravatar Tomaz Canabrava
We were recreating the PathItems (one for the outline, other for the real text) for every call to setText. This was a very un-smart move. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Code cleanup: removed bogus animation functionsGravatar Tomaz Canabrava
All animations are now on the Animations namespace, which resulted in a bit of code cleanup, which is nice. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Correctly disable all animationsGravatar Tomaz Canabrava
This seems to be needed for the correct print of the profile, What was happening on the print code was that the profile even in print mode was doing animations, and we were getting a frame of it and trying to print it. Also, a bit of code cleanup. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-09Printing: scale fonts when printingGravatar Dirk Hohndel
This seem to work better, but it misses a couple of items at times (for example the highest label on some of the axis). Needs lots more testing. See #590 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-15New Profile: make axis labels smallerGravatar Dirk Hohndel
Previously all text in the new profile was deawn in the same font. With this change the labels on all axes are smaller. It might be even better to allow per-axis configuration of the label size as along the time axis the bigger size looked better. But especially for partial pressures this looks much better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09DiveTextItem improvementsGravatar Boris Barbulovski
* Add colorIndex to initialize list. * Reorder initialize to correct order. Note: colorIndex initialize value is set too SAC_DEFAULT. I do not know what is the rigth value since this variable member is not used anywhere. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-29Fix positioning of many text items.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-28Use the same behavior as the old time markersGravatar Tomaz Canabrava
This commit adds the same behavior for the old time markers on the new ones. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-22Add a MeanDepthItem that has 2 strings.Gravatar Tomaz Canabrava
Dirk's implementation of the MeanDepth item was correct, but in order to add the 2 strings to it ( one at the begin, one at the end ) I had to put more stuff inside the ProfileWidget that's already packed with graphics items. So I created a new class MeanDepthItem that contains these 2 strings and will get updated whenever the value changes. I also fixed a math inconsistency where I changed RIGHT to LEFT. (wich fixed a few text-placements, and broke others.) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21Add the dive computer text.Gravatar Tomaz Canabrava
Added the dive computer text on the bottom left side of the new Profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19Fix the positioning of the Labels using the new DiveTextItemGravatar Tomaz Canabrava
This uses a combination of items on the canvas which makes it easier to position it where I want. This also broke the other texts because I forgot about them. I will fix that on the next commit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-19Remove the plotText function, standardize with the TextItem.Gravatar Tomaz Canabrava
Removed the plotText function and replaced it with the DiveTextItem class - this way there's just one way to add text on screen, and it also makes it easy to fix positioning of stuff there. Which is what I'll try to fix on the next commit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Whitespace and coding style updatesGravatar Dirk Hohndel
Another futile attempt to cleanup the code and make coding style and whitespace consistent. I tried to add a file that describes the key points of our coding style. I have no illusions that this will help the least bit... This commit should ONLY change whitespace Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added a new Namespace to deal with Animations and related functions.Gravatar Tomaz Canabrava
Since the animation methods are fairly the same for any QGraphicsItem, I created a new namespace named 'Animations' that should handle all of the specific Animation Functions there, and the programmer has to call those functions from the objects. Good thing is that this reduces boilerplate code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Add a class based on QGraphicsSimpleTextItem that handles animations.Gravatar Tomaz Canabrava
This commit adds a class based on QGraphicsSimpleTextItem that handls animations via animatedHide() animatedMoveTo() and a few other QPropertyes. This is to be used in conjunction with the DiveLineItem added in the past commit on the Coordinate Axis. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>