From de82b132907110a884239709dea43e08867501d8 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 9 Apr 2018 10:02:43 +0200 Subject: A help view to list shortcuts --- framework/qml/HelpPopup.qml | 49 +++++++++++++++++++++++++++++++++++++++++++++ framework/qmldir | 1 + 2 files changed, 50 insertions(+) create mode 100644 framework/qml/HelpPopup.qml (limited to 'framework') diff --git a/framework/qml/HelpPopup.qml b/framework/qml/HelpPopup.qml new file mode 100644 index 00000000..b1fe75a6 --- /dev/null +++ b/framework/qml/HelpPopup.qml @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2017 Michael Bohlender, + * Copyright (C) 2017 Christian Mollekopf, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +import QtQuick 2.9 +import QtQuick.Controls 2 +import QtQuick.Layouts 1.1 + +import org.kube.framework 1.0 as Kube + + +Kube.Popup { + id: debugPopup + + default property alias entries: view.model + + modal: true + parent: ApplicationWindow.overlay + closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent + x: (parent.width - width)/2 + y: Kube.Units.largeSpacing + width: parent.width / 2 + height: parent.height - Kube.Units.largeSpacing * 2 + clip: true + + ListView { + id: view + anchors.fill: parent + delegate: Kube.Label { + text: description + " " + shortcut + } + } +} diff --git a/framework/qmldir b/framework/qmldir index c62444c9..808563c9 100644 --- a/framework/qmldir +++ b/framework/qmldir @@ -10,6 +10,7 @@ NewAccountDialog 1.0 NewAccountDialog.qml EditAccount 1.0 EditAccount.qml LoginAccount 1.0 LoginAccount.qml Outbox 1.0 Outbox.qml +HelpPopup 1.0 HelpPopup.qml NotificationPopup 1.0 NotificationPopup.qml Icon 1.0 Icon.qml IconButton 1.0 IconButton.qml -- cgit v1.2.3