Changeset View
Changeset View
Standalone View
Standalone View
sidebar/package/contents/ui/IntroIcon.qml
Show All 17 Lines | |||||
18 | 18 | | |||
19 | import QtQuick 2.1 | 19 | import QtQuick 2.1 | ||
20 | import QtQuick.Layouts 1.1 | 20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 2.0 as QQC2 | 21 | import QtQuick.Controls 2.0 as QQC2 | ||
22 | import org.kde.kirigami 2.1 as Kirigami | 22 | import org.kde.kirigami 2.1 as Kirigami | ||
23 | 23 | | |||
24 | 24 | | |||
25 | MouseArea { | 25 | MouseArea { | ||
26 | id: root | 26 | id: item | ||
27 | property alias icon: iconItem.source | 27 | property alias icon: iconItem.source | ||
28 | property alias text: label.text | 28 | property alias text: label.text | ||
29 | property string module | 29 | property string module | ||
30 | property int iconSize: Kirigami.Units.iconSizes.huge | 30 | property int iconSize: Kirigami.Units.iconSizes.huge | ||
31 | Layout.minimumWidth: Kirigami.Units.iconSizes.medium | 31 | Layout.minimumWidth: Kirigami.Units.iconSizes.medium | ||
32 | Layout.minimumHeight: column.implicitHeight | 32 | Layout.minimumHeight: column.implicitHeight | ||
33 | cursorShape: Qt.PointingHandCursor | 33 | cursorShape: Qt.PointingHandCursor | ||
34 | Layout.fillWidth: true | 34 | Layout.fillWidth: true | ||
35 | Layout.alignment: Qt.AlignTop | 35 | Layout.alignment: Qt.AlignTop | ||
36 | activeFocusOnTab: true | ||||
36 | 37 | | |||
37 | onClicked: systemsettings.loadMostUsed(index); | 38 | onClicked: systemsettings.loadMostUsed(index); | ||
39 | | ||||
40 | Keys.onTabPressed: { | ||||
41 | if (index < (mostUsedRepeater.count-1)) { | ||||
davidedmundson: why 4?
Is this the item.children count? | |||||
42 | event.accepted = false; | ||||
43 | } else { | ||||
44 | root.focusNextRequest(); | ||||
45 | } | ||||
46 | } | ||||
47 | Keys.onBacktabPressed: { | ||||
48 | if (index > 0) { | ||||
49 | event.accepted = false; | ||||
50 | } else { | ||||
51 | root.focusPreviousRequest(); | ||||
52 | } | ||||
53 | } | ||||
54 | Kirigami.Separator { | ||||
55 | anchors{ | ||||
56 | left: parent.left | ||||
57 | right: parent.right | ||||
58 | bottom: parent.bottom | ||||
59 | } | ||||
60 | visible: item.activeFocus | ||||
61 | color: Kirigami.Theme.highlightColor | ||||
62 | } | ||||
38 | ColumnLayout { | 63 | ColumnLayout { | ||
39 | id: column | 64 | id: column | ||
40 | width: parent.width | 65 | width: parent.width | ||
41 | Kirigami.Icon { | 66 | Kirigami.Icon { | ||
42 | id: iconItem | 67 | id: iconItem | ||
43 | Layout.alignment: Qt.AlignHCenter | 68 | Layout.alignment: Qt.AlignHCenter | ||
44 | Layout.minimumWidth: root.iconSize | 69 | Layout.minimumWidth: item.iconSize | ||
45 | Layout.minimumHeight: Layout.minimumWidth | 70 | Layout.minimumHeight: Layout.minimumWidth | ||
46 | height: width | 71 | height: width | ||
47 | } | 72 | } | ||
48 | QQC2.Label { | 73 | QQC2.Label { | ||
49 | id: label | 74 | id: label | ||
50 | Layout.fillWidth: true | 75 | Layout.fillWidth: true | ||
51 | Layout.maximumWidth: root.width | 76 | Layout.maximumWidth: item.width | ||
52 | Layout.alignment: Qt.AlignHCenter | 77 | Layout.alignment: Qt.AlignHCenter | ||
53 | horizontalAlignment: Text.AlignHCenter | 78 | horizontalAlignment: Text.AlignHCenter | ||
54 | wrapMode: Text.Wrap | 79 | wrapMode: Text.Wrap | ||
55 | } | 80 | } | ||
56 | } | 81 | } | ||
82 | | ||||
57 | Accessible.role: Accessible.Button | 83 | Accessible.role: Accessible.Button | ||
58 | Accessible.name: label.text | 84 | Accessible.name: label.text | ||
85 | Accessible.description: i18n("Most used modeule number %1", index+1) | ||||
59 | Accessible.onPressAction: systemsettings.loadMostUsed(index); | 86 | Accessible.onPressAction: systemsettings.loadMostUsed(index); | ||
60 | } | 87 | } | ||
61 | 88 | |
why 4?
Is this the item.children count?