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
+7 -3
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);
}
}