17 #include "popupcolorpalettewidget.h"
20 #include <QGraphicsDropShadowEffect>
21 #include <QPushButton>
25 #include "scribblearea.h"
28 PopupColorPaletteWidget::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 );
66 void 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);
89 void PopupColorPaletteWidget::keyPressEvent(
QKeyEvent *event)
94 qDebug() <<
"sent key_enter";
104 qDebug() <<
"sent event.ignore()";
111 void PopupColorPaletteWidget::onColorChanged(
const QColor& color)
113 mContainer->editor()->color()->setColor( color );
void setXOffset(qreal dx)
QString tr(const char *sourceText, const char *disambiguation, int n)
bool sendEvent(QObject *receiver, QEvent *event)
void setYOffset(qreal dy)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setBlurRadius(qreal blurRadius)
void addLayout(QLayout *layout, int stretch)