Skip to content

Commit 8e257af

Browse files
committed
Merge branch 'v.next' into james/targetScale
2 parents 9f61ef1 + 1b16173 commit 8e257af

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

Imports/ArcGIS/Runtime/Toolkit/Controls.2.0/Callout.qml

100644100755
Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ Item {
299299
// these are some of the initial calculations
300300
// before creating the callout frame
301301
preCalculateWidthAndHeight();
302-
adjustRelativePositionOfCanvasFrame(anchorPointx, anchorPointy);
302+
if (platform == "ios")
303+
adjustRelativePositionOfCanvasFrame(anchorPointx, anchorPointy, calloutLayout.width - 2*cornerRadius, calloutLayout.height - cornerRadius);
304+
else
305+
adjustRelativePositionOfCanvasFrame(anchorPointx, anchorPointy, rectWidth, rectHeight);
303306

304307
if (leaderPosition !== Enums.LeaderPosition.Automatic)
305308
adjustedLeaderPosition = leaderPosition;
@@ -310,7 +313,11 @@ Item {
310313

311314
// once leader position is finalized
312315
if (findBestLeaderPosition(anchorPointx, anchorPointy)) {
313-
adjustRelativePositionOfCanvasFrame(anchorPointx, anchorPointy);
316+
if (platform == "ios")
317+
adjustRelativePositionOfCanvasFrame(anchorPointx, anchorPointy, calloutLayout.width - 2*cornerRadius, calloutLayout.height - cornerRadius);
318+
else
319+
adjustRelativePositionOfCanvasFrame(anchorPointx, anchorPointy, rectWidth, rectHeight);
320+
314321

315322
}
316323

@@ -376,7 +383,7 @@ Item {
376383
anchors {
377384
left: parent.left
378385
top: parent.top
379-
}
386+
}
380387
columnSpacing: 7 * scaleFactor
381388

382389
Rectangle {
@@ -868,36 +875,36 @@ Item {
868875
}
869876

870877
/*! \internal */
871-
function adjustRelativePositionOfCanvasFrame(screenx, screeny) {
878+
function adjustRelativePositionOfCanvasFrame(screenx, screeny, calloutWidth, calloutHeight) {
872879

873880
if (adjustedLeaderPosition === Enums.LeaderPosition.Top ) {
874881
calloutContentFrame.anchors.topMargin = leaderHeight;
875-
calloutFrame.x = screenx - rectWidth / 2;
882+
calloutFrame.x = screenx - calloutWidth / 2;
876883
calloutFrame.y = screeny;
877884
if (debug) {
878885
console.log("top calloutFrame = " , calloutFrame.x, " ", calloutFrame.y);
879886
}
880887
} else if (adjustedLeaderPosition === Enums.LeaderPosition.Bottom) {
881-
calloutFrame.x = screenx - (rectWidth / 2);
882-
calloutFrame.y = screeny - (leaderHeight + rectHeight );
888+
calloutFrame.x = screenx - (calloutWidth / 2);
889+
calloutFrame.y = screeny - (leaderHeight + calloutHeight);
883890
if (debug) {
884891
console.log("bottom calloutFrame = " , calloutFrame.x, " ", calloutFrame.y);
885892
}
886893
} else if (adjustedLeaderPosition === Enums.LeaderPosition.Left) {
887894
calloutContentFrame.anchors.leftMargin = leaderHeight;
888895
calloutFrame.x = screenx;
889-
calloutFrame.y = screeny - rectHeight / 2;
896+
calloutFrame.y = screeny - calloutHeight / 2;
890897
if (debug) {
891898
console.log("left calloutFrame = " , calloutFrame.x, " ", calloutFrame.y);
892899
}
893900
} else if (adjustedLeaderPosition === Enums.LeaderPosition.Right) {
894-
calloutFrame.x = screenx - (rectWidth + leaderWidth);
895-
calloutFrame.y = screeny - rectHeight / 2;
901+
calloutFrame.x = screenx - (calloutWidth + leaderHeight);
902+
calloutFrame.y = screeny - calloutHeight / 2;
896903
if (debug) {
897904
console.log("right calloutFrame = " , calloutFrame.x, " ", calloutFrame.y);
898905
}
899906
} else if (adjustedLeaderPosition === Enums.LeaderPosition.UpperRight) {
900-
calloutFrame.x = screenx - leaderWidth / 2 - (rectWidth - leaderWidth);
907+
calloutFrame.x = screenx - leaderWidth / 2 - (calloutWidth - leaderWidth);
901908
calloutFrame.y = screeny;
902909
if (debug) {
903910
console.log("upper right top right calloutFrame = " , calloutFrame.x, " ", calloutFrame.y);
@@ -909,14 +916,14 @@ Item {
909916
console.log("upper left calloutFrame = " , calloutFrame.x, " ", calloutFrame.y);
910917
}
911918
} else if (adjustedLeaderPosition === Enums.LeaderPosition.LowerRight) {
912-
calloutFrame.x = screenx - rectWidth + leaderWidth / 2;
913-
calloutFrame.y = screeny - (leaderHeight + rectHeight);
919+
calloutFrame.x = screenx - calloutWidth + leaderWidth / 2;
920+
calloutFrame.y = screeny - (leaderHeight + calloutHeight);
914921
if (debug) {
915922
console.log("lower right calloutFrame = " , calloutFrame.x, " ", calloutFrame.y);
916923
}
917924
} else if (adjustedLeaderPosition === Enums.LeaderPosition.LowerLeft) {
918925
calloutFrame.x = screenx - leaderWidth / 2;
919-
calloutFrame.y = screeny - (leaderHeight + rectHeight);
926+
calloutFrame.y = screeny - (leaderHeight + calloutHeight);
920927
if (debug) {
921928
console.log("lower left calloutFrame = " , calloutFrame.x, " ", calloutFrame.y);
922929
}

Imports/ArcGIS/Runtime/Toolkit/Dialogs.2.0/AuthenticationView.qml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ Item {
7272
id: authView
7373
anchors.fill: parent
7474

75+
Component.onCompleted: {
76+
var parentsChildren = parent.children;
77+
var maxZ = 0;
78+
for (var i = 0; i < parentsChildren.length; i++){
79+
if (parentsChildren[i] === authView)
80+
continue;
81+
maxZ = Math.max(maxZ, parentsChildren[i].z);
82+
}
83+
authView.z = maxZ + 1; // the view should be shown on top
84+
}
85+
7586
/*!
7687
\brief The AuthenticationManager instance.
7788

0 commit comments

Comments
 (0)