Skip to content

Commit eb6202a

Browse files
authored
Anmacdonald/toolkit fixes (#427)
* Adding implict height/width to OverviewMap. * Updating class level docs. * Updating the tooltip spawn time. * Fixing Portal 2way binding.
1 parent 34c7eb4 commit eb6202a

File tree

5 files changed

+46
-23
lines changed

5 files changed

+46
-23
lines changed

uitools/cpp/Esri/ArcGISRuntime/Toolkit/Internal/GenericListModel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ namespace ArcGISRuntime {
2525
namespace Toolkit {
2626

2727
/*!
28-
\internal
2928
\inmodule EsriArcGISRuntimeToolkit
3029
\class Esri::ArcGISRuntime::Toolkit::GenericListModel
3130

uitools/import/Esri/ArcGISRuntime/Toolkit/BasemapGallery.qml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
******************************************************************************/
1616
import Esri.ArcGISRuntime.Toolkit.Controller 100.12
1717

18-
import QtQml 2.12
19-
import QtQuick 2.12
20-
import QtQuick.Controls 2.12
18+
import QtQuick 2.15
19+
import QtQml 2.15
20+
import QtQuick.Controls 2.15
2121
import QtQuick.Layouts 1.15
2222

2323
/*!
@@ -32,7 +32,7 @@ import QtQuick.Layouts 1.15
3232
geoview is removed from the given map/scene and replaced with the basemap selected in the gallery.
3333
*/
3434

35-
Control {
35+
Pane {
3636
id: basemapGallery
3737

3838
/*!
@@ -76,6 +76,12 @@ Control {
7676
*/
7777
property var portal;
7878

79+
onPortalChanged: {
80+
if (controller) {
81+
controller.portal = portal;
82+
}
83+
}
84+
7985
/*!
8086
\qmlproperty GenericListModel gallery
8187
The list of basemaps currently visible in the gallery. Items added or removed from this
@@ -121,22 +127,15 @@ Control {
121127
}
122128
}
123129

124-
background: Rectangle {
125-
color: basemapGallery.palette.base
126-
}
130+
padding: 0
127131

128132
Binding {
133+
restoreMode: Binding.RestoreNone
129134
target: controller
130135
property: "portal"
131136
value: portal
132137
}
133138

134-
Binding {
135-
target: basemapGallery
136-
property: "portal"
137-
value: controller.portal
138-
}
139-
140139
Binding {
141140
target: controller
142141
property: "geoView"
@@ -159,7 +158,7 @@ Control {
159158
return controller.setCurrentBasemap(...args);
160159
}
161160

162-
contentItem: GridView {
161+
contentItem: GridView {
163162
id: view
164163
model: controller.gallery
165164
cellWidth: basemapGallery.internal.calculatedStyle === BasemapGallery.ViewStyle.Grid ? basemapGallery.internal.defaultCellWidthGrid
@@ -175,7 +174,7 @@ Control {
175174
height: view.cellHeight
176175
enabled: controller.basemapMatchesCurrentSpatialReference(modelData.basemap)
177176
ToolTip.visible: allowTooltips && mouseArea.containsMouse && modelData.tooltip !== ""
178-
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
177+
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval * 2
179178
ToolTip.text: modelData.tooltip
180179
GridLayout {
181180
anchors.fill: parent

uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryController.qml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
******************************************************************************/
16-
import QtQml 2.12
16+
import QtQml 2.15
1717
import Esri.ArcGISRuntime 100.12
1818
import QtQml.Models 2.15
1919

@@ -41,7 +41,6 @@ QtObject {
4141
*/
4242
property Portal portal: Portal {
4343
url: "https://arcgis.com"
44-
4544
// On startup with the default portal,
4645
// get the developer basemaps.
4746
Component.onCompleted: {
@@ -226,21 +225,24 @@ QtObject {
226225
property var currentBasemap: null;
227226

228227
property Binding mapBinding: Binding {
229-
when: geoView !== null && geoView.map !== undefined
228+
restoreMode: Binding.RestoreNone
229+
when: geoView && geoView.map !== undefined
230230
target: internal
231231
property: "currentBasemap"
232-
value: geoView.map.basemap
232+
value: geoView === null ? null : geoView.map ? geoView.map.basemap : null
233233
}
234234

235235
property Binding sceneBinding: Binding {
236-
when: geoView !== null && geoView.scene !== undefined
236+
restoreMode: Binding.RestoreNone
237+
when: geoView && geoView.scene !== undefined
237238
target: internal
238239
property: "currentBasemap"
239-
value: geoView.scene ? geoView.scene.basemap : null
240+
value: geoView === null ? null : geoView.scene ? geoView.scene.basemap : null
240241
}
241242

242243
property Binding nullBinding: Binding {
243-
when: geoView === null
244+
restoreMode: Binding.RestoreNone
245+
when: !geoView
244246
target: internal
245247
property: "currentBasemap"
246248
value: null

uitools/import/Esri/ArcGISRuntime/Toolkit/Controller/BasemapGalleryItem.qml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ import QtQml 2.12
1717
import QtQuick 2.12
1818
import Esri.ArcGISRuntime 100.12
1919

20+
/*!
21+
\qmltype BasemapGalleryItem
22+
\inqmlmodule Esri.ArcGISRuntime.Toolkit
23+
\since Esri.ArcGISRutime 100.12
24+
\ingroup ArcGISQtToolkitUiQmlControllers
25+
\brief Represents the contents of a BasemapGallery. Can be accessed via
26+
\c{BasemapGalleryController.gallery}.
27+
28+
The BasemapGalleryItem is a wrapper around a Basemap, along with any additional
29+
meta-information.
30+
31+
The BasemapGalleryItem allows for the optional application of a thumbnail and tooltip,
32+
which override the given thumbnail/tooltip of the Basemap.
33+
34+
This is handy when creating Basemaps on the fly from a BasemapStyle or other means, as
35+
these basemaps do not come with a thumbnail or tooltip by default.
36+
*/
37+
38+
2039
QtObject {
2140
id: galleryItem
2241
/*!

uitools/import/Esri/ArcGISRuntime/Toolkit/OverviewMap.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ Item {
4949
*/
5050
property real scaleFactor: 25;
5151

52+
implicitWidth: 300
53+
54+
implicitHeight: 200
55+
5256
children: [
5357
controller.insetView
5458
]

0 commit comments

Comments
 (0)