From 6d2fd84472c6c9512b22557ebb94eca82686db0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Thu, 1 Oct 2020 14:27:39 +0200 Subject: [PATCH 1/5] ensure grabbed image is properly sized for screen target when screen mirroring is enabled --- src/gui/UBScreenMirror.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/UBScreenMirror.cpp b/src/gui/UBScreenMirror.cpp index 40f782f4..9bc045d2 100644 --- a/src/gui/UBScreenMirror.cpp +++ b/src/gui/UBScreenMirror.cpp @@ -71,7 +71,7 @@ void UBScreenMirror::paintEvent(QPaintEvent *event) int x = (width() - mLastPixmap.width()) / 2; int y = (height() - mLastPixmap.height()) / 2; - painter.drawPixmap(x, y, mLastPixmap); + painter.drawPixmap(x, y, width(), height(), mLastPixmap); } } From 275096f1f58e9cd677926b722e33b53a29722416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Thu, 1 Oct 2020 14:37:26 +0200 Subject: [PATCH 2/5] prevent focus loose without resizing textbox on each change --- src/domain/UBGraphicsTextItemDelegate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index 9691fa07..eadd3aa3 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -356,7 +356,7 @@ void UBGraphicsTextItemDelegate::pickFont() delegated()->setTextCursor(curCursor); delegated()->setSelected(true); - delegated()->document()->adjustSize(); + delegated()->setFocus(); delegated()->contentsChanged(); } } @@ -392,7 +392,7 @@ void UBGraphicsTextItemDelegate::pickColor() } delegated()->setSelected(true); - delegated()->document()->adjustSize(); + delegated()->setFocus(); delegated()->contentsChanged(); } } From 45d392219d727955a6eaaf8ac7e4f7e2812d0977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Thu, 1 Oct 2020 14:39:48 +0200 Subject: [PATCH 3/5] potential fix for screenoverlapping --- src/core/UBDisplayManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index 14bba536..cd9db4ec 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -225,12 +225,12 @@ void UBDisplayManager::positionScreens() if(mDesktopWidget && mControlScreenIndex > -1) { mDesktopWidget->hide(); - mDesktopWidget->setGeometry(mDesktop->availableGeometry(mDesktopWidget)); + mDesktopWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex)); } if (mControlWidget && mControlScreenIndex > -1) { mControlWidget->hide(); - mControlWidget->setGeometry(mDesktop->availableGeometry(mControlWidget)); + mControlWidget->setGeometry(mDesktop->screenGeometry(mControlScreenIndex)); UBPlatformUtils::showFullScreen(mControlWidget); } From 497e826476b180a9ef7af17901e1fa5f25f13f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Thu, 1 Oct 2020 14:40:24 +0200 Subject: [PATCH 4/5] updated packaging scripts to Qt 5.14 on Linux --- release_scripts/linux/build.sh | 2 +- release_scripts/linux/package.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/release_scripts/linux/build.sh b/release_scripts/linux/build.sh index 42846aeb..d9fccd23 100755 --- a/release_scripts/linux/build.sh +++ b/release_scripts/linux/build.sh @@ -26,7 +26,7 @@ initializeVariables() PRODUCT_PATH="$BUILD_DIR/product" # Qt installation path. This may vary across machines - QT_PATH="/home/dev/Qt/5.13.2/gcc_64" + QT_PATH="/home/dev/Qt/5.14.2/gcc_64" PLUGINS_PATH="$QT_PATH/plugins" GUI_TRANSLATIONS_DIRECTORY_PATH="/usr/share/qt5/translations" QMAKE_PATH="$QT_PATH/bin/qmake" diff --git a/release_scripts/linux/package.sh b/release_scripts/linux/package.sh index df927033..f1f139e7 100755 --- a/release_scripts/linux/package.sh +++ b/release_scripts/linux/package.sh @@ -88,7 +88,7 @@ initializeVariables() BUNDLE_QT=true # Qt installation path. This may vary across machines - QT_PATH="/home/dev/Qt/5.13.2/gcc_64" + QT_PATH="/home/dev/Qt/5.14.2/gcc_64" QT_PLUGINS_SOURCE_PATH="$QT_PATH/plugins" GUI_TRANSLATIONS_DIRECTORY_PATH="/usr/share/qt5/translations" QT_LIBRARY_SOURCE_PATH="$QT_PATH/lib" @@ -225,6 +225,7 @@ if $BUNDLE_QT; then copyQtLibrary libQt5Positioning copyQtLibrary libQt5PrintSupport copyQtLibrary libQt5Qml + copyQtLibrary libQt5QmlModels copyQtLibrary libQt5Quick copyQtLibrary libQt5Script copyQtLibrary libQt5Sensors From 3b166d5298c37dc3f40f21f34cde0fa0ab6ab8a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Fri, 2 Oct 2020 13:14:33 +0200 Subject: [PATCH 5/5] still listen to key press events when focus on Thumbnails view --- src/gui/UBDocumentNavigator.cpp | 115 ++++++++++++++++++++++++++++++++ src/gui/UBDocumentNavigator.h | 2 + 2 files changed, 117 insertions(+) diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index f83540cf..b54d82c8 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -39,6 +39,7 @@ #include "core/UBApplication.h" #include "UBDocumentNavigator.h" #include "board/UBBoardController.h" +#include "board/UBBoardView.h" #include "adaptors/UBThumbnailAdaptor.h" #include "adaptors/UBSvgSubsetAdaptor.h" #include "document/UBDocumentController.h" @@ -354,6 +355,120 @@ void UBDocumentNavigator::mouseReleaseEvent(QMouseEvent *event) mLongPressTimer.stop(); } + +void UBDocumentNavigator::keyPressEvent(QKeyEvent *event) +{ + return; + UBBoardController* controller = UBApplication::boardController; + // send to the scene anyway + QApplication::sendEvent (scene (), event); + + if (!event->isAccepted ()) + { + switch (event->key ()) + { + case Qt::Key_Up: + case Qt::Key_PageUp: + case Qt::Key_Left: + { + controller->previousScene (); + break; + } + + case Qt::Key_Down: + case Qt::Key_PageDown: + case Qt::Key_Right: + case Qt::Key_Space: + { + controller->nextScene (); + break; + } + + case Qt::Key_Home: + { + controller->firstScene (); + break; + } + case Qt::Key_End: + { + controller->lastScene (); + break; + } + case Qt::Key_Insert: + { + controller->addScene (); + break; + } + case Qt::Key_Control: + case Qt::Key_Shift: + { + controller->controlView()->setMultiselection(true); + }break; + } + + + if (event->modifiers () & Qt::ControlModifier) // keep only ctrl/cmd keys + { + switch (event->key ()) + { + case Qt::Key_Plus: + case Qt::Key_I: + { + controller->zoomIn (); + event->accept (); + break; + } + case Qt::Key_Minus: + case Qt::Key_O: + { + controller->zoomOut (); + event->accept (); + break; + } + case Qt::Key_0: + { + controller->zoomRestore (); + event->accept (); + break; + } + case Qt::Key_Left: + { + controller->handScroll (-100, 0); + event->accept (); + break; + } + case Qt::Key_Right: + { + controller->handScroll (100, 0); + event->accept (); + break; + } + case Qt::Key_Up: + { + controller->handScroll (0, -100); + event->accept (); + break; + } + case Qt::Key_Down: + { + controller->handScroll (0, 100); + event->accept (); + break; + } + default: + { + // NOOP + } + } + } + } + + // if ctrl of shift was pressed combined with other keys - we need to disable multiple selection. + if (event->isAccepted()) + controller->controlView()->setMultiselection(false); +} + + void UBDocumentNavigator::longPressTimeout() { if (QApplication::mouseButtons() != Qt::NoButton) diff --git a/src/gui/UBDocumentNavigator.h b/src/gui/UBDocumentNavigator.h index 1ece8536..9e29a2c9 100644 --- a/src/gui/UBDocumentNavigator.h +++ b/src/gui/UBDocumentNavigator.h @@ -72,6 +72,8 @@ protected: virtual void dragMoveEvent(QDragMoveEvent* event); virtual void dropEvent(QDropEvent* event); + virtual void keyPressEvent(QKeyEvent *event); + signals: void mousePressAndHoldEventRequired(); void moveThumbnailRequired(int from, int to);