17#include "popupcolorpalettewidget.h"
20#include <QGraphicsDropShadowEffect>
26#include "scribblearea.h"
29PopupColorPaletteWidget::PopupColorPaletteWidget(
ScribbleArea *parent ) :
40 mColorBox->adjustSize();
46 setGraphicsEffect(effect);
48 setAutoFillBackground(
true);
49 setWindowTitle(tr(
"Color palette"));
50 setWindowFlags( ( (windowFlags()
59 closeButton->setText(tr(
"close/toggle"));
64 connect( mColorBox, &ColorBox::colorChanged,
this, &PopupColorPaletteWidget::onColorChanged );
67void PopupColorPaletteWidget::popup()
76 mColorBox->setColor( mContainer->editor()->color()->
frontColor() );
80 int radius =
width() / 2;
82 cPos.
setX(cPos.
x()-radius);
83 cPos.
setY(cPos.
y()-radius);
90void PopupColorPaletteWidget::keyPressEvent(
QKeyEvent *event)
95 qDebug() <<
"sent key_enter";
105 qDebug() <<
"sent event.ignore()";
112void PopupColorPaletteWidget::onColorChanged(
const QColor& color)
114 mContainer->editor()->color()->setColor( color );
QColor frontColor(bool useIndexedColor=true)
frontColor
void addLayout(QLayout *layout, int stretch)
bool sendEvent(QObject *receiver, QEvent *event)
void setBlurRadius(qreal blurRadius)
void setXOffset(qreal dx)
void setYOffset(qreal dy)