Changeset View
Changeset View
Standalone View
Standalone View
desktoppackage/contents/explorer/WidgetExplorer.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
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.7 | 20 | import QtQuick 2.7 | ||
21 | import QtQuick.Controls 1.1 | 21 | import QtQuick.Controls 2.5 as QQC2 | ||
22 | 22 | | |||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
26 | import org.kde.kquickcontrolsaddons 2.0 | 26 | import org.kde.kquickcontrolsaddons 2.0 | ||
27 | import org.kde.kwindowsystem 1.0 | 27 | import org.kde.kwindowsystem 1.0 | ||
28 | 28 | | |||
29 | import QtQuick.Window 2.1 | 29 | import QtQuick.Window 2.1 | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 86 | if (pluginName) { | |||
87 | widgetExplorer.addApplet(pluginName) | 87 | widgetExplorer.addApplet(pluginName) | ||
88 | } | 88 | } | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | KWindowSystem { | 91 | KWindowSystem { | ||
92 | id: kwindowsystem | 92 | id: kwindowsystem | ||
93 | } | 93 | } | ||
94 | 94 | | |||
95 | Action { | 95 | QQC2.Action { | ||
96 | shortcut: "Escape" | 96 | shortcut: "Escape" | ||
97 | onTriggered: { | 97 | onTriggered: { | ||
98 | if (searchInput.length > 0) { | 98 | if (searchInput.length > 0) { | ||
99 | searchInput.text = "" | 99 | searchInput.text = "" | ||
100 | } else { | 100 | } else { | ||
101 | main.closed() | 101 | main.closed() | ||
102 | } | 102 | } | ||
103 | } | 103 | } | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | Action { | 106 | QQC2.Action { | ||
107 | shortcut: "Up" | 107 | shortcut: "Up" | ||
108 | onTriggered: list.currentIndex = (list.count + list.currentIndex - 1) % list.count | 108 | onTriggered: list.currentIndex = (list.count + list.currentIndex - 1) % list.count | ||
109 | } | 109 | } | ||
110 | 110 | | |||
111 | Action { | 111 | QQC2.Action { | ||
112 | shortcut: "Down" | 112 | shortcut: "Down" | ||
113 | onTriggered: list.currentIndex = (list.currentIndex + 1) % list.count | 113 | onTriggered: list.currentIndex = (list.currentIndex + 1) % list.count | ||
114 | } | 114 | } | ||
115 | 115 | | |||
116 | Action { | 116 | QQC2.Action { | ||
117 | shortcut: "Enter" | 117 | shortcut: "Enter" | ||
118 | onTriggered: addCurrentApplet() | 118 | onTriggered: addCurrentApplet() | ||
119 | } | 119 | } | ||
120 | Action { | 120 | QQC2.Action { | ||
121 | shortcut: "Return" | 121 | shortcut: "Return" | ||
122 | onTriggered: addCurrentApplet() | 122 | onTriggered: addCurrentApplet() | ||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | Component { | 125 | Component { | ||
126 | id: widgetExplorerComponent | 126 | id: widgetExplorerComponent | ||
127 | 127 | | |||
128 | WidgetExplorer { | 128 | WidgetExplorer { | ||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | 338 | Column { | |||
347 | 347 | | |||
348 | PlasmaComponents.Button { | 348 | PlasmaComponents.Button { | ||
349 | id: getWidgetsButton | 349 | id: getWidgetsButton | ||
350 | anchors { | 350 | anchors { | ||
351 | left: parent.left | 351 | left: parent.left | ||
352 | right: parent.right | 352 | right: parent.right | ||
353 | } | 353 | } | ||
354 | iconSource: "get-hot-new-stuff" | 354 | iconSource: "get-hot-new-stuff" | ||
355 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "Get new widgets") | 355 | text: i18nd("plasma_shell_org.kde.plasma.desktop", "Get New Widgets...") | ||
356 | onClicked: { | 356 | onClicked: { | ||
357 | getWidgetsDialog.model = widgetExplorer.widgetsMenuActions | 357 | getWidgetsDialog.model = widgetExplorer.widgetsMenuActions | ||
358 | getWidgetsDialog.openRelative() | 358 | getWidgetsDialog.openRelative() | ||
359 | } | 359 | } | ||
360 | } | 360 | } | ||
361 | 361 | | |||
362 | /* TODO: WidgetExplorer.extraActions is unimplemented | 362 | /* TODO: WidgetExplorer.extraActions is unimplemented | ||
363 | Repeater { | 363 | Repeater { | ||
Show All 15 Lines |