diff --git a/lib_source/qml/RibbonBlur.qml b/lib_source/qml/RibbonBlur.qml index 114de50..c0f8674 100644 --- a/lib_source/qml/RibbonBlur.qml +++ b/lib_source/qml/RibbonBlur.qml @@ -18,8 +18,10 @@ Rectangle { sourceRect: target_rect sourceItem: target layer.enabled: true - layer.effect: FastBlur{ + layer.effect: GaussianBlur{ radius: blur_radius + deviation: 8 + samples: (radius / 4) * 3 } } Rectangle{ @@ -29,13 +31,4 @@ Rectangle { opacity: mask_opacity radius: control.radius } -// ShaderEffect{ -// id:blur -// anchors.fill: parent -// property var src: effect -// property int radius: blur_radius -// property real deviation: 8 -// property var pixelStep: Qt.vector2d(1/src.width, 1/src.height) -// fragmentShader: "qrc:/RibbonUI/effects/gaussianblur.frag.qsb" -// } } diff --git a/lib_source/qml/RibbonView.qml b/lib_source/qml/RibbonView.qml index e2aa8a4..5314396 100644 --- a/lib_source/qml/RibbonView.qml +++ b/lib_source/qml/RibbonView.qml @@ -12,6 +12,10 @@ Item { property int spacing: 5 property int top_padding: 0 property int bottom_padding: 0 + property double pull_threshold: 10 + property alias flickview: flickview + signal pull_up_triggered() + signal pull_down_triggered() z:-2 clip: true anchors{ @@ -84,7 +88,51 @@ Item { target_rect: Qt.rect(x,y-top_padding,width,height) } + Timer + { + id: timer + property int type: 0 + interval:200 + repeat: false + onTriggered: { + if (type == 1) + pull_up_triggered() + else if (type == 2) + pull_down_triggered() + type = 0 + } + } + + states: [ + State { + id: pull_up + name: "pullUp"; when: (flickview.contentY < -pull_threshold) + StateChangeScript { + name: "pullUp_func" + script: { + timer.type = 1 + timer.start() + } + } + }, + State { + id: pull_bottom + name: "pullBottom"; when: (flickview.contentHeight > 0) && (flickview.contentY > (flickview.contentHeight - flickview.height + pull_threshold)) + StateChangeScript { + name: "pullBottom_func" + script: { + timer.type = 2 + timer.start() + } + } + } + ] + + function scroll_to_up(){ + flickview.contentY = flickview.height + } + function scroll_to_bottom(){ - flickview.contentY = flickview.contentHeight - flickview.height + flickview.contentY = flickview.contentHeight > flickview.height ? flickview.contentHeight - flickview.height : flickview.contentY } }