From c1c4f85bf10d090c96a935050582ac05e2dce414 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 27 Nov 2017 15:46:57 -0500 Subject: Some UI improvements for lumina-pdf: 1. Add a context menu of options. 2. Use the context menu for both the presentation label and normal viewer 3. Get things ready for better integration of keyboard shortcuts application-wide. --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 87d2a4e4..ad3d6809 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -17,8 +17,10 @@ #include #include #include +#include #include +#include "PresentationLabel.h" namespace Ui{ class MainUI; @@ -46,6 +48,7 @@ private: QProgressBar *progress; QAction *progAct; //action associated with the progressbar QTimer *clockTimer; + QMenu *contextMenu; //QFrame *frame_presenter; QLabel *label_clock; QAction *clockAct; @@ -57,7 +60,7 @@ private: void loadPage(int num, Poppler::Document *doc, MainUI *obj, QSize dpi, QSizeF page); //Functions/variables for the presentation mode - QLabel *presentationLabel; + PresentationLabel *presentationLabel; QScreen *getScreen(bool current, bool &cancelled); int CurrentPage; void startPresentation(bool atStart); @@ -69,6 +72,16 @@ private slots: void slotPageLoaded(int); void slotStartPresentation(QAction *act); + //Simplification routines + void nextPage(){ ShowPage( WIDGET->currentPage() ); } //currentPage() starts at 1 rather than 0 + void prevPage(){ ShowPage( WIDGET->currentPage()-2 ); } //currentPage() starts at 1 rather than 0 + void firstPage(){ ShowPage(0); } + void lastPage(){ ShowPage(numPages-1); } + void startPresentationHere(){ startPresentation(false); } + void startPresentationBeginning(){ startPresentation(true); } + void closePresentation(){ endPresentation(); } + + void paintOnWidget(QPrinter *PRINTER); void paintToPrinter(QPrinter *PRINTER); @@ -77,6 +90,8 @@ private slots: //Other interface slots void updateClock(); + void showContextMenu(const QPoint&){ contextMenu->popup(QCursor::pos()); } + void updateContextMenu(); signals: void PageLoaded(int); @@ -101,22 +116,23 @@ protected: if( event->key()==Qt::Key_Escape || event->key()==Qt::Key_Backspace){ //qDebug() << " - Escape/Backspace"; - endPresentation(); + if(inPresentation){ 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" << inPresentation; - ShowPage( WIDGET->currentPage() ); //currentPage() starts at 1 rather than 0 + nextPage(); }else if(event->key()==Qt::Key_Left || event->key()==Qt::Key_Up || event->key()==Qt::Key_PageUp){ //qDebug() << " - Left/Up"; - ShowPage( WIDGET->currentPage()-2 ); //currentPage() starts at 1 rather than 0 + prevPage(); }else if(event->key()==Qt::Key_Home){ //qDebug() << " - Home"; - ShowPage(0); //go to the first page + firstPage(); }else if(event->key()==Qt::Key_End){ //qDebug() << " - End"; - ShowPage( numPages-1 ); //go to the last page + lastPage(); }else if(event->key()==Qt::Key_F11){ //qDebug() << " - F11"; - endPresentation(); + if(inPresentation){ endPresentation(); } + else{ startPresentationHere(); } }else{ QMainWindow::keyPressEvent(event); } -- cgit From 9c30dd9c444e16aef845b8c756383a12a6afc147 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 29 Nov 2017 13:30:01 -0500 Subject: Make the poppler include path "poppler/qt5/" rather than just the file. This allows the poppler/qt5 path to be on *any* of the INCLUDEPATHS, rather than trying to specify a particular one through the OS-detection systems. --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index ad3d6809..826891ec 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include "PresentationLabel.h" namespace Ui{ -- cgit From 6af80c357ec5cc3f340ff1d726528c4695e0d25e Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Mon, 18 Dec 2017 13:51:05 -0500 Subject: Added zoom and start to rotate for lumina-pdf --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 826891ec..527bcb2a 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -42,6 +42,8 @@ private: QPrinter* Printer; QPrintDialog *PrintDLG; + int ccw; + QString lastdir; //Other Interface elements @@ -93,6 +95,9 @@ private slots: void showContextMenu(const QPoint&){ contextMenu->popup(QCursor::pos()); } void updateContextMenu(); + void setScroll(bool); + void rotate(QPrinter*, bool); + signals: void PageLoaded(int); -- cgit From 6c5a1d42db02985ed64ca744215bb23fca276143 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Mon, 18 Dec 2017 16:05:27 -0500 Subject: Finished rotation and working on changing keys in lumina-pdf --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 47 ++----------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 527bcb2a..078caaca 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -41,9 +41,6 @@ private: Ui::MainUI *ui; QPrinter* Printer; QPrintDialog *PrintDLG; - - int ccw; - QString lastdir; //Other Interface elements @@ -96,51 +93,13 @@ private slots: void updateContextMenu(); void setScroll(bool); - void rotate(QPrinter*, bool); + void rotate(bool); + //void rotate(QPrinter*, bool); signals: void PageLoaded(int); 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"; - if(inPresentation){ 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" << inPresentation; - nextPage(); - }else if(event->key()==Qt::Key_Left || event->key()==Qt::Key_Up || event->key()==Qt::Key_PageUp){ - //qDebug() << " - Left/Up"; - prevPage(); - }else if(event->key()==Qt::Key_Home){ - //qDebug() << " - Home"; - firstPage(); - }else if(event->key()==Qt::Key_End){ - //qDebug() << " - End"; - lastPage(); - }else if(event->key()==Qt::Key_F11){ - //qDebug() << " - F11"; - if(inPresentation){ endPresentation(); } - else{ startPresentationHere(); } - }else{ - QMainWindow::keyPressEvent(event); - } - } + void keyPressEvent(QKeyEvent*); }; #endif -- cgit From f4d3efca1f72dd152db2128568117445ada07789 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Mon, 18 Dec 2017 19:05:35 -0500 Subject: Added missing icons and created actions for later implemented functions --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 078caaca..9ed50ba0 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -69,7 +69,7 @@ private: private slots: void startLoadingPages(QPrinter *printer); void slotPageLoaded(int); - void slotStartPresentation(QAction *act); + //void slotStartPresentation(QAction *act); //Simplification routines void nextPage(){ ShowPage( WIDGET->currentPage() ); } //currentPage() starts at 1 rather than 0 -- cgit From a774d58cd478a5473d8328b2a9689bc53a37dbc1 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Wed, 20 Dec 2017 14:41:12 -0500 Subject: Fixed keyboard focus and added an information dialog to lumina-pdf --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 9ed50ba0..18b3d231 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -21,6 +21,7 @@ #include #include "PresentationLabel.h" +#include "propDialog.h" namespace Ui{ class MainUI; @@ -34,11 +35,11 @@ public: void loadFile(QString path); - private: Poppler::Document *DOC; QPrintPreviewWidget *WIDGET; Ui::MainUI *ui; + PropDialog *PROPDIALOG; QPrinter* Printer; QPrintDialog *PrintDLG; QString lastdir; @@ -79,8 +80,9 @@ private slots: void startPresentationHere(){ startPresentation(false); } void startPresentationBeginning(){ startPresentation(true); } void closePresentation(){ endPresentation(); } + void showInformation(); - + void newFocus(QWidget*, QWidget*); void paintOnWidget(QPrinter *PRINTER); void paintToPrinter(QPrinter *PRINTER); @@ -94,12 +96,12 @@ private slots: void setScroll(bool); void rotate(bool); - //void rotate(QPrinter*, bool); signals: void PageLoaded(int); protected: void keyPressEvent(QKeyEvent*); + void wheelEvent(QWheelEvent*); }; #endif -- cgit From 5162021eb02f0004b77104fa14088ab7504cb66e Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Fri, 22 Dec 2017 20:30:23 -0500 Subject: Progress toward search functionality for lumina-pdf --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 18b3d231..8337ed9c 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -43,6 +43,9 @@ private: QPrinter* Printer; QPrintDialog *PrintDLG; QString lastdir; + bool matchCase, clearHighlights; + QMap results; + int currentHighlight; //Other Interface elements QProgressBar *progress; @@ -81,6 +84,9 @@ private slots: void startPresentationBeginning(){ startPresentation(true); } void closePresentation(){ endPresentation(); } void showInformation(); + void find(QString text, bool forward); + void enableFind(); + void showBookmarks(); void newFocus(QWidget*, QWidget*); void paintOnWidget(QPrinter *PRINTER); -- cgit From 9ab5b031d95750e0320743c5c941685701aafe63 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Tue, 26 Dec 2017 15:41:40 -0500 Subject: Made improvements to focus setting and the find widget in lumina-pdf --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 8337ed9c..60a1beb9 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -43,7 +43,7 @@ private: QPrinter* Printer; QPrintDialog *PrintDLG; QString lastdir; - bool matchCase, clearHighlights; + bool matchCase, highlight; QMap results; int currentHighlight; @@ -61,6 +61,7 @@ private: int numPages; void loadPage(int num, Poppler::Document *doc, MainUI *obj, QSize dpi, QSizeF page); + void highlightText(QPrinter *PRINTER); //Functions/variables for the presentation mode PresentationLabel *presentationLabel; @@ -89,7 +90,7 @@ private slots: void showBookmarks(); void newFocus(QWidget*, QWidget*); - void paintOnWidget(QPrinter *PRINTER); + void paintOnWidget(QPrinter*, bool); void paintToPrinter(QPrinter *PRINTER); //Button Slots @@ -109,5 +110,6 @@ signals: protected: void keyPressEvent(QKeyEvent*); void wheelEvent(QWheelEvent*); + void resizeEvent(QResizeEvent*); }; #endif -- cgit From a32c6a9fd54fd400db0b729e826bc9a06297a3d7 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Tue, 26 Dec 2017 18:20:40 -0500 Subject: Began creating custom QPrintPreviewWidget for lumina-pdf --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 60a1beb9..cce04cd4 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -22,6 +22,7 @@ #include #include "PresentationLabel.h" #include "propDialog.h" +#include "PrintWidget.h" namespace Ui{ class MainUI; @@ -37,7 +38,7 @@ public: private: Poppler::Document *DOC; - QPrintPreviewWidget *WIDGET; + PrintWidget *WIDGET; Ui::MainUI *ui; PropDialog *PROPDIALOG; QPrinter* Printer; -- cgit From 7e7f6f168a0528a19af6663e3c2b6fe985836a36 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Wed, 27 Dec 2017 15:59:26 -0500 Subject: Shifted from a custom QWidget to a subclass of QGraphicalView and connected it to the Main UI --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index cce04cd4..b3ad38f1 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -90,7 +90,6 @@ private slots: void enableFind(); void showBookmarks(); - void newFocus(QWidget*, QWidget*); void paintOnWidget(QPrinter*, bool); void paintToPrinter(QPrinter *PRINTER); -- cgit From 8ae96c6a55244ee36fc7fdd4578de663fabb33b0 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Fri, 29 Dec 2017 15:00:06 -0500 Subject: Finished transitioning from QPrintPreviewWidget to QGraphicsView --- src-qt5/desktop-utils/lumina-pdf/mainUI.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.h') diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index b3ad38f1..2d23b402 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -41,10 +41,9 @@ private: PrintWidget *WIDGET; Ui::MainUI *ui; PropDialog *PROPDIALOG; - QPrinter* Printer; QPrintDialog *PrintDLG; QString lastdir; - bool matchCase, highlight; + bool matchCase; QMap results; int currentHighlight; @@ -62,7 +61,6 @@ private: int numPages; void loadPage(int num, Poppler::Document *doc, MainUI *obj, QSize dpi, QSizeF page); - void highlightText(QPrinter *PRINTER); //Functions/variables for the presentation mode PresentationLabel *presentationLabel; @@ -73,7 +71,7 @@ private: void endPresentation(); private slots: - void startLoadingPages(QPrinter *printer); + void startLoadingPages(); void slotPageLoaded(int); //void slotStartPresentation(QAction *act); @@ -85,12 +83,12 @@ private slots: void startPresentationHere(){ startPresentation(false); } void startPresentationBeginning(){ startPresentation(true); } void closePresentation(){ endPresentation(); } + void showInformation(); void find(QString text, bool forward); void enableFind(); void showBookmarks(); - void paintOnWidget(QPrinter*, bool); void paintToPrinter(QPrinter *PRINTER); //Button Slots -- cgit