ConfigurationShortcuts.qml 1.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 *  Copyright 2013 Marco Martin <mart@kde.org>
 *
 *  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  2.010-1301, USA.
 */

import QtQuick 2.0
20
import QtQuick.Controls 2.3 as QtControls
21
import QtQuick.Layouts 1.0
22 23 24
import org.kde.kquickcontrols 2.0

Item {
25
    id: root
26

27 28 29 30 31
    signal configurationChanged
    function saveConfig() {
        plasmoid.globalShortcut = button.keySequence
    }

32 33 34 35 36 37 38
    ColumnLayout {
        anchors {
            left: parent.left
            right: parent.right
        }
        QtControls.Label {
            Layout.fillWidth: true
39
            text: i18nd("plasma_shell_org.kde.plasma.desktop", "This shortcut will activate the applet as though it had been clicked.")
40 41 42 43 44
            wrapMode: Text.WordWrap
        }
        KeySequenceItem {
            id: button
            keySequence: plasmoid.globalShortcut
45
            onKeySequenceChanged: {
46 47
                root.configurationChanged();
            }
48 49 50
        }
    }
}