Keyboard issues

preferencesAboutTextFull
Anatoly Mihalchenko 13 years ago
parent 80f48f739d
commit 20ea1cc1b2
  1. 13
      src/board/UBBoardController.cpp
  2. 3
      src/board/UBBoardPaletteManager.h
  3. 21
      src/desktop/UBDesktopAnnotationController.cpp
  4. 5
      src/desktop/UBDesktopPalette.cpp
  5. 1
      src/desktop/UBDesktopPalette.h
  6. 26
      src/document/UBDocumentController.cpp
  7. 6
      src/document/UBDocumentController.h
  8. 3
      src/gui/UBDocumentToolsPalette.cpp

@ -35,6 +35,7 @@
#include "gui/UBToolbarButtonGroup.h" #include "gui/UBToolbarButtonGroup.h"
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "gui/UBToolWidget.h" #include "gui/UBToolWidget.h"
#include "gui/UBKeyboardPalette.h"
#include "domain/UBGraphicsPixmapItem.h" #include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBGraphicsItemUndoCommand.h" #include "domain/UBGraphicsItemUndoCommand.h"
@ -556,6 +557,8 @@ void UBBoardController::blackout()
void UBBoardController::showKeyboard(bool show) void UBBoardController::showKeyboard(bool show)
{ {
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
mPaletteManager->showVirtualKeyboard(show); mPaletteManager->showVirtualKeyboard(show);
} }
@ -1548,7 +1551,15 @@ void UBBoardController::updateBackgroundState()
void UBBoardController::stylusToolChanged(int tool) void UBBoardController::stylusToolChanged(int tool)
{ {
Q_UNUSED(tool); if (UBPlatformUtils::hasVirtualKeyboard() && mPaletteManager->mKeyboardPalette)
{
UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool;
if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
{
if(mPaletteManager->mKeyboardPalette->m_isVisible)
UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
}
}
updateBackgroundState(); updateBackgroundState();
} }

@ -47,6 +47,8 @@ class UBBoardPaletteManager : public QObject
void showVirtualKeyboard(bool show = true); void showVirtualKeyboard(bool show = true);
void initPalettesPosAtStartup(); void initPalettesPosAtStartup();
UBKeyboardPalette *mKeyboardPalette;
public slots: public slots:
void activeSceneChanged(); void activeSceneChanged();
@ -66,7 +68,6 @@ class UBBoardPaletteManager : public QObject
UBStylusPalette *mStylusPalette; UBStylusPalette *mStylusPalette;
UBZoomPalette *mZoomPalette; UBZoomPalette *mZoomPalette;
UBKeyboardPalette *mKeyboardPalette;
UBNavigatorPalette* mNavigPalette; UBNavigatorPalette* mNavigPalette;
UBLibPalette* mLibPalette; UBLibPalette* mLibPalette;

@ -160,10 +160,15 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
void UBDesktopAnnotationController::showKeyboard(bool show) void UBDesktopAnnotationController::showKeyboard(bool show)
{ {
mKeyboardPalette->setVisible(show); if(mKeyboardPalette)
updateMask(true); {
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
mKeyboardPalette->setVisible(show);
updateMask(true);
// mDesktopPalette->showVirtualKeyboard(show);
}
// mDesktopPalette->showVirtualKeyboard(show);
} }
UBDesktopAnnotationController::~UBDesktopAnnotationController() UBDesktopAnnotationController::~UBDesktopAnnotationController()
@ -361,12 +366,10 @@ void UBDesktopAnnotationController::close()
void UBDesktopAnnotationController::stylusToolChanged(int tool) void UBDesktopAnnotationController::stylusToolChanged(int tool)
{ {
UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool;
mDesktopPalette->notifySelectorSelection(UBStylusTool::Selector == eTool); if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text)
if(UBStylusTool::Selector != eTool)
{ {
UBApplication::mainWindow->actionVirtualKeyboard->setChecked(false); if(mKeyboardPalette->m_isVisible)
mKeyboardPalette->setVisible(false); UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger);
} }
updateBackground(); updateBackground();
@ -420,7 +423,7 @@ void UBDesktopAnnotationController::goToUniboard()
UBPlatformUtils::setDesktopMode(false); UBPlatformUtils::setDesktopMode(false);
UBApplication::mainWindow->actionVirtualKeyboard->setEnabled(true); // UBApplication::mainWindow->actionVirtualKeyboard->setEnabled(true);
emit restoreUniboard(); emit restoreUniboard();
} }

@ -217,8 +217,3 @@ QPoint UBDesktopPalette::buttonPos(QAction *action)
return p; return p;
} }
void UBDesktopPalette::notifySelectorSelection(bool selected)
{
UBApplication::mainWindow->actionVirtualKeyboard->setEnabled(selected);
}

@ -27,7 +27,6 @@ class UBDesktopPalette : public UBActionPalette
void disappearForCapture(); void disappearForCapture();
void appear(); void appear();
QPoint buttonPos(QAction* action); QPoint buttonPos(QAction* action);
void notifySelectorSelection(bool selected);
signals: signals:
void uniboardClick(); void uniboardClick();

@ -36,6 +36,9 @@
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h" #include "board/UBBoardPaletteManager.h"
#include "board/UBDrawingController.h"
#include "gui/UBKeyboardPalette.h"
#include "gui/UBThumbnailView.h" #include "gui/UBThumbnailView.h"
#include "gui/UBDocumentTreeWidget.h" #include "gui/UBDocumentTreeWidget.h"
@ -67,6 +70,7 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
, mToolsPalette(0) , mToolsPalette(0)
, mToolsPalettePositionned(false) , mToolsPalettePositionned(false)
, mTrashTi(0) , mTrashTi(0)
, mKeyboardPalette(0)
{ {
setupViews(); setupViews();
setupToolbar(); setupToolbar();
@ -439,6 +443,14 @@ void UBDocumentController::setupViews()
mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget); mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget);
mMessageWindow->hide(); mMessageWindow->hide();
if (UBPlatformUtils::hasVirtualKeyboard())
{
mKeyboardPalette = UBKeyboardPalette::create(0);
mKeyboardPalette->setParent(controlView());
connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool)));
}
} }
} }
@ -455,9 +467,21 @@ void UBDocumentController::setupToolbar()
connect(mMainWindow->actionDocumentTools, SIGNAL(triggered()), this, SLOT(toggleDocumentToolsPalette())); connect(mMainWindow->actionDocumentTools, SIGNAL(triggered()), this, SLOT(toggleDocumentToolsPalette()));
} }
void UBDocumentController::showKeyboard(bool show)
{
if(mKeyboardPalette)
{
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
mKeyboardPalette->setVisible(show);
}
// mPaletteManager->showVirtualKeyboard(show);
}
void UBDocumentController::setupPalettes() void UBDocumentController::setupPalettes()
{ {
mToolsPalette = new UBDocumentToolsPalette(controlView()); mToolsPalette = new UBDocumentToolsPalette(controlView());
mToolsPalette->hide(); mToolsPalette->hide();
@ -478,7 +502,7 @@ void UBDocumentController::show()
selectionChanged(); selectionChanged();
if (!mToolsPalette) if(!mToolsPalette)
setupPalettes(); setupPalettes();
} }

@ -34,6 +34,7 @@ class UBDocumentGroupTreeItem;
class UBDocumentProxyTreeItem; class UBDocumentProxyTreeItem;
class UBMainWindow; class UBMainWindow;
class UBDocumentToolsPalette; class UBDocumentToolsPalette;
class UBKeyboardPalette;
class UBDocumentController : public QObject class UBDocumentController : public QObject
{ {
@ -73,6 +74,8 @@ class UBDocumentController : public QObject
void paste(); void paste();
void focusChanged(QWidget *old, QWidget *current); void focusChanged(QWidget *old, QWidget *current);
void showKeyboard(bool show);
protected: protected:
virtual void setupViews(); virtual void setupViews();
virtual void setupToolbar(); virtual void setupToolbar();
@ -107,6 +110,9 @@ class UBDocumentController : public QObject
UBDocumentGroupTreeItem* mTrashTi; UBDocumentGroupTreeItem* mTrashTi;
UBDocumentProxy* mCurrentDocument; UBDocumentProxy* mCurrentDocument;
UBKeyboardPalette *mKeyboardPalette;
private slots: private slots:
void documentZoomSliderValueChanged (int value); void documentZoomSliderValueChanged (int value);
void loadDocumentProxies(); void loadDocumentProxies();

@ -30,6 +30,9 @@ UBDocumentToolsPalette::UBDocumentToolsPalette(QWidget *parent)
{ {
QList<QAction*> actions; QList<QAction*> actions;
if (UBPlatformUtils::hasVirtualKeyboard())
actions << UBApplication::mainWindow->actionVirtualKeyboard;
setActions(actions); setActions(actions);
setButtonIconSize(QSize(42, 42)); setButtonIconSize(QSize(42, 42));

Loading…
Cancel
Save