|
|
|
@ -220,15 +220,38 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() |
|
|
|
|
|
|
|
|
|
void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode) |
|
|
|
|
{ |
|
|
|
|
// Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument
|
|
|
|
|
|
|
|
|
|
switch( mainMode ) |
|
|
|
|
{ |
|
|
|
|
case UBApplicationController::Board: |
|
|
|
|
// call changeMode only when switch NOT from desktop mode
|
|
|
|
|
if(!UBApplication::applicationController->isShowingDesktop()) |
|
|
|
|
changeMode(eUBDockPaletteWidget_BOARD); |
|
|
|
|
case UBApplicationController::Board:
|
|
|
|
|
{ |
|
|
|
|
// call changeMode only when switch NOT from desktop mode
|
|
|
|
|
if(!UBApplication::applicationController->isShowingDesktop()) |
|
|
|
|
changeMode(eUBDockPaletteWidget_BOARD); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case UBApplicationController::Tutorial: |
|
|
|
|
{ |
|
|
|
|
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) |
|
|
|
|
mKeyboardPalette->hide(); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case UBApplicationController::Internet: |
|
|
|
|
changeMode(eUBDockPaletteWidget_WEB); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case UBApplicationController::Document: |
|
|
|
|
changeMode(eUBDockPaletteWidget_DOCUMENT); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
{ |
|
|
|
|
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) |
|
|
|
|
mKeyboardPalette->hide(); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -255,25 +278,25 @@ void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop) |
|
|
|
|
void UBBoardPaletteManager::setupPalettes() |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
setupDockPaletteWidgets(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the other palettes
|
|
|
|
|
mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal); |
|
|
|
|
connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int))); |
|
|
|
|
mStylusPalette->show(); // always show stylus palette at startup
|
|
|
|
|
|
|
|
|
|
if (UBPlatformUtils::hasVirtualKeyboard()) |
|
|
|
|
{ |
|
|
|
|
mKeyboardPalette = UBKeyboardPalette::create(0); |
|
|
|
|
mKeyboardPalette = new UBKeyboardPalette(0); |
|
|
|
|
#ifndef Q_WS_WIN |
|
|
|
|
connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated())); |
|
|
|
|
#endif |
|
|
|
|
#ifndef Q_WS_MAC |
|
|
|
|
mKeyboardPalette->setParent(mContainer); |
|
|
|
|
// mKeyboardPalette->setParent(mContainer);
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setupDockPaletteWidgets(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the other palettes
|
|
|
|
|
mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal); |
|
|
|
|
connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int))); |
|
|
|
|
mStylusPalette->show(); // always show stylus palette at startup
|
|
|
|
|
|
|
|
|
|
mZoomPalette = new UBZoomPalette(mContainer); |
|
|
|
|
|
|
|
|
|
QList<QAction*> backgroundsActions; |
|
|
|
@ -483,7 +506,7 @@ void UBBoardPaletteManager::connectPalettes() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isFirstResized = true; |
|
|
|
|
void UBBoardPaletteManager::containerResized() |
|
|
|
|
{ |
|
|
|
|
int innerMargin = UBSettings::boardMargin; |
|
|
|
@ -493,25 +516,39 @@ void UBBoardPaletteManager::containerResized() |
|
|
|
|
int userTop = innerMargin; |
|
|
|
|
int userHeight = mContainer->height() - (2 * innerMargin); |
|
|
|
|
|
|
|
|
|
mStylusPalette->move(userLeft, userTop); |
|
|
|
|
mStylusPalette->adjustSizeAndPosition(); |
|
|
|
|
mStylusPalette->initPosition(); |
|
|
|
|
if(mStylusPalette) |
|
|
|
|
{ |
|
|
|
|
mStylusPalette->move(userLeft, userTop); |
|
|
|
|
mStylusPalette->adjustSizeAndPosition(); |
|
|
|
|
mStylusPalette->initPosition(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() |
|
|
|
|
, userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); |
|
|
|
|
mZoomPalette->adjustSizeAndPosition(); |
|
|
|
|
if(mZoomPalette) |
|
|
|
|
{ |
|
|
|
|
mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() |
|
|
|
|
, userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); |
|
|
|
|
mZoomPalette->adjustSizeAndPosition(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mKeyboardPalette) |
|
|
|
|
if (isFirstResized && mKeyboardPalette && mKeyboardPalette->parent() == UBApplication::boardController->controlContainer()) |
|
|
|
|
{ |
|
|
|
|
mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2, |
|
|
|
|
userTop + userHeight - mKeyboardPalette->height()); |
|
|
|
|
mKeyboardPalette->adjustSizeAndPosition(); |
|
|
|
|
isFirstResized = false; |
|
|
|
|
mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2, |
|
|
|
|
userTop + (userHeight - mKeyboardPalette->height())/2); |
|
|
|
|
mKeyboardPalette->adjustSizeAndPosition(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height()); |
|
|
|
|
mRightPalette->resize(mRightPalette->width()-1, mContainer->height()); |
|
|
|
|
mLeftPalette->resize(mLeftPalette->width(), mContainer->height()); |
|
|
|
|
mRightPalette->resize(mRightPalette->width(), mContainer->height()); |
|
|
|
|
if(mLeftPalette) |
|
|
|
|
{ |
|
|
|
|
mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height()); |
|
|
|
|
mLeftPalette->resize(mLeftPalette->width(), mContainer->height()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(mRightPalette) |
|
|
|
|
{ |
|
|
|
|
mRightPalette->resize(mRightPalette->width()-1, mContainer->height()); |
|
|
|
|
mRightPalette->resize(mRightPalette->width(), mContainer->height()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -683,6 +720,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is |
|
|
|
|
{ |
|
|
|
|
mLeftPalette->setParent(UBApplication::boardController->controlContainer()); |
|
|
|
|
mRightPalette->setParent(UBApplication::boardController->controlContainer()); |
|
|
|
|
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if(mKeyboardPalette->m_isVisible) |
|
|
|
|
{ |
|
|
|
|
mKeyboardPalette->hide(); |
|
|
|
|
mKeyboardPalette->setParent(UBApplication::boardController->controlContainer()); |
|
|
|
|
mKeyboardPalette->show(); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
mKeyboardPalette->setParent(UBApplication::boardController->controlContainer()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mLeftPalette->setVisible(true); |
|
|
|
|
mRightPalette->setVisible(true); |
|
|
|
@ -696,6 +745,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is |
|
|
|
|
{ |
|
|
|
|
mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); |
|
|
|
|
mRightPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); |
|
|
|
|
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if(mKeyboardPalette->m_isVisible) |
|
|
|
|
{ |
|
|
|
|
mKeyboardPalette->hide(); |
|
|
|
|
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); |
|
|
|
|
mKeyboardPalette->show(); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mLeftPalette->setVisible(false); |
|
|
|
|
mRightPalette->setVisible(true); |
|
|
|
@ -705,12 +766,46 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case eUBDockPaletteWidget_WEB: |
|
|
|
|
{ |
|
|
|
|
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) |
|
|
|
|
{ |
|
|
|
|
WBBrowserWindow* brWnd = UBApplication::webController->GetCurrentWebBrowser(); |
|
|
|
|
|
|
|
|
|
if(mKeyboardPalette->m_isVisible) |
|
|
|
|
{ |
|
|
|
|
mKeyboardPalette->hide(); |
|
|
|
|
mKeyboardPalette->setParent(brWnd); |
|
|
|
|
mKeyboardPalette->show(); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
mKeyboardPalette->setParent(brWnd); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
{ |
|
|
|
|
mLeftPalette->setVisible(false); |
|
|
|
|
mRightPalette->setVisible(false); |
|
|
|
|
mLeftPalette->setParent(0); |
|
|
|
|
mRightPalette->setParent(0); |
|
|
|
|
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if(mKeyboardPalette->m_isVisible) |
|
|
|
|
{ |
|
|
|
|
mKeyboardPalette->hide(); |
|
|
|
|
mKeyboardPalette->setParent(0); |
|
|
|
|
mKeyboardPalette->show(); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
mKeyboardPalette->setParent(0); |
|
|
|
|
|
|
|
|
|
// mKeyboardPalette->update();
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|