Changeset View
Changeset View
Standalone View
Standalone View
person/org.kde.person/contents/ui/Person.qml
Show All 21 Lines | |||||
22 | 22 | | |||
23 | import org.kde.people 1.0 | 23 | import org.kde.people 1.0 | ||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.components 2.0 as PlasmaComponents | 25 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
26 | import org.kde.plasma.plasmoid 2.0 | 26 | import org.kde.plasma.plasmoid 2.0 | ||
27 | 27 | | |||
28 | PlasmaCore.IconItem { | 28 | PlasmaCore.IconItem { | ||
29 | id: personPhoto | 29 | id: personPhoto | ||
30 | source: personData.person.photo | 30 | property bool isPersonSelected: (personData.personUri != "") | ||
31 | source: isPersonSelected ? personData.person.photo : "user" | ||||
31 | 32 | | |||
32 | property int minActionWidth | 33 | property int minActionWidth | ||
33 | 34 | | |||
34 | function actionTriggered(id) | 35 | function actionTriggered(id) | ||
35 | { | 36 | { | ||
37 | if (isPersonSelected) | ||||
36 | actions.triggerAction(id); | 38 | actions.triggerAction(id); | ||
39 | else | ||||
40 | plasmoid.action("configure").trigger(); | ||||
37 | } | 41 | } | ||
38 | 42 | | |||
39 | MouseArea { | 43 | MouseArea { | ||
40 | anchors.fill: parent | 44 | anchors.fill: parent | ||
41 | 45 | | |||
42 | onClicked: { | 46 | onClicked: { | ||
43 | actionTriggered(0); | 47 | actionTriggered(0); | ||
44 | } | 48 | } | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |