Initial support for mouse in applications.

This commit is contained in:
Filippo Scognamiglio
2014-07-02 02:38:28 +02:00
parent f1dc94fab2
commit 2fe6d147d9
7 changed files with 128 additions and 44 deletions

View File

@@ -130,8 +130,11 @@ Item{
MouseArea{
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
anchors.fill: parent
onWheel:
wheel.angleDelta.y > 0 ? kterminal.scrollUp() : kterminal.scrollDown()
onWheel:{
var coord = correctDistortion(wheel.x, wheel.y);
var lines = wheel.angleDelta.y > 0 ? -2 : 2;
kterminal.scrollWheel(coord.width, coord.height, lines);
}
onClicked: {
if (mouse.button == Qt.RightButton){
contextmenu.popup();
@@ -157,7 +160,8 @@ Item{
}
onReleased: {
if (mouse.button == Qt.LeftButton){
kterminal.mouseRelease(mouse.x, mouse.y);
var coord = correctDistortion(mouse.x, mouse.y);
kterminal.mouseRelease(coord.width, coord.height);
}
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2014-06-28T10:14:09. -->
<!-- Written by QtCreator 3.0.1, 2014-07-02T00:31:14. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>