Change default value of enabled property in ListItem Plasma Component

Also adds documentation for the enabled property.

Signed-off-by: Daker Fernandes Pinheiro <daker.pinheiro@openbossa.org>
This commit is contained in:
Daker Fernandes Pinheiro 2012-03-23 20:52:40 -03:00
parent af7ec4df34
commit 5b452bfb9a

View File

@ -35,12 +35,18 @@ Properties:
* bool sectionDelegate: * bool sectionDelegate:
If true the item will be a delegate for a section, so will look like a "title" for the otems under it. If true the item will be a delegate for a section, so will look like a "title" for the otems under it.
* bool enabled:
Holds if the item emits signals related to mouse interaction.
The default value is false.
Signals: Signals:
* clicked(): * clicked():
This handler is called when there is a click. This handler is called when there is a click.
This is disabled by default, use enable property to activate it.
* pressAndHold(): * pressAndHold():
The user pressed the item with the mouse and didn't release it for a certain amount of time. The user pressed the item with the mouse and didn't release it for a certain amount of time.
This is disabled by default, use enable property to activate it.
**/ **/
import QtQuick 1.0 import QtQuick 1.0
@ -51,7 +57,7 @@ Item {
default property alias content: paddingItem.data default property alias content: paddingItem.data
//this defines if the item will emit clicked and look pressed on mouse down //this defines if the item will emit clicked and look pressed on mouse down
property bool enabled: false property alias enabled: itemMouse.enabled
//item has been clicked or pressed+hold //item has been clicked or pressed+hold
signal clicked signal clicked
signal pressAndHold signal pressAndHold
@ -73,6 +79,7 @@ Item {
onCheckedChanged: background.prefix = (listItem.checked ? "pressed" : "normal") onCheckedChanged: background.prefix = (listItem.checked ? "pressed" : "normal")
onSectionDelegateChanged: background.prefix = (listItem.sectionDelegate ? "section" : "normal") onSectionDelegateChanged: background.prefix = (listItem.sectionDelegate ? "section" : "normal")
} }
PlasmaCore.FrameSvgItem { PlasmaCore.FrameSvgItem {
id : background id : background
imagePath: "widgets/listitem" imagePath: "widgets/listitem"
@ -99,7 +106,7 @@ Item {
id: itemMouse id: itemMouse
property bool changeBackgroundOnPress: !listItem.checked && !listItem.sectionDelegate property bool changeBackgroundOnPress: !listItem.checked && !listItem.sectionDelegate
anchors.fill: background anchors.fill: background
enabled: listItem.enabled enabled: false
onClicked: listItem.clicked() onClicked: listItem.clicked()
onPressAndHold: listItem.pressAndHold() onPressAndHold: listItem.pressAndHold()