Fixed a problem with the colors on desktop mode

preferencesAboutTextFull
Didier Clerc 12 years ago
parent d7f38d2a01
commit e08b1f56c9
  1. 12
      src/desktop/UBDesktopAnnotationController.cpp
  2. 1
      src/desktop/UBDesktopAnnotationController.h

@ -91,6 +91,8 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
mTransparentDrawingView->setStyleSheet(backgroundStyle); mTransparentDrawingView->setStyleSheet(backgroundStyle);
mTransparentDrawingScene = new UBGraphicsScene(0, false); mTransparentDrawingScene = new UBGraphicsScene(0, false);
updateColors();
mTransparentDrawingView->setScene(mTransparentDrawingScene); mTransparentDrawingView->setScene(mTransparentDrawingScene);
mTransparentDrawingScene->setDrawingMode(true); mTransparentDrawingScene->setDrawingMode(true);
@ -150,7 +152,8 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
mDesktopEraserPalette->setVisible(false); mDesktopEraserPalette->setVisible(false);
connect(UBApplication::mainWindow->actionEraseDesktopAnnotations, SIGNAL(triggered()), this, SLOT(eraseDesktopAnnotations())); 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(&mHoldTimerPen, SIGNAL(timeout()), this, SLOT(penActionReleased()));
connect(&mHoldTimerMarker, SIGNAL(timeout()), this, SLOT(markerActionReleased())); connect(&mHoldTimerMarker, SIGNAL(timeout()), this, SLOT(markerActionReleased()));
connect(&mHoldTimerEraser, SIGNAL(timeout()), this, SLOT(eraserActionReleased())); connect(&mHoldTimerEraser, SIGNAL(timeout()), this, SLOT(eraserActionReleased()));
@ -174,6 +177,13 @@ UBDesktopAnnotationController::~UBDesktopAnnotationController()
delete mTransparentDrawingView; delete mTransparentDrawingView;
} }
void UBDesktopAnnotationController::updateColors(){
if(UBApplication::boardController->activeScene()->isDarkBackground()){
mTransparentDrawingScene->setBackground(true, false);
}else{
mTransparentDrawingScene->setBackground(false, false);
}
}
UBDesktopPalette* UBDesktopAnnotationController::desktopPalette() UBDesktopPalette* UBDesktopAnnotationController::desktopPalette()
{ {

@ -100,6 +100,7 @@ class UBDesktopAnnotationController : public QObject
UBGraphicsScene* mTransparentDrawingScene; UBGraphicsScene* mTransparentDrawingScene;
private slots: private slots:
void updateColors();
void desktopPenActionToggled(bool checked); void desktopPenActionToggled(bool checked);
void desktopMarkerActionToggled(bool checked); void desktopMarkerActionToggled(bool checked);
void desktopEraserActionToggled(bool checked); void desktopEraserActionToggled(bool checked);

Loading…
Cancel
Save