From 3478e6604456d08157c5c590a25a3be716a793a0 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Wed, 16 Apr 2014 19:30:11 +0200 Subject: [PATCH] Improvements in menus --- app/Terminal.qml | 16 ++++++++-------- app/main.qml | 25 ++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/app/Terminal.qml b/app/Terminal.qml index 7f8d3ac..b65429b 100644 --- a/app/Terminal.qml +++ b/app/Terminal.qml @@ -50,6 +50,12 @@ Item{ function unloadKTerminal(){ kterminal.active = false; } + function pasteClipboard(){ + kterminal.item.pasteClipboard(); + } + function copyClipboard(){ + kterminal.item.copyClipboard(); + } Loader{ id: kterminal @@ -85,14 +91,8 @@ Item{ } Menu{ id: contextmenu - MenuItem{ - text: qsTr("Copy") - onTriggered: kterminal.item.copyClipboard() - } - MenuItem{ - text: qsTr("Paste") - onTriggered: kterminal.item.pasteClipboard() - } + MenuItem{action: copyAction} + MenuItem{action: pasteAction} } MouseArea{ diff --git a/app/main.qml b/app/main.qml index d11f153..c633595 100644 --- a/app/main.qml +++ b/app/main.qml @@ -36,21 +36,33 @@ ApplicationWindow{ Action { id: fullscreenAction - text: "&Fullscreen" + text: qsTr("&Fullscreen") shortcut: "Alt+F11" onTriggered: shadersettings.fullscreen = !shadersettings.fullscreen; } Action { id: quitAction - text: "&Quit" + text: qsTr("&Quit") shortcut: "Ctrl+Q" onTriggered: terminalWindow.close(); } Action{ id: showsettingsAction - text: "&Settings" + text: qsTr("&Settings") onTriggered: settingswindowloader.active = true; } + Action{ + id: copyAction + text: qsTr("&Copy") + shortcut: "Ctrl+Shift+C" + onTriggered: terminal.copyClipboard() + } + Action{ + id: pasteAction + text: qsTr("&Paste") + shortcut: "Ctrl+Shift+V" + onTriggered: terminal.pasteClipboard() + } menuBar: MenuBar { id: menubar @@ -62,7 +74,14 @@ ApplicationWindow{ Menu { title: qsTr("Edit") visible: shadersettings.fullscreen ? false : true + MenuItem {action: copyAction} + MenuItem {action: pasteAction} + MenuSeparator{} MenuItem {action: showsettingsAction} + } + Menu{ + title: qsTr("View") + visible: shadersettings.fullscreen ? false : true MenuItem {action: fullscreenAction} } }