17#include "popupcolorpalettewidget.h"
20#include <QGraphicsDropShadowEffect>
25#include "scribblearea.h"
28PopupColorPaletteWidget::PopupColorPaletteWidget(
ScribbleArea *parent ) :
39 mColorBox->adjustSize();
45 setGraphicsEffect(effect);
47 setAutoFillBackground(
true);
48 setWindowTitle(tr(
"Color palette"));
49 setWindowFlags( ( (windowFlags()
58 closeButton->setText(tr(
"close/toggle"));
63 connect( mColorBox, &ColorBox::colorChanged,
this, &PopupColorPaletteWidget::onColorChanged );
66void PopupColorPaletteWidget::popup()
75 mColorBox->setColor( mContainer->editor()->color()->
frontColor() );
79 int radius =
width() / 2;
81 cPos.
setX(cPos.
x()-radius);
82 cPos.
setY(cPos.
y()-radius);
89void PopupColorPaletteWidget::keyPressEvent(
QKeyEvent *event)
94 qDebug() <<
"sent key_enter";
104 qDebug() <<
"sent event.ignore()";
111void PopupColorPaletteWidget::onColorChanged(
const QColor& color)
113 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)