Merge branch 'dev-qt5.1x' of https://github.com/OpenBoard-org/OpenBoard into dev-qt5.1x

preferencesAboutTextFull
Clément Fauconnier 4 years ago
commit 25abc5debe
  1. 2
      release_scripts/linux/build.sh
  2. 3
      release_scripts/linux/package.sh
  3. 4
      src/core/UBDisplayManager.cpp
  4. 4
      src/domain/UBGraphicsTextItemDelegate.cpp
  5. 115
      src/gui/UBDocumentNavigator.cpp
  6. 2
      src/gui/UBDocumentNavigator.h
  7. 2
      src/gui/UBScreenMirror.cpp

@ -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"

@ -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

@ -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);
}

@ -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();
}
}

@ -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)

@ -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);

@ -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);
}
}

Loading…
Cancel
Save