This repository has been archived on 2023-11-19. You can view files and clone it, but cannot push or open issues or pull requests.
goober-bb10/assets/RefreshItem.qml
2016-10-01 11:18:40 -07:00

32 lines
877 B
QML

import bb.cascades 1.4
Container {
signal refresh
property variant theme : Application.themeSupport.theme.colorTheme.style
Label {
id: label_refresh
text: qsTr("Load Newer")
horizontalAlignment: HorizontalAlignment.Center
}
ImageView {
id: icon_refresh
imageSource: "asset:///icons/refresh.png"
horizontalAlignment: HorizontalAlignment.Center
filterColor: (theme == VisualStyle.Bright) ? Color.Black : false
}
Divider {}
attachedObjects: [
LayoutUpdateHandler {
onLayoutFrameChanged: {
icon_refresh.rotationZ = layoutFrame.y
if (layoutFrame.y >= 0.0 * layoutFrame.height) {
if (layoutFrame.y == 0) {
refresh()
}
}
}
}
]
}