Changeset View
Changeset View
Standalone View
Standalone View
examples/simpleexamples/Sidebar.qml
Show All 14 Lines | |||||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.1 | 20 | import QtQuick 2.1 | ||
21 | import QtQuick.Controls 2.3 as Controls | 21 | import QtQuick.Controls 2.3 as Controls | ||
22 | import QtQuick.Layouts 1.2 | 22 | import QtQuick.Layouts 1.2 | ||
23 | import org.kde.kirigami 2.5 as Kirigami | 23 | import org.kde.kirigami 2.6 as Kirigami | ||
24 | 24 | | |||
25 | Kirigami.ApplicationWindow { | 25 | Kirigami.ApplicationWindow { | ||
26 | id: root | 26 | id: root | ||
27 | width: Kirigami.Units.gridUnit * 60 | 27 | width: Kirigami.Units.gridUnit * 60 | ||
28 | height: Kirigami.Units.gridUnit * 40 | 28 | height: Kirigami.Units.gridUnit * 40 | ||
29 | 29 | | |||
30 | 30 | | |||
31 | pageStack.initialPage: mainPageComponent | 31 | pageStack.initialPage: mainPageComponent | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | |||||
113 | header: Controls.ToolBar { | 113 | header: Controls.ToolBar { | ||
114 | contentItem: RowLayout { | 114 | contentItem: RowLayout { | ||
115 | Controls.ToolButton { | 115 | Controls.ToolButton { | ||
116 | text: "Global ToolBar" | 116 | text: "Global ToolBar" | ||
117 | } | 117 | } | ||
118 | Item { | 118 | Item { | ||
119 | Layout.fillWidth: true | 119 | Layout.fillWidth: true | ||
120 | } | 120 | } | ||
121 | Controls.TextField { | 121 | Kirigami.TextField { | ||
122 | id: searchField | ||||
122 | 123 | | |||
124 | placeholderText: "Search..." | ||||
125 | | ||||
126 | focusSequence: "Ctrl+F" | ||||
127 | | ||||
128 | rightAction: Kirigami.Action { | ||||
129 | iconName: "edit-clear" | ||||
130 | visible: searchField.text != "" | ||||
131 | onTriggered: { | ||||
132 | searchField.text = "" | ||||
133 | searchField.accepted() | ||||
134 | } | ||||
135 | } | ||||
136 | | ||||
137 | onAccepted: console.log("Search text is " + searchField.text) | ||||
123 | } | 138 | } | ||
124 | } | 139 | } | ||
125 | } | 140 | } | ||
126 | //Main app content | 141 | //Main app content | ||
127 | Component { | 142 | Component { | ||
128 | id: mainPageComponent | 143 | id: mainPageComponent | ||
129 | MultipleColumnsGallery {} | 144 | MultipleColumnsGallery {} | ||
130 | } | 145 | } | ||
131 | footer: Controls.ToolBar { | 146 | footer: Controls.ToolBar { | ||
132 | position: ToolBar.Footer | 147 | position: ToolBar.Footer | ||
133 | contentItem: Controls.Label { | 148 | contentItem: Controls.Label { | ||
134 | text: "Global Footer" | 149 | text: "Global Footer" | ||
135 | } | 150 | } | ||
136 | } | 151 | } | ||
137 | } | 152 | } |