summaryrefslogtreecommitdiffstats
path: root/qt-ui/profilegraphics.cpp
AgeCommit message (Collapse)Author
2013-05-16Fix loading a dive via command line.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-16Fix loading a second dive, after the first file was loaded.Gravatar Tomaz Canabrava
This patch fixes loading a second dive-file after the first one had been loaded. it simply clears some information and makes sure that the current selected dive is invalid when the file closes. I also did a bit of code cleanup on this one to make things simpler in the future. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-16Fixed the loading of some mapsGravatar Tomaz Canabrava
On some maps, the lack of setting up the dc before plotting the dive-computer nick caused a division by zero, breaking the correct visualization of the dive. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-14Clean up some typosGravatar Henrik Brautaset Aronsen
Cosmetic commit to clean up some of the annoying typos in qt-ui Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-13Fix segfault on mouseOver at the Profile with an invalid dive selected ( trip )Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-12Don't print temperatures that are below 200KGravatar Dirk Hohndel
That threshold is of course ridiculous and arbitrary - but it seems like a good assumption to make that anything below that is DEFINITELY not valid data. Because of the way the scene grows automatically in Qt, printing these texts would squish the profile into one thin line. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-12Fix crash if we have no divecomputer informationGravatar Dirk Hohndel
The string we print is lame, but it keeps things consistent (and prevents us from dereferencing functions in uninitialized objects). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-10Improve the text labels in the profileGravatar Dirk Hohndel
Only 1 decimal, please. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-10Tweaks to maintabGravatar Amit Chaudhuri
Align statistics tab labels as per infotab. Amend helper function to show degree symbol for temp measurements. Change order of member initialisation list to match order of decl (ProfileGraphicsView::ProfileGraphicsView) Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-10Merge branch 'fixCrash' of https://github.com/tcanabrava/subsurface into QtGravatar Dirk Hohndel
2013-05-10Crash fixed on clicking on the canvas while no dive is loaded.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-10Fixed loading the first dive via command line on the profile.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-10Fixed Zoom and Positioning of the Ruler ItemsGravatar Tomaz Canabrava
The items are still being placed far from each other when zooming in - I need a bit of help with the math for that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-10Fix some compiler warningsGravatar Dirk Hohndel
Passing the alignment as int instead of float or double was actually a bug as CENTER is defined as (-0.5) ... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-10Change the plot text so it receives a QPointF instead of x,y, and a ParentGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-10Fix some compiler warningsGravatar Dirk Hohndel
Passing the alignment as int instead of float or double was actually a bug as CENTER is defined as (-0.5) ... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-10Fix showing the stuff on the canvas in the right positions.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-10Only drag the tooltip panel when not zooming.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-10Fix Tooltip Positions, code cleanupGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-10Uses the correct rectangle to englobe the profile grid.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09The Zoom is working just like the GTK Version.Gravatar Tomaz Canabrava
This code enables Zoom in / Out with the Wheel, and it also enables panning by moving the mouse around. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Removed unused code that I'm sure it's safe to delete.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Use a Default pen to make the configuration easier.Gravatar Tomaz Canabrava
Created a default pen that has 'cosmetic' enabled, A cosmetic line doesn't change it's width no matter what zoom level we apply. Also , changed everything that used a line to have that as default pen instead. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plot the vertical ruler on the left of the profile.Gravatar Tomaz Canabrava
Plot the numbers on the left of the profile. It seems that everythign is being plotted - But I can see that there are coordinate-errors on the code. ( the GTK one plots some curves below of the dive, but the Qt one is overlapping - probably the way that I'm using the gc information) Need to investigate a bit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09Plot pp TextGravatar Tomaz Canabrava
This patch plots the PP text, but when I plotted I realized that the gc.pi.mapp is being calculated wrong, probably something went wrong on the calculations - it's comming zered always. So, only one line & text is plotted. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plotting deco text.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09Plotting cylinder pressure text.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plotting depth text.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plotting temperature text.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Shows the correct color for the CylinderPressureGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-09Plot of the Cylinder Pressure over time.Gravatar Tomaz Canabrava
a few code was moved around, a macro that contained the form of x ? : y; had to be rewritten to x ? x : y since c++ doesn't allow ternarys without the middle operator. The color-choosing for the Cylinder Pressure broke on the Qt port - but it's a small issue. I'm painting everyone as 'dark green' now, will fix that later. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Add bounding box to profileGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Show the dive computer name in the profile windowGravatar Dirk Hohndel
And clean up some obsolete Gtk related stuff that is no longer relevant for the Qt port. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Add tooltip data and cleanup size calculationsGravatar Dirk Hohndel
Tomaz' code had a fixed height per tooltip item and some rather suspicious logic how to position them (and how to size the surrounding box), based on a fixed height in pixels per item - which of course fails if you use larger fonts or multi line items. This uses the bounding rects to correctly calculate the sizes and populates the tooltip with the other dive data that we already had in a helper function. This also fixes a small formatting issue for gas change events. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Stop passing around gc and piGravatar Dirk Hohndel
Make the graphics_context part of the ProfileGraphicsView and remember that the plot info is already a part of the graphics_context (we kept passing around both of them in the Gtk code... pointless but a leftover from before adding the pi to the gc...) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Fix moving the ToolTip box with the mouse.Gravatar Tomaz Canabrava
When I changed the way that the tooltip box behaved, I accidentaly 'ate' the mouseMoveEvent, it was being used only to show tooltips instead of everything that it should have. this simple patch fixes it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Plot the temperature GraphGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08Make tooltips worksGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Work on the tooltips - WIP.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-08Better design for the ToolTip Handler.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-07Added a bit of documentation on how to use the ToolTips & removed 2 bad-api ↵Gravatar Dirk Hohndel
methods Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-07Adds real support for ToolTips.Gravatar Dirk Hohndel
This patch changes the Event drawing so it can display tooltips. It is now the responsibility of the item to show / hide a tooltip. A bit of code-refactoring got on here too because I was using only QGraphicsItem calls and I wanted to use a hover in / hover out event to show / hide the tooltip. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-07Added the first overlay of the tooltips, with some test data.Gravatar Tomaz Canabrava
The tooltips now can: 1 - be moved around the canvas 2 - dynamically expand / retreat when a new tooltip is added. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Finish the plotting of the eventsGravatar Tomaz Canabrava
Beautification of the triangles done, Tooltips are also displaying Some rework on the code - don't know if dirk will accept, I'v changed an if-else-if-else by a ternary operator, since it improves legibility a little bit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Plotting the Events doneGravatar Tomaz Canabrava
There are subtle differences, the Cairo version looks prettier - but that's fixable. I did a small triangle and a exclamation mark on it. maybe a gradient would make a good difference there. this item has a ItemIgnoresTransformation tag, so scalling, rotating or zooming will not change it's size. The tooltips are not yet ported. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-06Make the text ignores transformations on the sceneGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-06Port the plot text method to Qt, also test it by actually plotting somethingGravatar Tomaz Canabrava
The plot_text function from the cairo-methods are now ported on the qt version. this patch moves around some code since quite defines are already used and I didn't want to reinvent the whell. Original code used varargs, but I prefered to change it , so now it receives just a reference to a QString object and the string must be constructed before sending, using the .arg methods. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-05Fixed some bad drawingsGravatar Tomaz Canabrava
Removed the lines of the graphs that doesn't supposed to have lines. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-05Enabled some Render Hints for AntialiasingGravatar Tomaz Canabrava
Enabled some Render Hints for Antialiasing and smooth transformations. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-05Merge branch 'PlotsV2' of https://github.com/tcanabrava/subsurface into QtGravatar Dirk Hohndel
Minor conflicts based on my cleanup of Tomaz' earlier commits. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>