This is more discreet than ~/subsurface (the previous default) and
follows a well-established tradition.
Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- fix spacing and sizing in TopBar
- use an anchor layout for the delegate and split out labels and values: this
allows more uniform alignment
- add the subsurface mobile icon to the first page
- various visual touch-ups to taste
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- section headers get underline with a thick line
- items are separated by spacing and a thin grey line at the bottom
- spacing on both sides, aligning with header
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- colors for accentuation (background and text)
- text color to paint on highlights
- units.spacing (derived from gridUnit, so it's dpi-corrected)
- port main.qml, especially the application header to this theming and
sizing
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- Theme: For theming, we're just defining some colors centrally for now
- Units: This object provides dpi-corrected sizing in the form of
gridUnit. The idea is to base gridUnit on the rendered font size, so
the ui scales with text size. As this interpolates font size and dpi,
the sizing is rather responsive.
These are the basics, now we can kill lots of hardcoded pixel values.
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now size, position and state should be preserved correctly.
Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The filter that takes care to show the dive sites that have the
same gps information should not take into account dives that have
no gps information.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems that geolookups might return null for some values. This will
result in corrupted XML as show_utf8 does not terminate the current tag
if t->value is empty. So let's just skip the geo data that is missing
the value.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I have manually added dives from an ancient version of Subsurface.
Trying to edit these caused Subsurface to crash due to comparison of
string of dc.model that did not exist (to a static string). And further
down the execution path we were crashing as there were no samples
associated with the dive.
See #941
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Column headers were drawin in a smaller font. This fixes it for no
apparent reason.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Apparently transifex drops the leading space in the translation string and
then at runtime the string no longer matches. So let's just code this
differently.
This of course creates a new string but that new string should be the
string that transifex already asks people to translate...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If no command line argument is given and no default file is set we didn't
call refreshDisplay() and so the information widget stayed enabled even
though no dive was shown which looked really weird and was inconsistent
with what we showed when the user closed an already open file.
This makes the behavior more consistent.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far we showed bogus date and time - whatever time it might be in UTC at
midnight 2000-1-1 in your timezone. Instead we now show a discrete little
"-" in both fields.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
[Dirk Hohndel: slightly refactored this commit and the previous one to
make the code actually work and make the split across the
two commits more reasonable]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This shouldn't be on the maintab.cpp, this file is already too convoluted.
[Dirk Hohndel: slightly refactored this commit and the next one to make
the code actually work and make the split across the two
commits more reasonable]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Nothing to see here - just added the widgets on the .ui files
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There is a problem in LocationFilterDelegate::paint(), which
can manifest as very light background with white text in the
combo box from which the user selects a location - a
Windows 7 test case.
The main offenders are the drawControl() call which draws the
selected item background very bright and the fact that
the highlightText() is returning white.
It seems as if the combination of these is just wrong, theme
wise.
e5fa424a and 44762c42 fix that by branching Windows by version,
but do not cover the case where the user can use a custom theme -
e.g. dark selection highlight on Windows 7.
This patch skips drawControl() and draws the highlighted item
background manually. It makes it look similar to the small
tag highlights in TagWidget.
The patch adjust slightly the X offset of the drawn text.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Generally we have the water temperature under divecomputer tag, but it
might only be available one level up (under the dive tag). Thus we
should take this into account in order to show the yearly/monthly
statistics properly.
Fixes#867
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We use this in our own HTML export - and Google uses that in their
standard way of describing GPS coordinates.
With this the new test passes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We really should be able to parse the coordinates that we show in our own
HTML export as well as the standard Google format... both have a comma
between the latitude and longitude.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The compiler complains that said static (not-inline) function
in declared in the header but has no definition.
The function is only used as a helper in dive.c so so this
simply acts as a forward declaration and we can safely remove
it from dive.h. The same forward declaration can be in dive.c.
Since dive.h is include in *many* translation units, this
causes a lot instances of the same warning to be show.
If the function becomes part of the API, the static keyword
needs to be removed and the declaration needs to be added in
the header again.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Bug was due to incorrect use of QAbstractItemModel::index.
The arguments should be in (row, col) sequence but we were
mistakenly passing in (col, row).
Fixes#820
Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The 'show' call only makes the dialog visible, but if it's
covered by any other window that's not from *this* program
it could still be hidden in some OSes. the call to raise()
asks the window manager to make the widget to be on top of the
widget stack.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Do not call the setAttributte *everytime* the Preferences
is called, call it once on the constructor.
Also, no need to call the LanguageModel::instance() on the
instance method, it will be already called on the constructor
it seems that it's a leftover from a long while.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I don't know how I was not shot regarding on how broken the
old behavior was.
The new behavior:
1 copy the old_dive_site on top of the current_dive_site
only if the current_dive_site was actually a new uuid,
created by that method.
2 if the current_dive_site is an existing one but it doesn't
have gps coords, copy only the gps coords.
This fixes existing dive sites copying notes and coordinates
from the old_dive_site.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was needed when maintab had to thinker every little aspect
of the dive site selection, which has not been necessary for quite
a while.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- added system_default_directory()
- both system_default_directory() and system_default_filename()
now use the helper system_default_path_append()
- less safer compared to windows.c, assuming the OS is stricter on which
environment variables exist!
[Dirk Hohndel: switched filename to be dynamically allocated to avoid
possible buffer overflow]
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- added system_default_directory()
- both system_default_directory() and system_default_filename()
now use the helper system_default_path_append()
- less safer compared to windows.c, assuming the OS is stricter on which
environment variables exist!
[Dirk Hohndel: switched filename to be dynamically allocated to avoid
possible buffer overflow]
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old backend was less safe because, it didn't:
- support UTF-16 paths!
- use GetUserNameW()
The following changes were made:
- system_default_path_append() can be used to retrieve a path in the user
Roaming path.
- system_default_directory() - this is equal to
system_default_path_append(NULL)
- system_default_filename() also uses the helper
system_default_path_append()
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>