aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
AgeCommit message (Collapse)Author
2017-08-07mapwidget: use "satallite" maps instead of "hybrid"Gravatar Lubomir I. Ivanov
Do so until the following issue is resolved: https://github.com/vladest/googlemaps/issues/9 With the satellite map ([1]), the black tiles at relatively high zoom levels over the Red Sea cannot be seen. Instead it shows white tiles at the ultra-maximum zoom level at places. As a side note, the "satellite" map does not have the country labels which the "hybrid" map has. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-03QML UI: Settings: remove more marginsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03QML UI: CloudCredentials: better use of spaceGravatar Dirk Hohndel
No idea why this was restricted to be so narrow. Also, making the font of the label smaller and lighter seems visually more pleasing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03QML UI: remove unnecessary marginGravatar Dirk Hohndel
This makes better use of the available space. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03QML UI: remove unused codeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-02Merge branch 'googlemaps' of git://github.com/neolit123/subsurface into ↵Gravatar Dirk Hohndel
googlemaps
2017-08-02QML UI: dive edit autocompleteGravatar Joakim Bygdell
This makes sure that the autocompleting comboboxes never displays the scroll list where the user can pick an entry, and as such forces the view of a autocompleting textfield from the users point of view. The reasoning is that when scrolling in the drop down list it it possible to scroll to far and thus abort the ongoing edit by flicking away the edit page. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02QML UI: add more width to dive edit pageGravatar Joakim Bygdell
Mobile devices hare rather limited when it comes to screen size, there is no point in reducing the availabel space more than neccecary. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02QML UI: loose focus on endEditModeGravatar Joakim Bygdell
This handles a cornercase where a user starts editing and then cances the divedit followed by a return to edit mode. The previously acive textfield would then be active again even though all changes are lost. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02QML UI: make sure textfields loose focusGravatar Joakim Bygdell
For some reason the textfields on dive edit page did not loose focus when editing ended by press on the return key. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02QML UI: autocomplete objects should lose focus on selectionGravatar Joakim Bygdell
When the user makes a selection using the autocomplete function while editing a dive the keyboard should close and the selection list should disappear. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02QML UI: decrease fontsize on dive editGravatar Joakim Bygdell
Decrease the fontsize of the static text on the dive edits page. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02QML UI: enable modification of ratingsGravatar Joakim Bygdell
This enables editing of visibility and ratings for a dive. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02QML UI: display rating and visibility starsGravatar Joakim Bygdell
Display rating and visibility stars on the dive details page. See #495 Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02Add star iconsGravatar Joakim Bygdell
Add star icons from the material repository. https://material.io/icons/ The icons are under Apache License Version 2.0 Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02mapwidget.qml: use a custom built googlemaps pluginGravatar Lubomir I. Ivanov
This patch makes use of the geolocation plugin "googlemaps" for Qt Location with source code from here: https://github.com/vladest/googlemaps The change from the ESRI plugin is that it requires new indexes for the Hybrid ([3]) and Street ([0]) map types. There are more zoom levels in this plugins, but our default zoom-in settings seem to transition well to it. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-31Smaller buttons on map widgetGravatar Robert C. Helling
... so they take up less space while still being clickable. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-07-31QML UI: stop showing location labels earlierGravatar Dirk Hohndel
We are stepping by 2 - so 11 makes it clear that at 12 the labels are shown, but at 10 they are not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-31mobile: make sure old credentialStatus is definedGravatar Jan Mulder
In commit e76f527fe53063, the scenario of switching between 2 already VERIFIED cloud accounts was identified, which was working poorly. It needed a restart of the app to get the new account visible. Reason for this, was the setting of the credentialStatus to the value of an undefined (never set) old credentialStatus. This commit makes sure we have a defined credentialStatus, just before changing it to the new one. A really mini step forward, as the behavior is still not perfect. Now, the user has to select the dive list manually, after entering credentials of the new clould account. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-29Trivial log string correctionGravatar Jan Mulder
The PIN (and cloud account creation) is not limited to the desktop (any more). Correct the string accordingly. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-28Switch new files to unix line endingsGravatar Dirk Hohndel
I thought we had this automated, but Lubomirs commits introduced a few files with dos line endings. This is purely a change of line endings, no other changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-28map: whitespace cleanup in QML and C++ filesGravatar Lubomir I. Ivanov
- remove ";"s - remove {} where not needed or move them to the same line Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: track the coordinatesChanged() signal in QMLGravatar Lubomir I. Ivanov
The C++ side for the desktop version already does that. Add a slot for that in QML, for later use in the mobile version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: use darker text color for the deselected markersGravatar Lubomir I. Ivanov
Use "lightgrey" instead of "white" for deselected markers. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: add new logic for zooming and editing supportGravatar Lubomir I. Ivanov
The editing support is added via dragging. It is handled via the MouseArea's drag.target of the MapQuickItem. The drag target changes with the model selectedUuid. "mapAnimationZoomIn" now also does an initial zoom-out before moving to a new location. centerOnCoordinate() now pefroms calculations to determine how much the animation needs to zoom out. What it does is it reduces the Map zoomLevel util both the current and the new target coordinates are visible. It then restores the zoomLevel and performs animation based on newZoomOut. animateMapZoomIn() is now obsolete. The patch also includes the following smaller changes: - remove the setSelectedUuid() call in deselectMapLocation() This is now handled in C++ - sets "defaultZoomIn" to 12.0 - use ">=" when determining if a mapItem text should be visible Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: add visual tracking of editMode from MapWidgetHelperGravatar Lubomir I. Ivanov
The MapWidgetHelper QML instance now has the slot onEditModeChanged() which toggles the visiblity of a newly added message box that notifies the user if editing mode is enabled. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: add methods for editing MapLocationsGravatar Lubomir I. Ivanov
updateCurrentDiveSiteCoordinates() should be called from QML when a marker changed it's location. it emits the coordinatesChanged() signal, which should be tracked in the MapWidget class. The MapWidget class should emit the same signal to the MainWindow (Marble does that). editMode is now a boolean property, which should put the QML map into editing mode. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: add the same logic for markers as in globe.cppGravatar Lubomir I. Ivanov
The marble globe tracks dive sites with the same name and discards such that are less than 50 meters apart. We already store names in MapLocation objects, but using a QMap<QString, MapLocation *> to check the names is probably faster with the expense of using more memory. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: change centerOnDiveSite()Gravatar Lubomir I. Ivanov
Call setSelectedUuid() from C++ also center on coodinates instead on a MapLocation, as there is no point to pass the MapLocation object back to QML. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgetcontextmenu: slight increase of element sizeGravatar Lubomir I. Ivanov
Increase the font and element height a little to make it easier to click. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: include map location textGravatar Lubomir I. Ivanov
The MapItemView delegate now includes a white Text element. It uses the MapLocation "name" property as text. This text is only visible if the map zoom is above "textVisibleZoom". For hundreds of dives, using the DropShadow effect for the text makes it laggy. Instead, using a fake drop shadow (duplicate black Text under the default text) makes it much better. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28maplocationmodel: add the "namer" propertyGravatar Lubomir I. Ivanov
The MapLocation QObject now has a QString property "name", which is translating the dive_site->name member. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: add zoom-in and zoom-out buttonsGravatar Lubomir I. Ivanov
The buttons are positioned bellow the "toggle map type" button and increment / decrement the zoom by "zoomStep" (2 for now). Also clamp the zoom-in level to "map.maximumZoomLevel". Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: ";" and variable declaration cleanupGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: add double click on zoomGravatar Lubomir I. Ivanov
Double clicking a marker or the newly added MouseArea now performs a +2 zoom-in over a period of 500ms and centers on that clicked coordinate. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: store the selected dives count in "nSelectedDives"Gravatar Lubomir I. Ivanov
Different actions might be performed depending on the count of selected dives - e.g. deep zoom only for a single selected dive. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: emit a selectedDivesChanged() signalGravatar Lubomir I. Ivanov
The signal emits a QList<int> filled with dive idexes from the main backend dive table. The MapWidgetHelper QML instance handles that in onSelectedDivesChanged(). This will only be needed for the mobile version, as the desktop version should connect it's own slot in MapWidget.cpp. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: obtain a list of nearby divesGravatar Lubomir I. Ivanov
Based on a current location (MapLocation), iterate the dive list and add nearby dives (distance smaller than m_smallCircleRadius) to a local QList property (m_selectedDiveIds). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28maplocationmodel: make setSelectedUuid() accept "fromClick" flagGravatar Lubomir I. Ivanov
The idea of this flag is to be able to only to emit the selectedLocationChanged() signal when the user clicked on the map (fromClick == true). MapWidgetHelper::selectedLocationChanged() listens for this signal and only then it will select nearby dives based on a "small-cicle". If "fromClick" is false, it's the backend or the dive list that updated the selection and MapWidgetHelper::selectedLocationChanged() should no be called. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: call calculateSmallCircleRadius() on zoom changesGravatar Lubomir I. Ivanov
Each time the zoom changes MapWidgetHelper::calculateSmallCircleRadius() is called, and the "small circle" radius is stored in both C++ and QML. On the C++ side this radius will be used to select multiple nearby dives. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: add means to obtain a small circle radiusGravatar Lubomir I. Ivanov
Based on a QGeoCoordinate, calculateSmallCircleRadius() calls some QML Map methods to obtain how big a circle is in meters if a circle is drawn over the Map widget with radius SMALL_CIRCLE_RADIUS_PX pixels. This is called a "small circle" of a sphere: https://en.wikipedia.org/wiki/Circle_of_a_sphere This "small circle" radius becomes huge if the map is zoomed out, while quite small if the map is really zoomed in. The idea behind this circle is to be able to select multiple nearby dives, when clicking on the map (TODO). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: skip dive sites which are near each otherGravatar Lubomir I. Ivanov
Use QGeoCoordinate::distanceTo() to skip dive sites which are too close (50m) to dives sites which are already added as MapLocations. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: call "copy to clipboard" actions in the maphelper C++Gravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: add the method copyToClipboardCoordinates()Gravatar Lubomir I. Ivanov
This method uses the helper printGPSCoords() to format the coordinates of a location into either decimal or sexagesimal. The selection is handled by the boolean flag "formatTraditional" and the user preferences flag - prefs.coordinates_traditional. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: open current location in Google MapsGravatar Lubomir I. Ivanov
openLocationInGoogleMaps() now can be used to open a URL in an external browser, triggered by the context menu. Use the same Google Maps URL formating as in main.qml showMap(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgetcontextmenu: add the actionSelected() signalGravatar Lubomir I. Ivanov
The actionSelected() signal is now dispatched when the user selects an action from the menu (see the "actions" object). Then the declaration of the MapWidgetContextMenu object in mapwidget.qml can catch that signal in the onActionSelected() slot and obtain the action via switch() branching. The actions enumeration is kept in QML for now, with the idea that specific C++ methods from the mapwidgethelper class will be called directly (if marked as Q_INVOCABLE), instead of a generic onMapAction(action) C++ method in the helper. But if the actions are possible from QML (like copying to clipboard) and are also small and non-expensive, it might be better to keep them in mapwidget.qml. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgetcontextmenu: rearrange some of the QML declarationsGravatar Lubomir I. Ivanov
- move the readonly properties near the top of the root Item - move the rest of the properties bellow the readonly properties - make the ListView Timer as a child of the ListView - slight rename of the timer ID Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgetcontextmenu: add the ListView componentGravatar Lubomir I. Ivanov
NOTES: - the ListView object uses lsitItemDelagate to display all elements from the model listModel - onCountChanged() is used to adjust the x position based on the maxItemWidth property which is calculated when the items are populated with text - onVisibleChanged() is used to deselect the last selected item by calling listModel.selectedIdx = -1 - onOpacityChanged() i sued to make sure that the View is hidden if the opacity becomes 0.0 - inside the View there is a MouseAre which obtains the selected item via indexAt(x,y) - there is a Timer with id listViewVisibleTimer, which is called each time the user selects an item from the list and the timer performs a "delayed hide" - a couple of State and a Transition objects are used to preform smooth fade-in / out animation when the ListView is hidden or becomes visible Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgetcontextmenu: add a listViewIsVisible integer propertyGravatar Lubomir I. Ivanov
This property would act like a state flag. If -1 (default) no QML State animation will be pefromed, otherwise the ListView will either fade in (1), or fade out (0) when the user clicks the context menu button (Image) or selects an item from the list. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgetcontextmenu: add a model delegate for the ListViewGravatar Lubomir I. Ivanov
The ListView delegate is a simple Component with a parent Rectangle. It contains a text field with the ListView action. This patch also defines some properties for the delegate animations and looks. The property maxItemWidth tracks the width of all item text, and makes the width of all items be of that value. The above prevents potential issues when a fixed width item is used and some translated language string cannot be fit inside of it. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>