diff options
author | Egor Nemtsev <enemtsev@luxoft.com> | 2019-02-12 10:08:04 +0300 |
---|---|---|
committer | Egor Nemtsev <enemtsev@luxoft.com> | 2019-02-14 07:50:45 +0000 |
commit | 389be411c2464017812df01c6c3a076b809c95ed (patch) | |
tree | 19a463418f0ba3bee18d482390beda0f897d3425 | |
parent | 6b8fd1308632be04d2d4348de08a616bfa4a4a4c (diff) |
[controls] fix ScalableBorderImage wrong sizes made app crash
When any border size exceeds or equals to source image size application crashes
Change-Id: I311abdc4b4c3fe200ca191db76161473d5a0346c
Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
-rw-r--r-- | apps/com.pelagicore.map/panels/HeaderBackgroundMaximizedPanel.qml | 22 | ||||
-rw-r--r-- | apps/com.pelagicore.map/views/MapView.qml | 11 | ||||
-rw-r--r-- | apps/com.pelagicore.music/Main.qml | 4 | ||||
-rw-r--r-- | apps/com.pelagicore.phone/Main.qml | 12 | ||||
-rw-r--r-- | imports_system/system/controls/+lucee/PopupItem.qml | 15 | ||||
-rw-r--r-- | imports_system/system/controls/PopupItem.qml | 14 | ||||
-rw-r--r-- | styles/lucee/TabButton.qml | 9 | ||||
-rw-r--r-- | sysui/home/AbstractApplicationWidget.qml | 6 |
8 files changed, 67 insertions, 26 deletions
diff --git a/apps/com.pelagicore.map/panels/HeaderBackgroundMaximizedPanel.qml b/apps/com.pelagicore.map/panels/HeaderBackgroundMaximizedPanel.qml index 488ca4e3..e3d5ad9e 100644 --- a/apps/com.pelagicore.map/panels/HeaderBackgroundMaximizedPanel.qml +++ b/apps/com.pelagicore.map/panels/HeaderBackgroundMaximizedPanel.qml @@ -60,10 +60,12 @@ Item { : Sizes.dp(sourceSize.height) source: Helper.localAsset("panel-shadow", Style.theme) border { + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here left: 0 - top: Sizes.dp(101) - right: Sizes.dp(101) - bottom: Sizes.dp(106) + top: 101 + right: 101 + bottom: 106 } } @@ -76,10 +78,12 @@ Item { source: Helper.localAsset("panel-more-contrast-background", Style.theme) visible: !root.navigationMode || root.guidanceMode border { + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here left: 0 - top: Sizes.dp(20) - right: Sizes.dp(32) - bottom: Sizes.dp(22) + top: 20 + right: 20 + bottom: 22 } } @@ -102,9 +106,11 @@ Item { Sizes.dp(destinationButtonsPanel.sourceSize.height) - root.destinationButtonrowHeight source: Helper.localAsset("panel-background", Style.theme) border { + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here left: 0 - top: Sizes.dp(20) - right: Sizes.dp(22) + top: 20 + right: 22 bottom: 0 } } diff --git a/apps/com.pelagicore.map/views/MapView.qml b/apps/com.pelagicore.map/views/MapView.qml index 4e0b7895..9904f785 100644 --- a/apps/com.pelagicore.map/views/MapView.qml +++ b/apps/com.pelagicore.map/views/MapView.qml @@ -161,10 +161,13 @@ Item { NeptuneControls.ScalableBorderImage { id: overlay anchors.fill: root - border.top: Sizes.dp(322) - border.bottom: Sizes.dp(323) - border.left: 0 - border.right: 0 + border { + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here + top: 320 + left: 0 + right: 0 + } source: Style.image("input-overlay") visible: root.store.searchViewEnabled } diff --git a/apps/com.pelagicore.music/Main.qml b/apps/com.pelagicore.music/Main.qml index 94517e7b..66c2e041 100644 --- a/apps/com.pelagicore.music/Main.qml +++ b/apps/com.pelagicore.music/Main.qml @@ -68,7 +68,9 @@ QtObject { y: mainWindow.exposedRect.y - Sizes.dp(224) width: mainWindow.exposedRect.width height: musicAppContent.fullscreenTopHeight + mainWindow.exposedRect.y - y - border.top: sourceSize.height - Sizes.dp(1) + //don't change this values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes + border.top: sourceSize.height - 1 opacity: (mainWindow.neptuneState === "Maximized") ? 1.0 : 0.0 Behavior on opacity { DefaultNumberAnimation {} } diff --git a/apps/com.pelagicore.phone/Main.qml b/apps/com.pelagicore.phone/Main.qml index dcaefb95..003ae134 100644 --- a/apps/com.pelagicore.phone/Main.qml +++ b/apps/com.pelagicore.phone/Main.qml @@ -68,10 +68,14 @@ ApplicationCCWindow { width: root.exposedRect.width height: Math.max(Sizes.dp(sourceSize.height), Sizes.dp(660 - 224) + root.exposedRect.y) - border.bottom: 0 - border.top: height - Sizes.dp(1) - border.left: 0 - border.right: 0 + border{ + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here + bottom: 0 + top: sourceSize.height - 1 + left: 0 + right: 0 + } opacity: (root.neptuneState === "Maximized") ? 1.0 : 0.0 Behavior on opacity { DefaultNumberAnimation {} } diff --git a/imports_system/system/controls/+lucee/PopupItem.qml b/imports_system/system/controls/+lucee/PopupItem.qml index 6a27f17b..fbb36555 100644 --- a/imports_system/system/controls/+lucee/PopupItem.qml +++ b/imports_system/system/controls/+lucee/PopupItem.qml @@ -46,6 +46,8 @@ AbstractPopupItem { visible: root.headerBackgroundVisible source: Style.image("floating-panel-top-bg") border { + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here left: 56 top: 55 right: 56 @@ -59,10 +61,15 @@ AbstractPopupItem { anchors.rightMargin: Sizes.dp(-7) anchors.topMargin: Sizes.dp(-7) anchors.bottomMargin: Sizes.dp(-7) - border.left: 69 - border.right: 69 - border.top: 65 - border.bottom: 67 + + border{ + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here + left: 69 + right: 69 + top: 65 + bottom: 67 + } // click eater MouseArea { diff --git a/imports_system/system/controls/PopupItem.qml b/imports_system/system/controls/PopupItem.qml index 13d5ca2d..119e3825 100644 --- a/imports_system/system/controls/PopupItem.qml +++ b/imports_system/system/controls/PopupItem.qml @@ -47,6 +47,8 @@ AbstractPopupItem { visible: root.headerBackgroundVisible source: Style.image("floating-panel-top-bg") border { + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here left: 20 top: 30 right: 20 @@ -60,10 +62,14 @@ AbstractPopupItem { anchors.rightMargin: Sizes.dp(-40) anchors.topMargin: Sizes.dp(-28) anchors.bottomMargin: Sizes.dp(-52) - border.left: 70 - border.right: 70 - border.top: 50 - border.bottom: 90 + border{ + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here + left: 70 + right: 70 + top: 50 + bottom: 90 + } // click eater MouseArea { diff --git a/styles/lucee/TabButton.qml b/styles/lucee/TabButton.qml index 027b79bf..39080703 100644 --- a/styles/lucee/TabButton.qml +++ b/styles/lucee/TabButton.qml @@ -93,6 +93,9 @@ T.TabButton { name: "left" PropertyChanges { target: borderImage + + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here border.left: 26 border.right: 0 border.top: 22 @@ -103,6 +106,9 @@ T.TabButton { name: "right" PropertyChanges { target: borderImage + + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here border.left: 0 border.right: 30 - 5 border.top: 22 @@ -113,6 +119,9 @@ T.TabButton { name: "middle" PropertyChanges { target: borderImage + + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here border.left: 0 border.right: 0 border.top: 0 diff --git a/sysui/home/AbstractApplicationWidget.qml b/sysui/home/AbstractApplicationWidget.qml index e479b47c..ba76b0c6 100644 --- a/sysui/home/AbstractApplicationWidget.qml +++ b/sysui/home/AbstractApplicationWidget.qml @@ -76,7 +76,11 @@ Item { anchors.rightMargin: root.widgetRightMargin anchors.topMargin: root.widgetTopMargin anchors.bottomMargin: root.widgetBottomMargin - border { left: 160; right: 160; top: 160; bottom: 160 } + border { + //don't change these values without knowing the exact size of source image + //QTBUG-73768 if border exceeds source image size, app crashes, avoid Sizes.dp here + left: 160; right: 160; top: 160; bottom: 160 + } horizontalTileMode: BorderImage.Stretch verticalTileMode: BorderImage.Stretch source: Style.image("widget-dragged-bg") |