Touch: Add scroll decorator
This commit is contained in:
parent
84dc9cbf01
commit
34c37870a9
5 changed files with 44 additions and 0 deletions
|
@ -59,5 +59,7 @@ SlidePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PScrollDecorator { flickable: flickable }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,5 +28,7 @@ ListView {
|
||||||
property string title
|
property string title
|
||||||
|
|
||||||
header: SlidePageHeader { title: pListView.title }
|
header: SlidePageHeader { title: pListView.title }
|
||||||
|
|
||||||
|
PScrollDecorator { flickable: pListView }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
34
touch/PScrollDecorator.qml
Normal file
34
touch/PScrollDecorator.qml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* gPodder QML UI Reference Implementation
|
||||||
|
* Copyright (c) 2013, Thomas Perl <m@thp.io>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
property var flickable
|
||||||
|
|
||||||
|
x: flickable.width - width
|
||||||
|
y: flickable.visibleArea.yPosition * flickable.height
|
||||||
|
width: 5 * pgst.scalef
|
||||||
|
height: flickable.visibleArea.heightRatio * flickable.height
|
||||||
|
visible: flickable.visibleArea.heightRatio < 1
|
||||||
|
color: '#ffffff'
|
||||||
|
opacity: flickable.moving ? .2 : 0
|
||||||
|
Behavior on opacity { PropertyAnimation { duration: 100 } }
|
||||||
|
}
|
|
@ -117,4 +117,6 @@ SlidePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PScrollDecorator { flickable: flickable }
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,8 @@ SlidePage {
|
||||||
}
|
}
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
|
id: flickable
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: py
|
target: py
|
||||||
onReadyChanged: {
|
onReadyChanged: {
|
||||||
|
@ -235,5 +237,7 @@ SlidePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PScrollDecorator { flickable: flickable }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue