mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-03-20 17:48:46 +00:00
Context menu play nicely with application that needs mouse control. Enabling Ctrl+Wheel to control scaling.
This commit is contained in:
parent
f0aa9c423b
commit
bde7ed901c
@ -133,31 +133,25 @@ Item{
|
|||||||
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onWheel:{
|
onWheel:{
|
||||||
var coord = correctDistortion(wheel.x, wheel.y);
|
if(wheel.modifiers & Qt.ControlModifier){
|
||||||
var lines = wheel.angleDelta.y > 0 ? -1 : 1;
|
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
|
||||||
kterminal.scrollWheelEvent(coord, lines);
|
} else {
|
||||||
|
var coord = correctDistortion(wheel.x, wheel.y);
|
||||||
|
var lines = wheel.angleDelta.y > 0 ? -1 : 1;
|
||||||
|
kterminal.scrollWheelEvent(coord, lines);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//onClicked: {
|
|
||||||
// if (mouse.button == Qt.RightButton){
|
|
||||||
// contextmenu.popup();
|
|
||||||
// } else if (mouse.button == Qt.MiddleButton){
|
|
||||||
// kterminal.pasteSelection();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
onDoubleClicked: {
|
onDoubleClicked: {
|
||||||
var coord = correctDistortion(mouse.x, mouse.y);
|
var coord = correctDistortion(mouse.x, mouse.y);
|
||||||
console.log("Double click");
|
|
||||||
kterminal.mouseDoubleClickEvent(coord, mouse.button, mouse.modifiers);
|
kterminal.mouseDoubleClickEvent(coord, mouse.button, mouse.modifiers);
|
||||||
}
|
}
|
||||||
//onPositionChanged: {
|
|
||||||
// if (pressedButtons & Qt.LeftButton){
|
|
||||||
// var coord = correctDistortion(mouse.x, mouse.y);
|
|
||||||
// kterminal.mouseMove(coord.width, coord.height);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
onPressed: {
|
onPressed: {
|
||||||
var coord = correctDistortion(mouse.x, mouse.y);
|
if((!kterminal.usesMouse || mouse.modifiers & Qt.ShiftModifier) && mouse.button == Qt.RightButton) {
|
||||||
kterminal.mousePressEvent(coord, mouse.button, mouse.modifiers)
|
contextmenu.popup();
|
||||||
|
} else {
|
||||||
|
var coord = correctDistortion(mouse.x, mouse.y);
|
||||||
|
kterminal.mousePressEvent(coord, mouse.button, mouse.modifiers)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onReleased: {
|
onReleased: {
|
||||||
var coord = correctDistortion(mouse.x, mouse.y);
|
var coord = correctDistortion(mouse.x, mouse.y);
|
||||||
|
@ -614,9 +614,7 @@ void KTerminalDisplay::mousePressEvent(QPoint position, int but, int mod)
|
|||||||
} else if (button == Qt::MidButton) {
|
} else if (button == Qt::MidButton) {
|
||||||
processMidButtonClick(position, modifiers);
|
processMidButtonClick(position, modifiers);
|
||||||
} else if (button == Qt::RightButton) {
|
} else if (button == Qt::RightButton) {
|
||||||
if (_mouseMarks || (modifiers & Qt::ShiftModifier))
|
if (!_mouseMarks)
|
||||||
;//emit configureRequest(ev->pos());
|
|
||||||
else
|
|
||||||
emit mouseSignal(2, charColumn + 1, charLine + 1, 0);
|
emit mouseSignal(2, charColumn + 1, charLine + 1, 0);
|
||||||
//emit mouseSignal(2, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0);
|
//emit mouseSignal(2, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user