Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/package/contents/ui/ItemGridDelegate.qml
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 53 | function actionTriggered(actionId, actionArgument) { | |||
---|---|---|---|---|---|
56 | if (close) { | 56 | if (close) { | ||
57 | root.toggle(); | 57 | root.toggle(); | ||
58 | } | 58 | } | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | PlasmaCore.IconItem { | 61 | PlasmaCore.IconItem { | ||
62 | id: icon | 62 | id: icon | ||
63 | 63 | | |||
64 | y: showLabel ? (2 * highlightItemSvg.margins.top) : undefined | 64 | y: showLabel ? highlightItemSvg.margins.top : undefined | ||
65 | 65 | | |||
66 | anchors.horizontalCenter: parent.horizontalCenter | 66 | anchors.horizontalCenter: parent.horizontalCenter | ||
67 | anchors.verticalCenter: showLabel ? undefined : parent.verticalCenter | 67 | anchors.verticalCenter: showLabel ? undefined : parent.verticalCenter | ||
68 | 68 | | |||
69 | width: iconSize | 69 | width: iconSize | ||
70 | height: width | 70 | height: width | ||
71 | 71 | | |||
72 | colorGroup: PlasmaCore.Theme.ComplementaryColorGroup | 72 | colorGroup: PlasmaCore.Theme.ComplementaryColorGroup | ||
Show All 11 Lines | 80 | PlasmaComponents.Label { | |||
84 | 84 | | |||
85 | anchors { | 85 | anchors { | ||
86 | top: icon.bottom | 86 | top: icon.bottom | ||
87 | topMargin: units.smallSpacing | 87 | topMargin: units.smallSpacing | ||
88 | left: parent.left | 88 | left: parent.left | ||
89 | leftMargin: highlightItemSvg.margins.left | 89 | leftMargin: highlightItemSvg.margins.left | ||
90 | right: parent.right | 90 | right: parent.right | ||
91 | rightMargin: highlightItemSvg.margins.right | 91 | rightMargin: highlightItemSvg.margins.right | ||
92 | bottom: parent.bottom | ||||
93 | bottomMargin: highlightItemSvg.margins.bottom | ||||
92 | } | 94 | } | ||
93 | 95 | | |||
94 | horizontalAlignment: Text.AlignHCenter | 96 | horizontalAlignment: Text.AlignHCenter | ||
97 | verticalAlignment: Text.AlignTop | ||||
95 | 98 | | |||
96 | maximumLineCount: 2 | 99 | maximumLineCount: 2 | ||
97 | elide: Text.ElideRight | 100 | elide: Text.ElideRight | ||
98 | wrapMode: Text.Wrap | 101 | wrapMode: Text.Wrap | ||
99 | 102 | | |||
100 | color: "white" // FIXME TODO: Respect theming? | 103 | color: "white" // FIXME TODO: Respect theming? | ||
101 | 104 | | |||
102 | text: ("name" in model ? model.name : model.display) | 105 | text: ("name" in model ? model.name : model.display) | ||
103 | } | 106 | } | ||
104 | 107 | | |||
105 | PlasmaCore.ToolTipArea { | 108 | PlasmaCore.ToolTipArea { | ||
106 | id: toolTip | 109 | id: toolTip | ||
107 | 110 | | |||
108 | property string text: model.display | 111 | property string text: model.display | ||
109 | 112 | | |||
110 | anchors.fill: parent | 113 | anchors.fill: parent | ||
111 | active: root.visible && label.truncated | 114 | active: root.visible && label.truncated | ||
112 | mainItem: toolTipDelegate | 115 | mainItem: toolTipDelegate | ||
113 | } | 116 | } | ||
114 | 117 | | |||
hein: What do the hover changes do in this patch? :) | |||||
trmdi: It helps to display the tooltip. | |||||
115 | Keys.onPressed: { | 118 | Keys.onPressed: { | ||
116 | if (event.key == Qt.Key_Menu && hasActionList) { | 119 | if (event.key == Qt.Key_Menu && hasActionList) { | ||
117 | event.accepted = true; | 120 | event.accepted = true; | ||
118 | openActionMenu(item); | 121 | openActionMenu(item); | ||
119 | } else if ((event.key == Qt.Key_Enter || event.key == Qt.Key_Return)) { | 122 | } else if ((event.key == Qt.Key_Enter || event.key == Qt.Key_Return)) { | ||
120 | event.accepted = true; | 123 | event.accepted = true; | ||
121 | 124 | | |||
122 | if ("trigger" in GridView.view.model) { | 125 | if ("trigger" in GridView.view.model) { | ||
123 | GridView.view.model.trigger(index, "", null); | 126 | GridView.view.model.trigger(index, "", null); | ||
124 | root.toggle(); | 127 | root.toggle(); | ||
125 | } | 128 | } | ||
126 | 129 | | |||
127 | itemGrid.itemActivated(index, "", null); | 130 | itemGrid.itemActivated(index, "", null); | ||
128 | } | 131 | } | ||
129 | } | 132 | } | ||
130 | } | 133 | } |
What do the hover changes do in this patch? :)