ScrollDecorator only on Touchscreens

just as a compatibility layer for porting
This commit is contained in:
Marco Martin 2011-11-09 15:28:21 +01:00
parent 7ae1ce52d1
commit 2465d24bb1
5 changed files with 22 additions and 7 deletions

View File

@ -21,14 +21,20 @@
import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
// TODO: add support mouse wheel and key events
/**
* A generic ScrollBar/ScrollDecorator component:
* Qlways prefer this to ScrollDecorator that is not available on desktop.
* By default, this component will look and behave like a scroll decorator on touchscreens
*/
// TODO: add support mouse wheel events
Item {
id: scrollbar
// Common API
property Flickable flickableItem: null
property int orientation: Qt.Vertical
property bool interactive: false
property bool interactive: true
// Plasma API
property bool inverted: false

View File

@ -19,6 +19,10 @@
import QtQuick 1.0
/**
* Just provided for compatibility
* Use ScrollBar instead. will behave like a ScrollDecorator on touchscreens
*/
ScrollBar {
interactive: false
}
}

View File

@ -21,7 +21,13 @@
import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
// TODO: add support mouse wheel and key events
/**
* A generic ScrollBar/ScrollDecorator component:
* Qlways prefer this to ScrollDecorator that is not available on desktop.
* By default, this component will look and behave like a scroll decorator on touchscreens
*/
// TODO: add support mouse wheel events
Item {
id: scrollbar

View File

@ -15,7 +15,6 @@ ProgressBar 0.1 ProgressBar.qml
PushButton 0.1 PushButton.qml
RadioButton 0.1 RadioButton.qml
ScrollBar 0.1 ScrollBar.qml
ScrollDecorator 0.1 ScrollDecorator.qml
Slider 0.1 Slider.qml
Switch 0.1 Switch.qml
TextArea 0.1 TextArea.qml

View File

@ -102,7 +102,7 @@ Column {
}
// Scroll Decorators
PlasmaComponents.ScrollDecorator {
PlasmaComponents.ScrollBar {
orientation: Qt.Vertical
flickableItem: scrollArea
inverted: true
@ -118,7 +118,7 @@ Column {
text: "inverted"
}
}
PlasmaComponents.ScrollDecorator {
PlasmaComponents.ScrollBar {
orientation: Qt.Horizontal
flickableItem: scrollArea
anchors {