Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/ActionListItem.qml
Show All 13 Lines | |||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
15 | * GNU General Public License for more details. * | 15 | * GNU General Public License for more details. * | ||
16 | * * | 16 | * * | ||
17 | * You should have received a copy of the GNU General Public License * | 17 | * You should have received a copy of the GNU General Public License * | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. * | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
19 | ***************************************************************************/ | 19 | ***************************************************************************/ | ||
20 | 20 | | |||
21 | import QtQuick 2.5 | 21 | import QtQuick 2.5 | ||
22 | import QtQuick.Controls 2.0 | 22 | import QtQuick.Controls 2.5 as QQC2 | ||
23 | import org.kde.kirigami 2.3 as Kirigami | 23 | | ||
24 | import org.kde.kirigami 2.5 as Kirigami | ||||
24 | 25 | | |||
25 | Kirigami.BasicListItem | 26 | Kirigami.BasicListItem | ||
26 | { | 27 | { | ||
27 | id: item | 28 | id: item | ||
28 | property QtObject action: null | 29 | property QtObject action: null | ||
29 | checked: action.checked | 30 | checked: action.checked | ||
30 | icon: action.iconName | 31 | icon: action.iconName | ||
31 | separatorVisible: false | 32 | separatorVisible: false | ||
32 | visible: action.enabled | 33 | visible: action.enabled | ||
33 | onClicked: { | 34 | onClicked: { | ||
34 | drawer.resetMenu() | 35 | drawer.resetMenu() | ||
35 | action.trigger() | 36 | action.trigger() | ||
36 | } | 37 | } | ||
37 | 38 | | |||
38 | Kirigami.MnemonicData.enabled: item.enabled && item.visible | 39 | Kirigami.MnemonicData.enabled: item.enabled && item.visible | ||
39 | Kirigami.MnemonicData.controlType: Kirigami.MnemonicData.MenuItem | 40 | Kirigami.MnemonicData.controlType: Kirigami.MnemonicData.MenuItem | ||
40 | Kirigami.MnemonicData.label: action.text | 41 | Kirigami.MnemonicData.label: action.text | ||
41 | label: Kirigami.MnemonicData.richTextLabel | 42 | label: Kirigami.MnemonicData.richTextLabel | ||
42 | 43 | | |||
43 | ToolTip.visible: hovered | 44 | readonly property var tooltip: QQC2.ToolTip { | ||
44 | ToolTip.text: action.shortcut ? action.shortcut : p0.nativeText | 45 | text: action.shortcut ? action.shortcut : p0.nativeText | ||
46 | } | ||||
apol: It has an indentation too much. | |||||
45 | 47 | | |||
46 | readonly property var p0: Shortcut { | 48 | readonly property var p0: Shortcut { | ||
47 | sequence: item.Kirigami.MnemonicData.sequence | 49 | sequence: item.Kirigami.MnemonicData.sequence | ||
48 | onActivated: item.clicked() | 50 | onActivated: item.clicked() | ||
49 | } | 51 | } | ||
50 | } | 52 | } |
It has an indentation too much.