Commit f6c3ee89 authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

Virtual keyboard: desktop mode under linux

parent 0264852f
...@@ -95,8 +95,14 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) ...@@ -95,8 +95,14 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
if (UBPlatformUtils::hasVirtualKeyboard()) 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 = UBKeyboardPalette::create(mTransparentDrawingView);
mKeyboardPalette->setParent(mTransparentDrawingView); mKeyboardPalette->setParent(mTransparentDrawingView);
#endif
connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
} }
...@@ -160,6 +166,11 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) ...@@ -160,6 +166,11 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
void UBDesktopAnnotationController::showKeyboard(bool show) void UBDesktopAnnotationController::showKeyboard(bool show)
{ {
#ifdef Q_WS_X11
if (!mTransparentDrawingView->isVisible())
return;
#endif
if(mKeyboardPalette) if(mKeyboardPalette)
{ {
if(show) if(show)
...@@ -170,6 +181,11 @@ void UBDesktopAnnotationController::showKeyboard(bool show) ...@@ -170,6 +181,11 @@ void UBDesktopAnnotationController::showKeyboard(bool show)
} }
} }
void UBDesktopAnnotationController::showKeyboard()
{
if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked())
mKeyboardPalette->show();
}
UBDesktopAnnotationController::~UBDesktopAnnotationController() UBDesktopAnnotationController::~UBDesktopAnnotationController()
{ {
......
...@@ -71,6 +71,7 @@ class UBDesktopAnnotationController : public QObject ...@@ -71,6 +71,7 @@ class UBDesktopAnnotationController : public QObject
void updateBackground(); void updateBackground();
void showKeyboard(bool show); void showKeyboard(bool show);
void showKeyboard(); //X11 virtual keyboard working only needed
signals: signals:
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment