I was wondering why the colors where wrong on mac, it took
me a while to find the correct spot to fix. It seems that
the Brush is not used to paint the fonts, but the Pen is.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Davide complained about a flickr on windows, I think it
has to do with the QPainter now knowing the right
size of it's paint rect. this should fix it.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Removing dead code. the call above this does that already.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I'm not convinced that this is useful enough to keep, but let's give it a
try and see what people think.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code is already implemented as a signal-connection
on the maintab.cpp / globe.cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
paint methods should be used only to paint, not to trigger other
widget behaviours ( we could got ourselves into a bad recursion
bug from that ). Also, enabled mouse tracking to correctly track
the mouse movement inside the widget.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We should only show one possibility if the dive_site name
string is unique - we don't have that dive_site yet - so
we pass to the Completer filter a Dummy string that will
surelly not be a dive site - konami code.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way when the user looks through the list of completion options the
globe behaves in a consistent way, i.e., if the current dive site has a
GPS fix and the user activates one of the two options to create a dive
site with that GPS information, the globe show the right area (and the
globe zooms out if the current dive site doesn't have a GPS fix).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way in the future we can pass in a pointer to a dive site that isn't
linked in our dive site list yet (i.e., while we are editing).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We now have TWO special entries. One with just what the user has typed and
one with the first completion of that text. This way both Henrik and Linus
can get what they want. I'm not sure I love this, but it's easy to revert
if the consensus is that this is too confusing. But it's much easier to
discuss this if people can actually play with it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The user has picked their preferences of which taxonomy data they want to
see. Show them what they asked for.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If both the displayed dive and the dive site which is shown as a potential
completion have a GPS fix, indicate the distance.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The state handling is a pain to do manually, but I can't really
use the style painter because if I do that it would paint the
string of the model (and that's something I don't wanna do)
so I clear the text, draw the control, then I paint the stuff
that I really need.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Taxonomy text should be used if there's a taxonomy
for the dive site. If there isn't, then use coords. If
there's none, then nothing will appear on the bottom
of the dive site name.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Makes the location delegate pleasant to the eye.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A bit more complex than I tought it would be (and a ton of trial
and error to find the right spot on the delegate to draw stuff)
this delegate follows the current style (so it should be okaish
on a dark and on a light theme)
This is supposed to work on a QCompleter, but it doesn't (I really don't
know why, so maybe I'll remove that completer. sigh.)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
One more step to make it easyer to port the app to Mobile.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is another effort to make it easyer for the mobile
interface of Subsurface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another change to make it easier to program the mobile ui. This was a
fairly easy patch: just moved the contents of the file and fixed the
includes.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Still trying to make it easier for the Mobile Port:
This patch is a bit bigger than I hopped, but it was the smallest that I
could get.
A lot of TODO items where added where I broke the code because the current
implementation would break the QML implementtion on the designer. I'll
most probably fix those myself when I finish the transition to the models
to the new folder.
I only moved both models at once because there's an interdependency
between them (seems inevitable, tough, but I'll take a better look at it
later).
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the last patch in the series of clearing up the
mainwindo.ui. Now to bugfixing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now it's created in the mainwindow.cpp as part of the new
way to configure the interface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's now set up from the mainwindow.cpp file.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This sets the combobox to disabled if the profile is in
any mode besides PROFILE.
Fixes#824
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit b72c32da7 turned off replotting while the cylinder
combo box was active to speed up editing. After leaving
the combo box, replotting was enabled again and a replot
was called.
This replot is too agressive, as it overwrites the displayed
dive with the current dive and thereby resets the cyinder
change. This eliminates the replot call.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
Since replotting is expensive and it is triggered while scrolling
through the list of cylinders, better not do it for improved
user experience and replot only after the combo box loses
focus.
I hope this...
Fixes#768
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Compute the default widths for the columns in the dive trip list from
their header and (expected) content length rather than some fixed pixel
sizes.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The default IMG_SIZE and SPACING in the StarWidget are not appropriate
for HiDPI displays. Replace them with StarMetrics which are
auto-computed from the (default) font size (which Qt determines from the
display DPI settings).
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commits a24eb8ac12 and 0b0860d24a introduced a nasty hack that was
needed back then to make tank and weight selection work on the Mac. But it
caused other unpleasant issues (as mentioned in the commit messages).
I re-tested this with the current Qt5.3 based builds on Mac and this hack
is no longer needed.
Fixes#638
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Well, the information was bad, it was being printed twice
if the text is HTML, print only once.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch just adds the HTML Delegate to print the text.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I don't know if this fixes anything, but it is asked of us to
do that by the Qt docs.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added a HTML delegate to show rendered HTML on print.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>