Commit 5ae6e6b6 authored by Claudio Valerio's avatar Claudio Valerio

removed UBDesktopToolPalette

parent b264964c
......@@ -37,7 +37,6 @@
#include "UBCustomCaptureWindow.h"
#include "UBWindowCapture.h"
#include "UBDesktopPalette.h"
#include "UBDesktopToolsPalette.h"
#include "UBDesktopPenPalette.h"
#include "UBDesktopMarkerPalette.h"
#include "UBDesktopEraserPalette.h"
......@@ -52,7 +51,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mTransparentDrawingScene(0)
, mDesktopPalette(NULL)
, mKeyboardPalette(0)
, mDesktopToolsPalette(NULL)
, mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL)
......@@ -124,7 +122,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, this, SLOT(stylusToolChanged(int)));
// Add the desktop associated palettes
mDesktopToolsPalette = new UBDesktopToolsPalette(mTransparentDrawingView);
mDesktopPenPalette = new UBDesktopPenPalette(mTransparentDrawingView);
connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized()));
......@@ -134,12 +131,10 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mDesktopEraserPalette = new UBDesktopEraserPalette(mTransparentDrawingView);
mDesktopPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopToolsPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopPenPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopMarkerPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopEraserPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopToolsPalette->setVisible(UBApplication::mainWindow->actionDesktopTools->isChecked());
// Hack : the size of the property palettes is computed the first time the palette is visible
// In order to prevent palette overlap on if the desktop palette is on the right of the
......@@ -151,7 +146,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mDesktopMarkerPalette->setVisible(false);
mDesktopEraserPalette->setVisible(false);
connect(UBApplication::mainWindow->actionDesktopTools, SIGNAL(triggered(bool)), this, SLOT(desktopToolsActionToogled(bool)));
connect(UBApplication::mainWindow->actionEraseDesktopAnnotations, SIGNAL(triggered()), this, SLOT(eraseDesktopAnnotations()));
connect(&mHoldTimerPen, SIGNAL(timeout()), this, SLOT(penActionReleased()));
......@@ -226,23 +220,6 @@ UBDesktopPalette* UBDesktopAnnotationController::desktopPalette()
return mDesktopPalette;
}
void UBDesktopAnnotationController::desktopToolsActionToogled(bool checked)
{
if (!mDesktopToolsPalettePositioned)
{
QPoint pos = mDesktopPalette->geometry().bottomLeft();
pos += QPoint(0, 10);
mDesktopToolsPalette->setCustomPosition(true);
mDesktopToolsPalette->move(pos);
mDesktopToolsPalettePositioned = true;
}
mDesktopToolsPalette->setVisible(checked);
}
/**
* \brief Toggle the visibility of the pen associated palette
* @param checked as the visibility state
......
......@@ -23,7 +23,6 @@
#include "gui/UBRightPalette.h"
class UBDesktopPalette;
class UBDesktopToolsPalette;
class UBBoardView;
class UBGraphicsScene;
class UBDesktopPenPalette;
......@@ -89,7 +88,6 @@ class UBDesktopAnnotationController : public QObject
UBGraphicsScene* mTransparentDrawingScene;
private slots:
void desktopToolsActionToogled(bool);
void desktopPenActionToggled(bool checked);
void desktopMarkerActionToggled(bool checked);
void desktopEraserActionToggled(bool checked);
......@@ -112,7 +110,6 @@ class UBDesktopAnnotationController : public QObject
UBDesktopPalette *mDesktopPalette;
UBKeyboardPalette *mKeyboardPalette;
UBDesktopToolsPalette *mDesktopToolsPalette;
UBDesktopPenPalette* mDesktopPenPalette;
UBDesktopMarkerPalette* mDesktopMarkerPalette;
UBDesktopEraserPalette* mDesktopEraserPalette;
......
......@@ -159,8 +159,6 @@ void UBDesktopPalette::maximizeMe()
actions << mDisplaySelectAction;
actions << mShowHideAction;
//actions << UBApplication::mainWindow->actionDesktopTools;
setActions(actions);
QSize newSize = preferredSize();
......
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "UBDesktopToolsPalette.h"
#include "core/UBApplication.h"
#include "core/UBSettings.h"
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "gui/UBMainWindow.h"
#include "gui/UBToolbarButtonGroup.h"
#include "core/memcheck.h"
UBDesktopToolsPalette::UBDesktopToolsPalette(QWidget *parent)
: UBActionPalette(Qt::Horizontal, parent)
{
// Setup color choice widget
QList<QAction *> colorActions;
colorActions.append(UBApplication::mainWindow->actionColor0);
colorActions.append(UBApplication::mainWindow->actionColor1);
colorActions.append(UBApplication::mainWindow->actionColor2);
colorActions.append(UBApplication::mainWindow->actionColor3);
UBToolbarButtonGroup *colorChoice =
new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, colorActions);
colorChoice->displayText(false);
//connect(colorChoice, SIGNAL(activated(int)), this, SLOT(UBApplication::boardController->setColorIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), colorChoice, SLOT(setCurrentIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged()));
layout()->addWidget(colorChoice);
// Setup line width choice widget
QList<QAction *> lineWidthActions;
lineWidthActions.append(UBApplication::mainWindow->actionLineSmall);
lineWidthActions.append(UBApplication::mainWindow->actionLineMedium);
lineWidthActions.append(UBApplication::mainWindow->actionLineLarge);
UBToolbarButtonGroup *lineWidthChoice =
new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, lineWidthActions);
lineWidthChoice->displayText(false);
connect(lineWidthChoice, SIGNAL(activated(int))
, UBDrawingController::drawingController(), SLOT(setLineWidthIndex(int)));
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int))
, lineWidthChoice, SLOT(setCurrentIndex(int)));
layout()->addWidget(lineWidthChoice);
// Setup eraser width choice widget
QList<QAction *> eraserWidthActions;
eraserWidthActions.append(UBApplication::mainWindow->actionEraserSmall);
eraserWidthActions.append(UBApplication::mainWindow->actionEraserMedium);
eraserWidthActions.append(UBApplication::mainWindow->actionEraserLarge);
UBToolbarButtonGroup *eraserWidthChoice =
new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, eraserWidthActions);
connect(eraserWidthChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setEraserWidthIndex(int)));
eraserWidthChoice->displayText(false);
eraserWidthChoice->setCurrentIndex(UBSettings::settings()->eraserWidthIndex());
layout()->addWidget(eraserWidthChoice);
addAction(UBApplication::mainWindow->actionEraseDesktopAnnotations);
}
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBDESKTOPTOOLSPALETTE_H
#define UBDESKTOPTOOLSPALETTE_H
#include <QtGui>
#include "gui/UBActionPalette.h"
class UBDesktopToolsPalette : public UBActionPalette
{
public:
UBDesktopToolsPalette(QWidget *parent = 0);
virtual ~UBDesktopToolsPalette(){}
};
#endif // UBDESKTOPTOOLSPALETTE_H
......@@ -2,7 +2,6 @@ HEADERS += src/desktop/UBDesktopPalette.h \
src/desktop/UBDesktopAnnotationController.h \
src/desktop/UBCustomCaptureWindow.h \
src/desktop/UBWindowCapture.h \
src/desktop/UBDesktopToolsPalette.h \
src/desktop/UBDesktopPenPalette.h \
src/desktop/UBDesktopMarkerPalette.h \
src/desktop/UBDesktopEraserPalette.h
......@@ -10,7 +9,6 @@ HEADERS += src/desktop/UBDesktopPalette.h \
SOURCES += src/desktop/UBDesktopPalette.cpp \
src/desktop/UBDesktopAnnotationController.cpp \
src/desktop/UBCustomCaptureWindow.cpp \
src/desktop/UBDesktopToolsPalette.cpp \
src/desktop/UBDesktopPenPalette.cpp \
src/desktop/UBDesktopMarkerPalette.cpp \
src/desktop/UBDesktopEraserPalette.cpp
......
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