aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveList.qml
AgeCommit message (Collapse)Author
2018-04-16QML UI: make the code easier to readGravatar Dirk Hohndel
And maybe this will make it faster as well? Depends on how the binding is implemented, I guess. But at least it's less confusing to read now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15QML UI: don't show a vertical scrollbar in dive listGravatar Dirk Hohndel
With the folding trips it just looks confusing as it changes size. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-15QML: remove unused propertyGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14QML UI: always show dives that aren't in a tripGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14QML UI: allow collapsing the open tripGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14QML UI: animate trip foldingGravatar Dirk Hohndel
This looks much nicer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-14QML UI: bring back folding tripsGravatar Dirk Hohndel
In older versions of Kirigami this caused all kinds of problems so we eventually gave up on it in commit 13c49276d1d4 (Revert "QML UI: make dive list fold dive trips"). Now this seems to work much better, so let's bring back trip folding! Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-03-11divelist.qml: add the setCurrentDiveListIndex() helperGravatar Lubomir I. Ivanov
Add the setCurrentDiveListIndex() wrapper for: diveListView.currentIndex = idx wich also makes it possible to disable the scroll animation when selecting dive list indexes which are too far apart. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-02-17Mobile QML UI: Divelist hover/selected colorsGravatar Jan Mulder
This is subtle one. With the changing of the theme color, it appeared that the hover and selected colors in the divelist where wrong (as in, always blue-ish). This is easily solved by setting the activeBackgroundColor to our theme color, and Kirigami does the rest (tint and opaque settings for the different states a selected dive can be in). Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-02-17Mobile QML: main.qml to Kirigmi 2.2Gravatar Jan Mulder
This is a long standing issue. I wish to keep up with Kirigami developments including new versions of their controls, but this is not always easy. While we upgraded to Kirigmi 2.2 for most of our QML earlier, using this new version of main.qml breaks numerous stuff. In fact, so much that we just needed to wait. With the progress in Kirigmi, it is now possible to upgrade, with still some issues on our side to be fixed, but this is manageble now. The main show-stopper was a construct to set our theme colors, for example: Kirigami.Theme.highlightColor = Qt.binding(...) This is not posssible any more, as the Kirigami.Theme has made these readonly on their end. This commit just removes the assignments to the now readonly theme items. And the setting of a correct theme color for the action button. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-02-08Mobile cleanup: remove unused actionsGravatar Jan Mulder
Trivial removal of 2 unused Kirigami actions. These were leftovers from the time we had a very different style of cloud account management. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-10mobile: fix crash on delete dive from divelistGravatar Jan Mulder
This is a somewhat hacky commit. For a very long time, the delete from the divelist on mobile crashed. That is, not always for anyone, but for me almost consistently. This commit tries to solve it. I found that trying to save the delete immediately after removing data from the underlying model seemed to cause the crash. Hacking around, I found that a simple beginResetModel/endResetModel between the delete of the underlying model data and actual save is sufficient to solve the crash. The big question is, why does this all work? I suspect some of race condition between deleting model data, and giving the QML engine the opportunity to do its thing. This is also related to issue #311, but that is not implemented here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-03mobile: newer Kirigami SHAGravatar Jan Mulder
This commit consists of the following 3 parts: 1. There are 2 source files added, adapt our build process accordingly. 2. Due to a change in icon and kirigami QML prefixes, we need to adapt for this as well. Changed mobile-resources.qrc for that. When this would not be changed, the icons will not be found. 3. To further prepare for the future, abandon the iconName property in favour of the new icon grouped property, which can have more attributes than only the name. But currently it is only a syntactic change. Tested on Android device, and no visible changes. Signedoff-by: Jan Mulder <jlmulder@xs4all.nl
2017-11-19QML UI: QtQuick.Controls to version 2.2Gravatar Jan Mulder
Tested fine without visual changes. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19QML UI: Kirigami to 2.2Gravatar Jan Mulder
When first tested this commit, especially the dive list was looking terrible. However, after including newer SHA's from libkirigami, and correcting lots of spacing/margin issue, a retest of this commit shows no strange artifact any more, and the amount of warnings in the log output is reduced significantly. So now, it appears save to upgrade. Notice that main.qml still uses Kirigami 2.0. and is not updated in this commit. With version 2.2, there is a new way of theming, that is not (yet) compatible with our current code. Blindly upgrading to 2.2 leads to a almost black dive list, wrong button colors, and runtime errors in the log, due to the fact the direct setting from QML Kirigami's Theme colors is not allowed any more. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-27QML UI: repair long trip headersGravatar Jan Mulder
Trip headers spanning more than one line where broken at incorrect locations in the string. Not exactly sure, but I think this came with the newest Kirigami SHA, and especially the Label change. Carefully reading the code for the trip heading shows a "strange" negative margin. So the margin is on the outside. This margin was used to split the string, allowing for a small invisible part of the string to present as trip header. This is solved by this commit. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-18QML-UI: repair DiveListGravatar Jan Mulder
The new SHA for Kirigami did all kinds of nasty things to our DiveList. This commit tries to repair most of the damage. Nothing more than some margins, anchors, and even a font that changed. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-17mobile: silence deprecated messages in logging about Kirigami.LabelGravatar Jan Mulder
Commit 8f6827ab122 brought a new SHA for Kirigami, but that introduces a very noisy logging of "Kirigami.Label is deprecated. Use QtQuickControls2.Label instead". So, thats what done here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29QML UI: cleanup some whitespace and string formattingGravatar Jan Mulder
This addresses some review comment on whitespace and translated string formatting. In the string formatting, a tiny additional change is made. I wanted the email address in the explanation text in a bold font. Using the HTML <b> for this, removed the /n newline characters in the output. Apparantly, mixing these two formatting styles does not work. No problem, replaced the /n to HTML style too. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29QML UI: rework single credential page to two pagesGravatar Jan Mulder
This commit tries to implement most of issue #515. It reworks the one credential page, which its dynamic PIN part, into two pages. Main driver of selecting one of the two pages is the showPin boolean. Page 1 contains the email/passwd field (and the option to use a no cloud setup). Page 2 only contains the PIN part (and the option to cancel the process). The Kirigami central button does not seem very handy here. We need, for example, a cancel, sign-in and register, only register, etc. buttons, which are not easy to handle in specific icons. Therefore, normal pushbuttons are chosen to deal with user interaction, and the Kirigami button is removed from these pages. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29mobile: initialize credential data in one placeGravatar Jan Mulder
It appears that the onCompleted of the StartPage item is triggered before the onCompleted of the rootItem. This is logical as the Startpage is a child of the rootItem. And, yes, this does matter. As the divelist also contains the logic for initial cloud registration (and is the default page shown in a state where the cloud credentials are valid (CS_VERIFIED state)), we need to know the correct credential state at start of the app. The move of this one line of code makes sure of that, in addition to setting the credential state from the preferences. Now, the setupActions function can reference correct credential data. This is further preparation for a better cloud creation process from mobile. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-04Unify credential statesGravatar Jan Mulder
Having two different enums around with more or less the same definition has lead to unclear code. After removing two not needed states on the mobile end, the remaining step to one enum for the credential state becomes almost is simple rename operation. Unfortunately, I do not know a way to embed a plain C enum from pref.h into the QMLManager object. So after this, there are still 2 enums around, but now identical. This commit is not changing any functionality. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-04mobile: remove superfluous state VALID_EMAILGravatar Jan Mulder
This is a no-brainer removal of the VALID_EMAIL state used in QMLManager. All current usage of this state is "if state is VALID or VALID_EMAIL", so there is no distinction between the two states. It is even a little different. The comment suggests "when we can open a local cloud storage, tied to a cloud account (so explicitly not the no-cloud status), we have at least a valid email". While this is formally true, this implies that there is also a cloud account on the cloud server (ie. the cloud account is in a VERIFIED state). In other words: currently, there can't exist a valid local storage that is tied to a valid email adress, without valid cloud account on the server. Notice that this touches the discussion on GitHub for commit e76f527fe530636 (pull request #520). Can we implement the creation of a valid cloud account without data link to the cloud server? Currently, we need the server to confirm the email address (for example for uniqueness reasons on server side). Obviously, we could hack our way out of this, but we have a perfect solution already in place. Create a no-cloud account, and transfer that later to a true and valid cloud account. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-04QML UI: set the title of the right objectGravatar Jan Mulder
Intended was here to set the title of the Dive list with id: page, instead of the startpage object. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-08-10DiveList.qml: set detailsWindow index before deleting dive from listGravatar Rick Walsh
This appears to fix the mystery crashes that can occur when deleting a dive from the dive list. Fixes: #497 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-07-26QML UI: use a lighter text color for the selected diveGravatar Joakim Bygdell
Use the ligther text color on the secondary row of text when a dive is selcted in the divelist Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-08QML UI: better icon for download from dive computerGravatar Dirk Hohndel
Thanks to Davide for paying for professional icon design. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-29QML UI: only drag a pull down sync, and not flick itGravatar Jan Mulder
Fast flicking to the top of the divelist triggers almost certainly a pull down sync, as the default boundBehavior is DragAndOvershootBounds. Despite being the default QML action, this leads to unwanted pull down syncs (even in offline mode). Setting the boundBehavior to DragOverBounds solves this issue. Now, the user has to explicitly drag the top down to force a pull down sync, and a accidental fast flick is stopped at the upper bound. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-27QML UI: DiveList: make download from DC main actionGravatar Dirk Hohndel
Now that we support this for many dive computers, that seem reasonable. I'm not happy with the icon, but couldn't figure out a better one in the breeze icon set. See #426 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24QML UI: DiveList: add date box to trip headerGravatar Dirk Hohndel
This way you can tell when a trip happened. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24QML UI: set opacity of 1 for dive listGravatar Dirk Hohndel
Hopefully with this we get exactly the right colors. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24QML UI: Davide's colors for the blue themeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23QML UI: use textColor instead of diveListTextColorGravatar Dirk Hohndel
This color is used for more than just the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22QML UI: DiveList: allow trip header to wrapGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22QML UI: turn off spinner if pull-down-to-refresh failsGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21QML UI: DiveList: implement pull down to refreshGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21QML UI: attempt to add dark themeGravatar Dirk Hohndel
This isn't great, yet, but a first step to show that this is possible (and in doing so I found quite a few spots where the colors weren't correctly propagating, yet). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21QML UI: don't reduce opacity for background of selected diveGravatar Dirk Hohndel
Now that we have distinct colors for trip header and selected dive, this is actually counter productive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21QML UI: DiveList: always show current trip at the topGravatar Dirk Hohndel
This is especially nice for very long dive trips. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21QML UI: redo all the colorsGravatar Dirk Hohndel
Naming them the same way Davide named them in his emails and assigning the color values he proposed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21QML UI: DiveList: fix position of delete buttonGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21QML UI: DiveList: turn the color blob into a thin lineGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21QML UI: DiveList distinguish trip and selected diveGravatar Dirk Hohndel
Making the selected dive's background less opaque prevents confusion. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20QML UI: DiveList: playing with different colorsGravatar Dirk Hohndel
Make the accent color much lighter, don't have a solid bar on the left for dives that are part of a trip. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20QML UI: DiveList: some fine tuning of sizes and spacingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20QML UI: DiveList: remove space below trip headingGravatar Dirk Hohndel
That made sense before we had the shaded background, now it just looks terrible. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20QML UI: DiveList: don't show empty trip heading for dives without tripGravatar Dirk Hohndel
We need to hide the left bar and background rectangle as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20QML UI: DiveList: show left bar on dives that are part of a tripGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20QML UI: DiveList: add blue bar on the left to trip headingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20QML UI: re-indent DiveList codeGravatar Dirk Hohndel
No actual changes besides whitespace. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>