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 | | |||
30 | header: Rectangle { | 29 | header: Rectangle { | ||
31 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | 30 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | ||
32 | Kirigami.Theme.inherit: false | 31 | Kirigami.Theme.inherit: false | ||
33 | color: Kirigami.Theme.backgroundColor | 32 | color: Kirigami.Theme.backgroundColor | ||
34 | width: mainColumn.width | 33 | width: mainColumn.width | ||
35 | height: Math.round(Kirigami.Units.gridUnit * 2.5) | 34 | height: Math.round(Kirigami.Units.gridUnit * 2.5) | ||
36 | RowLayout { | 35 | RowLayout { | ||
37 | id: searchLayout | 36 | id: searchLayout | ||
38 | spacing: Kirigami.Units.smallSpacing | 37 | spacing: Kirigami.Units.smallSpacing | ||
39 | anchors { | 38 | anchors { | ||
40 | fill: parent | 39 | fill: parent | ||
41 | margins: Kirigami.Units.smallSpacing | 40 | margins: Kirigami.Units.smallSpacing | ||
42 | } | 41 | } | ||
43 | QtControls.ToolButton { | 42 | | ||
43 | QQC2.ToolButton { | ||||
44 | id: menuButton | 44 | id: menuButton | ||
45 | iconName: "application-menu" | 45 | icon.name: "application-menu" | ||
46 | checkable: true | ||||
47 | checked: systemsettings.actionMenuVisible | ||||
46 | Layout.maximumWidth: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | 48 | Layout.maximumWidth: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | ||
47 | Layout.maximumHeight: width | 49 | Layout.maximumHeight: width | ||
48 | Keys.onBacktabPressed: { | 50 | Keys.onBacktabPressed: { | ||
49 | root.focusPreviousRequest() | 51 | root.focusPreviousRequest() | ||
50 | } | 52 | } | ||
51 | menu: ActionMenu { | 53 | onClicked: systemsettings.showActionMenu(mapToGlobal(0, height)) | ||
52 | actions: ["configure", "help_contents", "help_about_app", "help_about_kde"] | | |||
53 | } | | |||
54 | } | 54 | } | ||
55 | Kirigami.ActionTextField { | 55 | | ||
56 | Kirigami.SearchField { | ||||
56 | id: searchField | 57 | id: searchField | ||
57 | focus: true | 58 | focus: true | ||
58 | Layout.minimumHeight: Layout.maximumHeight | 59 | Layout.minimumHeight: Layout.maximumHeight | ||
59 | Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | 60 | Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | ||
60 | Layout.fillWidth: true | 61 | Layout.fillWidth: true | ||
61 | placeholderText: i18n("Search...") | | |||
62 | onTextChanged: { | 62 | onTextChanged: { | ||
63 | systemsettings.categoryModel.filterRegExp = text; | 63 | systemsettings.categoryModel.filterRegExp = text; | ||
64 | } | 64 | } | ||
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 | } | 65 | } | ||
73 | } | 66 | } | ||
74 | Kirigami.Separator { | 67 | Kirigami.Separator { | ||
75 | anchors { | 68 | anchors { | ||
76 | left: parent.left | 69 | left: parent.left | ||
77 | right: parent.right | 70 | right: parent.right | ||
78 | top: parent.bottom | 71 | top: parent.bottom | ||
79 | } | 72 | } | ||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |