linux hotfix 6bbecff SANKORE-329 Visibility of palette based on children elements

preferencesAboutTextFull
Ivan Ilin 13 years ago
parent 6bbecff5de
commit 4a051f2ac4
  1. 6
      src/board/UBBoardPaletteManager.cpp
  2. 19
      src/desktop/UBDesktopAnnotationController.cpp
  3. 2
      src/gui/UBDockPaletteWidget.h
  4. 2
      src/gui/UBTeacherBarWidget.h

@ -692,7 +692,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{ {
case eUBDockPaletteWidget_BOARD: case eUBDockPaletteWidget_BOARD:
{ {
mLeftPalette->setParent(UBApplication::boardController->controlContainer()); mLeftPalette->assignParent(UBApplication::boardController->controlContainer());
mRightPalette->assignParent(UBApplication::boardController->controlContainer()); mRightPalette->assignParent(UBApplication::boardController->controlContainer());
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{ {
@ -721,7 +721,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
case eUBDockPaletteWidget_DESKTOP: case eUBDockPaletteWidget_DESKTOP:
{ {
mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mLeftPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mRightPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{ {
@ -775,7 +775,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{ {
mLeftPalette->setVisible(leftPaletteVisible); mLeftPalette->setVisible(leftPaletteVisible);
mRightPalette->setVisible(rightPaletteVisible); mRightPalette->setVisible(rightPaletteVisible);
mLeftPalette->setParent(0); mLeftPalette->assignParent(0);
mRightPalette->assignParent(0); mRightPalette->assignParent(0);
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{ {

@ -888,12 +888,16 @@ void UBDesktopAnnotationController::TransparentWidgetResized()
void UBDesktopAnnotationController::onTransparentWidgetResized() void UBDesktopAnnotationController::onTransparentWidgetResized()
{ {
int rW = UBApplication::boardController->paletteManager()->rightPalette()->width(); int rW = UBApplication::boardController->paletteManager()->rightPalette()->width();
int rH_ = UBApplication::boardController->paletteManager()->rightPalette()->height(); int lW = UBApplication::boardController->paletteManager()->leftPalette()->width();
int rH = mTransparentDrawingView->height(); int rH = mTransparentDrawingView->height();
UBApplication::boardController->paletteManager()->rightPalette()->resize(rW+1, rH); UBApplication::boardController->paletteManager()->rightPalette()->resize(rW+1, rH);
UBApplication::boardController->paletteManager()->rightPalette()->resize(rW, rH); UBApplication::boardController->paletteManager()->rightPalette()->resize(rW, rH);
UBApplication::boardController->paletteManager()->leftPalette()->resize(lW+1, rH);
UBApplication::boardController->paletteManager()->leftPalette()->resize(lW, rH);
// mRightPalette->resize(mRightPalette->width(), mTransparentDrawingView->height()); // mRightPalette->resize(mRightPalette->width(), mTransparentDrawingView->height());
} }
@ -923,6 +927,19 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
UBApplication::boardController->paletteManager()->mKeyboardPalette->width(), UBApplication::boardController->paletteManager()->mKeyboardPalette->height()); UBApplication::boardController->paletteManager()->mKeyboardPalette->width(), UBApplication::boardController->paletteManager()->mKeyboardPalette->height());
} }
if(UBApplication::boardController->paletteManager()->leftPalette()->isVisible())
{
QRect leftPalette(UBApplication::boardController->paletteManager()->leftPalette()->geometry().x(),
UBApplication::boardController->paletteManager()->leftPalette()->geometry().y(),
UBApplication::boardController->paletteManager()->leftPalette()->width(),
UBApplication::boardController->paletteManager()->leftPalette()->height());
QRect tabsPalette(UBApplication::boardController->paletteManager()->leftPalette()->getTabPaletteRect());
p.drawRect(leftPalette);
p.drawRect(tabsPalette);
}
if(UBApplication::boardController->paletteManager()->rightPalette()->isVisible()) if(UBApplication::boardController->paletteManager()->rightPalette()->isVisible())
{ {
QRect rightPalette(UBApplication::boardController->paletteManager()->rightPalette()->geometry().x(), QRect rightPalette(UBApplication::boardController->paletteManager()->rightPalette()->geometry().x(),

@ -25,7 +25,7 @@ public:
QPixmap iconToLeft(); QPixmap iconToLeft();
QString name(); QString name();
virtual bool visibleInMode(eUBDockPaletteWidgetMode mode) = NULL; virtual bool visibleInMode(eUBDockPaletteWidgetMode mode) = 0;
bool visibleState(){return mVisibleState;} bool visibleState(){return mVisibleState;}
void setVisibleState(bool state){mVisibleState = state;} void setVisibleState(bool state){mVisibleState = state;}

@ -48,7 +48,7 @@ public:
bool visibleInMode(eUBDockPaletteWidgetMode mode) bool visibleInMode(eUBDockPaletteWidgetMode mode)
{ {
return mode == eUBDockPaletteWidget_BOARD; return (mode == eUBDockPaletteWidget_BOARD) || (mode == eUBDockPaletteWidget_DESKTOP);
} }
public slots: public slots:

Loading…
Cancel
Save