mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-03-20 09:39:07 +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
|
||||
anchors.fill: parent
|
||||
onWheel:{
|
||||
var coord = correctDistortion(wheel.x, wheel.y);
|
||||
var lines = wheel.angleDelta.y > 0 ? -1 : 1;
|
||||
kterminal.scrollWheelEvent(coord, lines);
|
||||
if(wheel.modifiers & Qt.ControlModifier){
|
||||
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
|
||||
} 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: {
|
||||
var coord = correctDistortion(mouse.x, mouse.y);
|
||||
console.log("Double click");
|
||||
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: {
|
||||
var coord = correctDistortion(mouse.x, mouse.y);
|
||||
kterminal.mousePressEvent(coord, mouse.button, mouse.modifiers)
|
||||
if((!kterminal.usesMouse || mouse.modifiers & Qt.ShiftModifier) && mouse.button == Qt.RightButton) {
|
||||
contextmenu.popup();
|
||||
} else {
|
||||
var coord = correctDistortion(mouse.x, mouse.y);
|
||||
kterminal.mousePressEvent(coord, mouse.button, mouse.modifiers)
|
||||
}
|
||||
}
|
||||
onReleased: {
|
||||
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) {
|
||||
processMidButtonClick(position, modifiers);
|
||||
} else if (button == Qt::RightButton) {
|
||||
if (_mouseMarks || (modifiers & Qt::ShiftModifier))
|
||||
;//emit configureRequest(ev->pos());
|
||||
else
|
||||
if (!_mouseMarks)
|
||||
emit mouseSignal(2, charColumn + 1, charLine + 1, 0);
|
||||
//emit mouseSignal(2, charColumn + 1, charLine + 1 + _scrollBar->value() - _scrollBar->maximum() , 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user