Keyboard issues

preferencesAboutTextFull
Anatoly Mihalchenko 14 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/UBMainWindow.h"
#include "gui/UBToolWidget.h"
#include "gui/UBKeyboardPalette.h"
#include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBGraphicsItemUndoCommand.h"
@ -556,6 +557,8 @@ void UBBoardController::blackout()
void UBBoardController::showKeyboard(bool show)
{
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
mPaletteManager->showVirtualKeyboard(show);
}
@ -1548,7 +1551,15 @@ void UBBoardController::updateBackgroundState()
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();
}

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

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

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

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

@ -36,6 +36,9 @@
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#include "board/UBDrawingController.h"
#include "gui/UBKeyboardPalette.h"
#include "gui/UBThumbnailView.h"
#include "gui/UBDocumentTreeWidget.h"
@ -67,6 +70,7 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
, mToolsPalette(0)
, mToolsPalettePositionned(false)
, mTrashTi(0)
, mKeyboardPalette(0)
{
setupViews();
setupToolbar();
@ -439,6 +443,14 @@ void UBDocumentController::setupViews()
mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget);
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()));
}
void UBDocumentController::showKeyboard(bool show)
{
if(mKeyboardPalette)
{
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
mKeyboardPalette->setVisible(show);
}
// mPaletteManager->showVirtualKeyboard(show);
}
void UBDocumentController::setupPalettes()
{
mToolsPalette = new UBDocumentToolsPalette(controlView());
mToolsPalette->hide();
@ -478,7 +502,7 @@ void UBDocumentController::show()
selectionChanged();
if (!mToolsPalette)
if(!mToolsPalette)
setupPalettes();
}

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

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

Loading…
Cancel
Save