commit
c739f52dbd
@ -1,48 +0,0 @@ |
||||
/*
|
||||
* 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 2 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 "UBDesktopEraserPalette.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" |
||||
|
||||
UBDesktopEraserPalette::UBDesktopEraserPalette(QWidget *parent) |
||||
: UBPropertyPalette(Qt::Horizontal, parent) |
||||
{ |
||||
// 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))); |
||||
connect(eraserWidthChoice, SIGNAL(activated(int)), this, SLOT(close())); |
||||
connect(UBApplication::mainWindow->actionEraseDesktopAnnotations, SIGNAL(triggered()), this, SLOT(close())); |
||||
|
||||
eraserWidthChoice->displayText(false); |
||||
eraserWidthChoice->setCurrentIndex(UBSettings::settings()->eraserWidthIndex()); |
||||
|
||||
layout()->addWidget(eraserWidthChoice); |
||||
|
||||
addAction(UBApplication::mainWindow->actionEraseDesktopAnnotations); |
||||
} |
@ -1,29 +0,0 @@ |
||||
/*
|
||||
* 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 2 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 UBDESKTOPERASERPALETTE_H |
||||
#define UBDESKTOPERASERPALETTE_H |
||||
|
||||
#include <QtGui> |
||||
|
||||
#include "gui/UBPropertyPalette.h" |
||||
|
||||
class UBDesktopEraserPalette : public UBPropertyPalette |
||||
{ |
||||
public: |
||||
UBDesktopEraserPalette(QWidget *parent = 0); |
||||
virtual ~UBDesktopEraserPalette(){} |
||||
}; |
||||
|
||||
#endif // UBDESKTOPERASERPALETTE_H
|
@ -1,61 +0,0 @@ |
||||
/*
|
||||
* 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 2 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 "UBDesktopMarkerPalette.h" |
||||
|
||||
#include "core/UBApplication.h" |
||||
#include "board/UBBoardController.h" |
||||
#include "board/UBDrawingController.h" |
||||
#include "gui/UBMainWindow.h" |
||||
#include "gui/UBToolbarButtonGroup.h" |
||||
|
||||
#include "core/memcheck.h" |
||||
|
||||
UBDesktopMarkerPalette::UBDesktopMarkerPalette(QWidget *parent) |
||||
: UBPropertyPalette(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(colorIndexChanged(int)), this, SLOT(close())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), this, SLOT(close())); |
||||
|
||||
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(lineWidthChoice, SIGNAL(activated(int)), this, SLOT(close())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), lineWidthChoice, SLOT(setCurrentIndex(int))); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), this, SLOT(close())); |
||||
|
||||
layout()->addWidget(lineWidthChoice); |
||||
} |
@ -1,29 +0,0 @@ |
||||
/*
|
||||
* 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 2 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 UBDESKTOPMARKERPALETTE_H |
||||
#define UBDESKTOPMARKERPALETTE_H |
||||
|
||||
#include <QtGui> |
||||
|
||||
#include "gui/UBPropertyPalette.h" |
||||
|
||||
class UBDesktopMarkerPalette : public UBPropertyPalette |
||||
{ |
||||
public: |
||||
UBDesktopMarkerPalette(QWidget *parent = 0); |
||||
virtual ~UBDesktopMarkerPalette(){} |
||||
}; |
||||
|
||||
#endif // UBDESKTOPMARKERPALETTE_H
|
@ -1,103 +0,0 @@ |
||||
/*
|
||||
* 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 2 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 "UBDesktopPenPalette.h" |
||||
|
||||
#include "core/UBApplication.h" |
||||
#include "board/UBBoardController.h" |
||||
#include "board/UBDrawingController.h" |
||||
#include "gui/UBMainWindow.h" |
||||
#include "gui/UBToolbarButtonGroup.h" |
||||
|
||||
#include "core/memcheck.h" |
||||
|
||||
UBDesktopPenPalette::UBDesktopPenPalette(QWidget *parent) |
||||
: UBPropertyPalette(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(colorIndexChanged(int)), this, SLOT(close())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), this, SLOT(close())); |
||||
|
||||
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(lineWidthChoice, SIGNAL(activated(int)), this, SLOT(close())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), lineWidthChoice, SLOT(setCurrentIndex(int))); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), this, SLOT(close())); |
||||
|
||||
onParentMaximized(); |
||||
|
||||
layout()->addWidget(lineWidthChoice); |
||||
} |
||||
|
||||
void UBDesktopPenPalette::onButtonReleased() |
||||
{ |
||||
qDebug() << "Pen palette released!"; |
||||
// trigger the related action
|
||||
|
||||
|
||||
// Close the palette
|
||||
close(); |
||||
} |
||||
|
||||
/**
|
||||
* \brief Disconnect the released event of the buttons |
||||
*/ |
||||
void UBDesktopPenPalette::onParentMinimized() |
||||
{ |
||||
for(int i = 0; i < mButtons.size(); i++) |
||||
{ |
||||
disconnect(mButtons.at(i), SIGNAL(released()), this, SLOT(onButtonReleased())); |
||||
} |
||||
} |
||||
|
||||
/**
|
||||
* \brief Connect the released event of the buttons |
||||
*/ |
||||
void UBDesktopPenPalette::onParentMaximized() |
||||
{ |
||||
for(int i = 0; i < mButtons.size(); i++) |
||||
{ |
||||
connect(mButtons.at(i), SIGNAL(released()), this, SLOT(onButtonReleased())); |
||||
} |
||||
} |
||||
|
||||
void UBDesktopPenPalette::resizeEvent(QResizeEvent *) |
||||
{ |
||||
qDebug("pen palette resized!"); |
||||
} |
@ -0,0 +1,170 @@ |
||||
/*
|
||||
* 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 2 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 "UBDesktopPropertyPalette.h" |
||||
|
||||
#include "core/UBApplication.h" |
||||
#include "board/UBBoardController.h" |
||||
#include "board/UBDrawingController.h" |
||||
#include "gui/UBMainWindow.h" |
||||
#include "gui/UBToolbarButtonGroup.h" |
||||
#include "gui/UBRightPalette.h" |
||||
|
||||
#include "core/memcheck.h" |
||||
|
||||
UBDesktopPropertyPalette::UBDesktopPropertyPalette(QWidget *parent, UBRightPalette* _rightPalette) |
||||
:UBPropertyPalette(Qt::Horizontal, parent) |
||||
,rightPalette(_rightPalette) |
||||
{} |
||||
|
||||
int UBDesktopPropertyPalette::getParentRightOffset() |
||||
{ |
||||
return rightPalette->width(); |
||||
} |
||||
|
||||
|
||||
UBDesktopPenPalette::UBDesktopPenPalette(QWidget *parent, UBRightPalette* rightPalette) |
||||
: UBDesktopPropertyPalette(parent, rightPalette) |
||||
{ |
||||
// 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(colorIndexChanged(int)), this, SLOT(close())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), this, SLOT(close())); |
||||
|
||||
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(lineWidthChoice, SIGNAL(activated(int)), this, SLOT(close())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), lineWidthChoice, SLOT(setCurrentIndex(int))); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), this, SLOT(close())); |
||||
|
||||
onParentMaximized(); |
||||
|
||||
layout()->addWidget(lineWidthChoice); |
||||
} |
||||
|
||||
|
||||
void UBDesktopPenPalette::onButtonReleased() |
||||
{ |
||||
close(); |
||||
} |
||||
|
||||
/**
|
||||
* \brief Disconnect the released event of the buttons |
||||
*/ |
||||
void UBDesktopPenPalette::onParentMinimized() |
||||
{ |
||||
for(int i = 0; i < mButtons.size(); i++) |
||||
{ |
||||
disconnect(mButtons.at(i), SIGNAL(released()), this, SLOT(onButtonReleased())); |
||||
} |
||||
} |
||||
|
||||
/**
|
||||
* \brief Connect the released event of the buttons |
||||
*/ |
||||
void UBDesktopPenPalette::onParentMaximized() |
||||
{ |
||||
for(int i = 0; i < mButtons.size(); i++) |
||||
{ |
||||
connect(mButtons.at(i), SIGNAL(released()), this, SLOT(onButtonReleased())); |
||||
} |
||||
} |
||||
|
||||
|
||||
UBDesktopEraserPalette::UBDesktopEraserPalette(QWidget *parent, UBRightPalette* rightPalette) |
||||
: UBDesktopPropertyPalette(parent, rightPalette) |
||||
{ |
||||
// 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))); |
||||
connect(eraserWidthChoice, SIGNAL(activated(int)), this, SLOT(close())); |
||||
connect(UBApplication::mainWindow->actionEraseDesktopAnnotations, SIGNAL(triggered()), this, SLOT(close())); |
||||
|
||||
eraserWidthChoice->displayText(false); |
||||
eraserWidthChoice->setCurrentIndex(UBSettings::settings()->eraserWidthIndex()); |
||||
|
||||
layout()->addWidget(eraserWidthChoice); |
||||
|
||||
addAction(UBApplication::mainWindow->actionEraseDesktopAnnotations); |
||||
} |
||||
|
||||
|
||||
UBDesktopMarkerPalette::UBDesktopMarkerPalette(QWidget *parent, UBRightPalette* rightPalette) |
||||
: UBDesktopPropertyPalette(parent, rightPalette) |
||||
{ |
||||
// 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(colorIndexChanged(int)), this, SLOT(close())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), this, SLOT(close())); |
||||
|
||||
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(lineWidthChoice, SIGNAL(activated(int)), this, SLOT(close())); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), lineWidthChoice, SLOT(setCurrentIndex(int))); |
||||
connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int)), this, SLOT(close())); |
||||
|
||||
layout()->addWidget(lineWidthChoice); |
||||
} |
||||
|
Loading…
Reference in new issue