fontMetrics is no longer used in production code, but still in the theme test
page.
Isolate fontMetrics in ThemeTest page.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In order to remove fontMetrics from QML, replace references (height)
in DownloadFromDiveComputer and Settings
Add include kirigami as needed
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move setting of font properties used throughout to themeInterface.
Add new settings "currentScale".
The properties are kept in main (subsurfaceTheme) in order not to do
a big search/replace.
Update settings to use currectScale and signal changes in themeinterface.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Check defaultfont and calculate basepointsize in themeinterface instead
of in QML.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There were quite a few issues with the code - clearly a complete failure of
code review.
- all values were '??' if a period contained no dives
- imperial units were not calculated at all
- significant truncation and data loss in the way totals were added as meters
and minutes instead of the higher precision data that is available
- several issues in striing conversion methodology, e.g. missing zero padding
for minutes
- missing maxSac
- incorrectly calculated avgSac
- incorrectly claculated number of EANx dives
- hard to read code with most variables named 'temp'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Solve kirigami error:
INFO: qrc:/org/kde/kirigami/ScrollablePage.qml:187: TypeError: Cannot assign to read-only property "parent".
Kirigami.scrollPage does not allow a ListModel be defined, even though it is allowed in QtQuick.
Signed-off-by: jan Iversen <jan@casacondor.com>
Replace subsurfaceTheme with ThemeNew, since there are still 2 objects
subsurfaceTheme in main.qml and ThemeNew in themeinterface.*
Replace theme color references with ThemeNew, as they are no longer available
in main.qml (subsurfaceTheme).
Signed-off-by: jan Iversen <jan@casacondor.com>
Add DivePlannerSummary, a page to show in dive centers.
Allow user to select period for the 2 colums in DiveSummary.
Default is "Total" and "3 month", but allowing the user to change
these, make it a very simple tool to view how the user progresses.
Variables are taken from Backend.
[Dirk Hohndel: adjusted text strings as these aren't really months]
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add property "colorBackground" to allow instances of templateLabel to have
background color overwritten.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update Settings to use ThemeNew (for theme change)
Reduce subsurfaceTheme in main
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update size and colors.
Changing the TemplateSection, automatically changes all sections
in the system, converted to the new layout.
The styling would be better in a style/theme class, but
subsurfaceTheme is in main.qml and not in a C++ class, so for now
use primitive styling.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The standard SpinBox uses far too much real estate.
The new SpinBox have a smaller footprint, and more visual effect.
Changing the TemplateSpinBox, automatically changes all spinboxes
in the system, converted to the new layout.
The styling would be better in a style/theme class, but
subsurfaceTheme is in main.qml and not in a C++ class, so for now
use primitive styling.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add property pressureUnit to use as BAR/PSI text.
Added slot to catch when user changes BAR <-> PSI.
Add Backend variables to Planning section.
Signed-off-by: jan Iversen <jan@casacondor.com>
Add bottompo2, decopo2 and bestmixend to QMLInterface
Bestmixend in gas options changing with
meter/feet
Signed-off-by: jan Iversen <jan@casacondor.com>
The real values are 1.0 to 10.0, but QML needs int so mobile
gets values 10.0 to 100.0
add sacfactor() to QMLInterface and update QML.
Signed-off-by: jan Iversen <jan@casacondor.com>
Move conversion cuft <-> liter from desktop-widget/diveplanner.cpp
to plannerShared, to facilitate the same results in mobile
diveplanner
Use Backend for bottomsac/decosac and update to check
for switch LITER <-> CUFT
Add bottomsac/decosac to QMLinterface.
Signed-off-by: jan Iversen <jan@casacondor.com>
Variables without conversion, do not need to pass plannerShared
(due to the QML interface).
Simple variables do not pass plannerShared, but diveplanner
in desktop-widgets and qmlinterface in mobile-widgets call the
implementation directly.
Signed-off-by: jan Iversen <jan@casacondor.com>
Catch when volume type is changed and update bottomsac/decosac.
Also update text l/min <-> cuft/min and add a space between value and unit.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Drop_stone_mode, when set, affect the descent rate, so place it alongside the
descent rate.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make notes rates available to QML through the Backend interface.
Remove the corresponding variables from plannerShared.
Getters are from prefs. while setters are linked to diveplan model.
Remark: signals from qPrefDivePlanner is used, because the diveplanner model
sets qPrefDivePlanner but do not issue special signals.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For METRIC and IMPERIAL, show the radiobuttons disabled
For PERSONALIZED, allow user to select individual units.
Signed-off-by: jan Iversen <jan@casacondor.com>
Use Backend instead of Planner for ascent/descent variables.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Change Settings and DivePlannerSetup to use the strongly typed enums
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create section advanced around the remaining gridlayouts, and adjust.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move gridlayout unit_settings to TemplateSection units, without changing
anything (apart from adding a visible: attribute).
Removed first label in units_settings, since it is the title of the section
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move gridlayout themesetting to TemplateSection theme and use the
TemplateTitle. Also switch from using PrefDisplay.mobile_scale to
subsurfaceTheme.currentScale
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
move gridlayout divecomputers to TemplateSection general, without changing
anything (apart from adding a visible: attribute and replacing the Rectangle
used to draw a line at the bottom with a TemplateLine on top.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
move gridlayout defaultCylinder to TemplateSection general, without changing
anything (apart from adding a visible: attribute and replacing the Rectangle
used to draw a line at the end with a TemplateLine at the top).
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
move gridlayout cloudSettings to TemplateSection general, without changing
anything (apart from adding a visible: attribute and removing the rectangle
used to create a line).
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
ColumnLayout does not work well with TemplateSection,
so change to Column
Add TemplateSection "General Settings"
"General Settings" are open when visiting page first time.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
bump import versions to reflect Qt 5.12
and remove unused imports
remark QtQuick 1 and QtQuick.Controls 1 are depreciated since Qt 5.12
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace Control.TextEdit with TemplateTextEdit, in order to use
common font/color scheme.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace Control.ComboBox with TemplateComboBox, in order to use
common font/color scheme.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace Control.label with TemplateLabel, in order to use
common font/color scheme.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace CloudStatus.<value> with backend.<value> as part
of making enum sharing between C/C++ and QML more robust.
Replace PrefCloudStorage.verification_status with
backend.verification_status to use the strongly typed function.
Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
add missing colors so that dark theme contains the
same colors as "colors in use".
Update the darkTheme() to correctly copy colors from
pink theme
Signed-off-by: jan Iversen <jan@casacondor.com>
add missing colors so that pink theme contains the
same colors as "colors in use".
Update the pinkTheme() to correctly copy colors from
pink theme
Signed-off-by: jan Iversen <jan@casacondor.com>