1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Welcome page: display the scroll decorator

To give a hint the news list is scrollable
This commit is contained in:
Dmytro Poplavskiy 2012-08-14 23:06:31 +10:00
parent 81d4fd3740
commit 69bd17c6a8
3 changed files with 42 additions and 0 deletions

View File

@ -28,6 +28,10 @@ Item {
clip: true
}
ScrollDecorator {
flickableItem: view
}
XmlListModel {
id: xmlModel
source: "http://www.openpilot.org/feed/"

View File

@ -0,0 +1,37 @@
import QtQuick 1.1
Rectangle {
id: scrollDecorator
property Flickable flickableItem: null
Loader {
sourceComponent: scrollDecorator.flickableItem ? scrollBar : undefined
}
Component {
id: scrollBar
Rectangle {
property Flickable flickable: scrollDecorator.flickableItem
parent: flickable
anchors.right: parent.right
smooth: true
radius: 2
color: "gray"
border.color: "lightgray"
border.width: 1.0
opacity: flickable.moving ? 0.8 : 0.4
Behavior on opacity {
NumberAnimation { duration: 500 }
}
width: 4
height: flickable.height * (flickable.height / flickable.contentHeight)
y: flickable.height * (flickable.contentY / flickable.contentHeight)
visible: flickable.height < flickable.contentHeight
}
}
}

View File

@ -5,6 +5,7 @@
<file>qml/SitesPanel.qml</file>
<file>qml/WelcomePageButton.qml</file>
<file>qml/NewsPanel.qml</file>
<file>qml/ScrollDecorator.qml</file>
<file>qml/images/welcome-news-bg.png</file>
<file>qml/images/welcome-op-logo.png</file>
<file>qml/images/button-label.png</file>