summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/mobilecomponents/IconGrid.qml
diff options
context:
space:
mode:
authorGravatar Sebastian Kügler <sebas@kde.org>2015-12-04 00:27:35 +0100
committerGravatar Sebastian Kügler <sebas@kde.org>2015-12-07 18:46:32 +0100
commitb6f5f235f0ab3c84e960f2cf46e542592195abbf (patch)
tree9bee0cc96f0eafb2febda9974d39279008155603 /qt-mobile/qml/mobilecomponents/IconGrid.qml
parent72411eee63fba5cfba5a97e438e5c494fa928fd0 (diff)
downloadsubsurface-b6f5f235f0ab3c84e960f2cf46e542592195abbf.tar.gz
sync with mobilecomponents 9d8bf6d77d
- Fixes interactivity in context drawer. - These are mostly cleanups that have been done pre-merge of these components. This now is the state of master in plasma-mobile. - makes navigation a bit more intuitive Signed-off-by: Sebastian Kügler <sebas@kde.org>
Diffstat (limited to 'qt-mobile/qml/mobilecomponents/IconGrid.qml')
-rw-r--r--qt-mobile/qml/mobilecomponents/IconGrid.qml37
1 files changed, 18 insertions, 19 deletions
diff --git a/qt-mobile/qml/mobilecomponents/IconGrid.qml b/qt-mobile/qml/mobilecomponents/IconGrid.qml
index f3f8f1c09..1a6acbc1d 100644
--- a/qt-mobile/qml/mobilecomponents/IconGrid.qml
+++ b/qt-mobile/qml/mobilecomponents/IconGrid.qml
@@ -28,11 +28,11 @@ Item {
property Component delegate
property QtObject model
- property int pageSize: Math.floor(iconView.width/main.delegateWidth)*Math.floor(iconView.height/main.delegateHeight)
- property int delegateWidth: Units.iconSizes.huge + Units.gridUnit*2
- property int delegateHeight: Units.iconSizes.huge + Units.gridUnit*2
+ property int pageSize: Math.floor(iconView.width / main.delegateWidth) * Math.floor(iconView.height / main.delegateHeight)
+ property int delegateWidth: Units.iconSizes.huge + Units.gridUnit * 2
+ property int delegateHeight: Units.iconSizes.huge + Units.gridUnit * 2
property alias currentPage: iconView.currentIndex
- property int pagesCount: Math.ceil(model.count/pageSize)
+ property int pagesCount: Math.ceil(model.count / pageSize)
property int count: model.count
property alias contentX: iconView.contentX
clip: true
@@ -47,7 +47,7 @@ Item {
running: true
interval: 100
onTriggered: {
- main.pageSize = Math.floor(iconView.width/main.delegateWidth)*Math.floor(iconView.height/main.delegateHeight)
+ main.pageSize = Math.floor(iconView.width / main.delegateWidth) * Math.floor(iconView.height / main.delegateHeight)
if (iconView.currentItem) {
iconView.currentItem.width = iconView.width
iconView.currentItem.height = iconView.height
@@ -59,8 +59,8 @@ Item {
id: iconView
objectName: "iconView"
pressDelay: 200
- cacheBuffer: 100
- highlightMoveDuration: 250
+ cacheBuffer: Units.gridUnit * 8
+ highlightMoveDuration: Units.shortDuration
anchors.fill: parent
onWidthChanged: resizeTimer.restart()
onHeightChanged: resizeTimer.restart()
@@ -103,8 +103,8 @@ Item {
Repeater {
id: iconRepeater
model: pagedProxyModel
- property int columns: Math.min(count, Math.floor(delegatePage.width/main.delegateWidth))
- property int suggestedWidth: main.delegateWidth*columns
+ property int columns: Math.min(count, Math.floor(delegatePage.width / main.delegateWidth))
+ property int suggestedWidth: main.delegateWidth * columns
//property int suggestedHeight: main.delegateHeight*Math.floor(count/columns)
delegate: main.delegate
@@ -123,7 +123,7 @@ Item {
right: parent.right
bottom: parent.bottom
}
- height: Math.max( 16, iconView.height - Math.floor(iconView.height/delegateHeight)*delegateHeight)
+ height: Math.max(16, iconView.height - Math.floor(iconView.height / delegateHeight) * delegateHeight)
property int pageCount: main.model ? Math.ceil(main.model.count/main.pageSize) : 0
@@ -145,15 +145,14 @@ Item {
Rectangle {
id: barRectangle
color: Theme.textColor
- opacity: 2.05
height: 4
radius: 2
anchors {
left: parent.left
right: parent.right
verticalCenter: parent.verticalCenter
- leftMargin: (parent.width/pageCount/2)
- rightMargin: (parent.width/pageCount/2)
+ leftMargin: (parent.width / pageCount / 2)
+ rightMargin: (parent.width / pageCount / 2)
}
}
Rectangle {
@@ -162,10 +161,10 @@ Item {
width: height
radius: 4
anchors.verticalCenter: parent.verticalCenter
- x: parent.width/(pageCount/(iconView.currentIndex+1)) - (parent.width/pageCount/2) - 4
+ x: parent.width / (pageCount / (iconView.currentIndex+1)) - (parent.width / pageCount / 2) - 4
Behavior on x {
NumberAnimation {
- duration: 250
+ duration: Units.shortDuration
easing.type: Easing.InOutQuad
}
}
@@ -192,7 +191,7 @@ Item {
Item {
Row {
anchors.centerIn: parent
- spacing: 20
+ spacing: units.gridUnit
Repeater {
model: scrollArea.pageCount
@@ -209,13 +208,13 @@ Item {
Behavior on scale {
NumberAnimation {
- duration: 250
+ duration: units.shortDuration
easing.type: Easing.InOutQuad
}
}
Behavior on opacity {
NumberAnimation {
- duration: 250
+ duration: units.shortDuration
easing.type: Easing.InOutQuad
}
}
@@ -223,7 +222,7 @@ Item {
MouseArea {
anchors {
fill: parent
- margins: -10
+ margins: Units.gridUnit / 2
}
onClicked: {