diff options
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/mainUI.cpp | 2 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/mainUI.h | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp index 5cfc5da9..07680dcf 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp @@ -131,7 +131,7 @@ void MainUI::loadFile(QString path){ Printer->setOrientation(QPrinter::Portrait); } delete PAGE; - qDebug() << " - Document Setup : start loading pages now"; + //qDebug() << " - Document Setup : start loading pages now"; QTimer::singleShot(10, WIDGET, SLOT(updatePreview())); //start loading the file preview } diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index c43d0ada..3609db13 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -15,6 +15,8 @@ #include <QLabel> #include <QKeyEvent> #include <QDebug> +#include <QWheelEvent> +#include <QApplication> #include <poppler-qt5.h> @@ -76,11 +78,25 @@ protected: void keyPressEvent(QKeyEvent *event){ //See if this is one of the special hotkeys and act appropriately //qDebug() << "Got Key Press:"; + bool inPresentation = (presentationLabel!=0); + if(!inPresentation){ + //Alternate functionality when **not** in presentation mode + /*if(event->key()==Qt::Key_Down){ + qDebug() << "Send Wheel Event"; + QWheelEvent event( WIDGET->mapFromGlobal(QCursor::pos()), QCursor::pos(),QPoint(0,0), QPoint(0,30), 0, Qt::Vertical, Qt::LeftButton, Qt::NoModifier); + QApplication::sendEvent(WIDGET, &event); + //WIDGET->scrollDown(); + return; + }else if(event->key()==Qt::Key_Up){ + return; + }*/ + } + if( event->key()==Qt::Key_Escape || event->key()==Qt::Key_Backspace){ //qDebug() << " - Escape/Backspace"; endPresentation(); }else if(event->key()==Qt::Key_Right || event->key()==Qt::Key_Down || event->key()==Qt::Key_Space || event->key()==Qt::Key_PageDown){ - //qDebug() << " - Right/Down/Spacebar"; + //qDebug() << " - Right/Down/Spacebar" << inPresentation; ShowPage( WIDGET->currentPage() ); //currentPage() starts at 1 rather than 0 }else if(event->key()==Qt::Key_Left || event->key()==Qt::Key_Up || event->key()==Qt::Key_PageUp){ //qDebug() << " - Left/Up"; |