From e08b1f56c979f1bfb4e7d180adb5c5e8adc8a51f Mon Sep 17 00:00:00 2001 From: Didier Clerc Date: Mon, 22 Jul 2013 17:31:35 +0900 Subject: [PATCH] Fixed a problem with the colors on desktop mode --- src/desktop/UBDesktopAnnotationController.cpp | 12 +++++++++++- src/desktop/UBDesktopAnnotationController.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 64e49223..9ab923b5 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -91,6 +91,8 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB mTransparentDrawingView->setStyleSheet(backgroundStyle); mTransparentDrawingScene = new UBGraphicsScene(0, false); + updateColors(); + mTransparentDrawingView->setScene(mTransparentDrawingScene); mTransparentDrawingScene->setDrawingMode(true); @@ -150,7 +152,8 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB mDesktopEraserPalette->setVisible(false); connect(UBApplication::mainWindow->actionEraseDesktopAnnotations, SIGNAL(triggered()), this, SLOT(eraseDesktopAnnotations())); - + connect(UBApplication::boardController, SIGNAL(backgroundChanged()), this, SLOT(updateColors())); + connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), this, SLOT(updateColors())); connect(&mHoldTimerPen, SIGNAL(timeout()), this, SLOT(penActionReleased())); connect(&mHoldTimerMarker, SIGNAL(timeout()), this, SLOT(markerActionReleased())); connect(&mHoldTimerEraser, SIGNAL(timeout()), this, SLOT(eraserActionReleased())); @@ -174,6 +177,13 @@ UBDesktopAnnotationController::~UBDesktopAnnotationController() delete mTransparentDrawingView; } +void UBDesktopAnnotationController::updateColors(){ + if(UBApplication::boardController->activeScene()->isDarkBackground()){ + mTransparentDrawingScene->setBackground(true, false); + }else{ + mTransparentDrawingScene->setBackground(false, false); + } +} UBDesktopPalette* UBDesktopAnnotationController::desktopPalette() { diff --git a/src/desktop/UBDesktopAnnotationController.h b/src/desktop/UBDesktopAnnotationController.h index bb2c8b1d..bca9e19e 100644 --- a/src/desktop/UBDesktopAnnotationController.h +++ b/src/desktop/UBDesktopAnnotationController.h @@ -100,6 +100,7 @@ class UBDesktopAnnotationController : public QObject UBGraphicsScene* mTransparentDrawingScene; private slots: + void updateColors(); void desktopPenActionToggled(bool checked); void desktopMarkerActionToggled(bool checked); void desktopEraserActionToggled(bool checked);