From 0264852feb2bd5d71e7631c3feac6609f40b0627 Mon Sep 17 00:00:00 2001 From: Anatoly Mihalchenko Date: Mon, 22 Aug 2011 18:54:19 +0300 Subject: [PATCH 1/2] GraphicsTriangle - drawing --- src/tools/UBGraphicsTriangle.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tools/UBGraphicsTriangle.cpp b/src/tools/UBGraphicsTriangle.cpp index 90fde242..ea60c4e0 100644 --- a/src/tools/UBGraphicsTriangle.cpp +++ b/src/tools/UBGraphicsTriangle.cpp @@ -802,6 +802,7 @@ void UBGraphicsTriangle::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) mVFlipSvgItem->setVisible(false); mHFlipSvgItem->setVisible(false); mRotateSvgItem->setVisible(false); + UBDrawingController::drawingController()->mActiveRuler = NULL; event->accept(); update(); } @@ -824,21 +825,20 @@ void UBGraphicsTriangle::hoverMoveEvent(QGraphicsSceneHoverEvent *event) else if (closeButtonRect().contains(event->pos())) setCursor(closeCursor()); else if (hFlipRect().contains(event->pos()) - || vFlipRect().contains(event->pos())) - setCursor(flipCursor()); + || vFlipRect().contains(event->pos())) + setCursor(flipCursor()); else if (rotateRect().contains(event->pos())) setCursor(rotateCursor()); else setCursor(moveCursor()); + event->accept(); + } else if (UBDrawingController::drawingController()->isDrawingTool()) { event->accept(); } } void UBGraphicsTriangle::StartLine(const QPointF &scenePos, qreal width) { - qDebug() << "morientation" << mOrientation; - //qDebug() << "triangle rect()" << rect(); - QPointF itemPos = mapFromScene(scenePos); qreal y; From f6c3ee89b7fa7be39f9152eb54c390f4d2a92daf Mon Sep 17 00:00:00 2001 From: Anatoly Mihalchenko Date: Mon, 22 Aug 2011 19:30:01 +0300 Subject: [PATCH 2/2] Virtual keyboard: desktop mode under linux --- src/desktop/UBDesktopAnnotationController.cpp | 16 ++++++++++++++++ src/desktop/UBDesktopAnnotationController.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index d95b9eb3..1bd1b45c 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -95,8 +95,14 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) if (UBPlatformUtils::hasVirtualKeyboard()) { +#ifdef Q_WS_X11 + mKeyboardPalette = UBKeyboardPalette::create(0); + connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide())); + connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard())); +#else mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); mKeyboardPalette->setParent(mTransparentDrawingView); +#endif connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); } @@ -160,6 +166,11 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) void UBDesktopAnnotationController::showKeyboard(bool show) { + #ifdef Q_WS_X11 + if (!mTransparentDrawingView->isVisible()) + return; + #endif + if(mKeyboardPalette) { if(show) @@ -170,6 +181,11 @@ void UBDesktopAnnotationController::showKeyboard(bool show) } } +void UBDesktopAnnotationController::showKeyboard() +{ + if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked()) + mKeyboardPalette->show(); +} UBDesktopAnnotationController::~UBDesktopAnnotationController() { diff --git a/src/desktop/UBDesktopAnnotationController.h b/src/desktop/UBDesktopAnnotationController.h index 605ce5d9..c4e9fea3 100644 --- a/src/desktop/UBDesktopAnnotationController.h +++ b/src/desktop/UBDesktopAnnotationController.h @@ -71,6 +71,7 @@ class UBDesktopAnnotationController : public QObject void updateBackground(); void showKeyboard(bool show); + void showKeyboard(); //X11 virtual keyboard working only needed signals: /**