Changeset View
Changeset View
Standalone View
Standalone View
sidebar/package/contents/ui/CategoriesPage.qml
Show All 10 Lines | 1 | /* | |||
---|---|---|---|---|---|
11 | Library General Public License for more details. | 11 | Library General Public License for more details. | ||
12 | 12 | | |||
13 | You should have received a copy of the GNU Library General Public License | 13 | You should have received a copy of the GNU Library General Public License | ||
14 | along with this library; see the file COPYING.LIB. If not, write to | 14 | along with this library; see the file COPYING.LIB. If not, write to | ||
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
16 | Boston, MA 02110-1301, USA. | 16 | Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.3 | 19 | import QtQuick 2.5 | ||
20 | import QtQuick.Controls 2.5 as QQC2 | ||||
20 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 1.0 as QtControls | | |||
22 | import QtQuick.Controls 2.0 as QtControls2 | | |||
23 | import org.kde.kirigami 2.7 as Kirigami | | |||
24 | 22 | | |||
23 | import org.kde.kirigami 2.8 as Kirigami | ||||
25 | 24 | | |||
26 | Kirigami.ScrollablePage { | 25 | Kirigami.ScrollablePage { | ||
27 | id: mainColumn | 26 | id: mainColumn | ||
28 | Component.onCompleted: searchField.forceActiveFocus() | 27 | Component.onCompleted: searchField.forceActiveFocus() | ||
29 | 28 | | |||
29 | property alias actionMenuButton: menuButton | ||||
30 | | ||||
30 | header: Rectangle { | 31 | header: Rectangle { | ||
31 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | 32 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | ||
32 | Kirigami.Theme.inherit: false | 33 | Kirigami.Theme.inherit: false | ||
33 | color: Kirigami.Theme.backgroundColor | 34 | color: Kirigami.Theme.backgroundColor | ||
34 | width: mainColumn.width | 35 | width: mainColumn.width | ||
35 | height: Math.round(Kirigami.Units.gridUnit * 2.5) | 36 | height: Math.round(Kirigami.Units.gridUnit * 2.5) | ||
36 | RowLayout { | 37 | RowLayout { | ||
37 | id: searchLayout | 38 | id: searchLayout | ||
38 | spacing: Kirigami.Units.smallSpacing | 39 | spacing: Kirigami.Units.smallSpacing | ||
39 | anchors { | 40 | anchors { | ||
40 | fill: parent | 41 | fill: parent | ||
41 | margins: Kirigami.Units.smallSpacing | 42 | margins: Kirigami.Units.smallSpacing | ||
42 | } | 43 | } | ||
43 | QtControls.ToolButton { | 44 | | ||
45 | QQC2.ToolButton { | ||||
44 | id: menuButton | 46 | id: menuButton | ||
45 | iconName: "application-menu" | 47 | icon.name: "application-menu" | ||
48 | checkable: true | ||||
46 | Layout.maximumWidth: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | 49 | Layout.maximumWidth: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | ||
47 | Layout.maximumHeight: width | 50 | Layout.maximumHeight: width | ||
48 | Keys.onBacktabPressed: { | 51 | Keys.onBacktabPressed: { | ||
49 | root.focusPreviousRequest() | 52 | root.focusPreviousRequest() | ||
50 | } | 53 | } | ||
51 | menu: ActionMenu { | 54 | onClicked: systemsettings.showActionMenu(mapToGlobal(0, height)) | ||
52 | actions: ["configure", "help_contents", "help_about_app", "help_about_kde"] | | |||
53 | } | | |||
54 | } | 55 | } | ||
55 | Kirigami.ActionTextField { | 56 | | ||
57 | Kirigami.SearchField { | ||||
56 | id: searchField | 58 | id: searchField | ||
57 | focus: true | 59 | focus: true | ||
58 | Layout.minimumHeight: Layout.maximumHeight | 60 | Layout.minimumHeight: Layout.maximumHeight | ||
59 | Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | 61 | Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | ||
60 | Layout.fillWidth: true | 62 | Layout.fillWidth: true | ||
61 | placeholderText: i18n("Search...") | | |||
62 | onTextChanged: { | 63 | onTextChanged: { | ||
63 | systemsettings.categoryModel.filterRegExp = text; | 64 | systemsettings.categoryModel.filterRegExp = text; | ||
64 | } | 65 | } | ||
65 | rightActions: [ | | |||
66 | Kirigami.Action { | | |||
67 | iconName: LayoutMirroring.enabled ? "edit-clear-rtl" : "edit-clear" | | |||
68 | visible: searchField.text.length !== 0 | | |||
69 | onTriggered: searchField.text = "" | | |||
70 | } | | |||
71 | ] | | |||
72 | } | 66 | } | ||
73 | } | 67 | } | ||
74 | Kirigami.Separator { | 68 | Kirigami.Separator { | ||
75 | anchors { | 69 | anchors { | ||
76 | left: parent.left | 70 | left: parent.left | ||
77 | right: parent.right | 71 | right: parent.right | ||
78 | top: parent.bottom | 72 | top: parent.bottom | ||
79 | } | 73 | } | ||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |