summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-07-23 18:00:32 +0200
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-08-12 17:22:03 +0200
commit949fa37a18b3041397addceabd6e9e85a4637c8c (patch)
tree4f37372be2771a0d758b62f58835796cee1acc24 /src
parent3ee57e669902702614800bea7cd9480e3b4d5891 (diff)
Replace DropShadow effect with a simpler custom implementation
A simpler GaussianBlur shaddow should make the animations smoother.
Diffstat (limited to 'src')
-rw-r--r--src/qml/BrowserWindow.qml3
-rw-r--r--src/qml/PageView.qml46
2 files changed, 31 insertions, 18 deletions
diff --git a/src/qml/BrowserWindow.qml b/src/qml/BrowserWindow.qml
index 07d21ad..d352c92 100644
--- a/src/qml/BrowserWindow.qml
+++ b/src/qml/BrowserWindow.qml
@@ -304,6 +304,7 @@ Item {
id: sslDialog
property var certErrors: []
+ property var currentError: null
icon: StandardIcon.Warning
standardButtons: StandardButton.No | StandardButton.Yes
title: "Server's certificate not trusted"
@@ -327,10 +328,12 @@ Item {
presentError()
}
function enqueue(error){
+ currentError = error
certErrors.push(error)
presentError()
}
function presentError(){
+ informativeText = "SSL error from URL\n\n" + currentError.url + "\n\n" + currentError.description + "\n"
visible = certErrors.length > 0
}
}
diff --git a/src/qml/PageView.qml b/src/qml/PageView.qml
index fafb87b..7236c88 100644
--- a/src/qml/PageView.qml
+++ b/src/qml/PageView.qml
@@ -69,7 +69,7 @@ Rectangle {
Component {
id: tabComponent
- Item {
+ Rectangle {
id: tabItem
property alias webView: webEngineView
property alias title: webEngineView.title
@@ -290,6 +290,7 @@ Rectangle {
function remove(index) {
pathView.interactive = false
pathView.currentItem.state = ""
+ pathView.currentItem.visible = false
// Update indices of remaining items
for (var idx = index + 1; idx < listModel.count; ++idx)
listModel.get(idx).index -= 1
@@ -397,24 +398,35 @@ Rectangle {
pathView.currentIndex = index
}
}
+ Rectangle {
+ id: shadow
+ visible: false
+ property real size: 24
+ anchors {
+ top: parent.top
+ topMargin: 9
+ horizontalCenter: parent.horizontalCenter
+ }
+ color: "#0e202c"
+ radius: size / 2
+ width: snapshot.width
+ height: snapshot.height
+ }
+ GaussianBlur {
+ anchors.fill: shadow
+ source: shadow
+ radius: shadow.size
+ samples: shadow.size * 2
+ opacity: 0.3
+ transparentBorder: true
+ visible: wrapper.visibility == 1.0
+ }
Rectangle {
+ id: snapshot
color: uiColor
- DropShadow {
- id: shadow
- visible: !pathView.moving && !pathView.flicking && wrapper.visibility == 1.0
- anchors.fill: parent
- radius: (30 - (1 / wrapper.scale * 6)) * 2
- verticalOffset: 12
- horizontalOffset: 0
- samples: radius * 2
- color: Qt.rgba(0, 0, 0, 0.3)
- source: snapshot
- }
-
Image {
- id: snapshot
source: {
if (!item.image.snapshot)
return "qrc:///about"
@@ -422,7 +434,7 @@ Rectangle {
}
anchors.fill: parent
Rectangle {
- enabled: index == pathView.currentIndex && shadow.visible
+ enabled: index == pathView.currentIndex && !pathView.moving && !pathView.flicking && wrapper.visibility == 1.0
opacity: enabled ? 1.0 : 0.0
visible: wrapper.visibility == 1.0
width: image.sourceSize.width
@@ -492,14 +504,12 @@ Rectangle {
model: listModel
delegate: delegate
highlightMoveDuration: animationDuration
- flickDeceleration: animationDuration
+ flickDeceleration: animationDuration / 2
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
dragMargin: itemHeight
- snapMode: PathView.SnapToItem
-
focus: interactive
property real offset: 30