Rename and Fix BusyWidget to BusyIndicator component to fit the common API

- An example also was add in ComponentsGallery.

Signed-off-by: Daker Fernandes Pinheiro <dakerfp@gmail.com>
This commit is contained in:
Daker Fernandes Pinheiro 2011-04-27 06:47:08 -03:00
parent 0a9670b381
commit 56fbe5e67b
3 changed files with 30 additions and 19 deletions

View File

@ -17,25 +17,27 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import Qt 4.7
import QtQuick 1.0
import org.kde.plasma.core 0.1 as PlasmaCore
Item {
id: root
width: 100; height: 100
property bool running: true
property string label: ""
// Common API
property bool running: false
PlasmaCore.Theme {
id: theme
}
// Plasma API
property alias text: label.text
property QtObject theme: PlasmaCore.Theme { }
width: 52; height: 52
PlasmaCore.SvgItem {
id: widget
anchors.centerIn: parent
width: root.width
height: root.height
anchors.horizontalCenter: root.horizontalCenter
smooth: true
svg: PlasmaCore.Svg { imagePath: ("widgets/busywidget") }
@ -47,19 +49,15 @@ Item {
running: root.running
loops: Animation.Infinite
}
// if you need to do anything while repainting
// do it inside this slot
function update() {
}
}
Text {
id: label
text: root.label
color: theme.textColor
anchors.verticalCenter: root.verticalCenter
anchors.horizontalCenter: root.horizontalCenter
}
anchors {
verticalCenter: root.verticalCenter
horizontalCenter: root.horizontalCenter
}
color: theme.textColor
}
}

View File

@ -1,4 +1,4 @@
BusyWidget 0.1 BusyWidget.qml
BusyIndicator 0.1 BusyIndicator.qml
Button 0.1 Button.qml
CheckBox 0.1 CheckBox.qml
FlashingLabel 0.1 FlashingLabel.qml

View File

@ -152,6 +152,19 @@ Rectangle {
}
}
}
Column {
spacing: 20
Text {
font.pixelSize: 20
text: "BusyIndicator"
}
PlasmaComponents.BusyIndicator { }
PlasmaComponents.BusyIndicator { running: true }
}
}
}
}