ColorButton(QGraphicsWidget *parent);
protected:
+ void resizeEvent(QGraphicsSceneResizeEvent *event) final;
void dragEnterEvent(QGraphicsSceneDragDropEvent *event) final;
void dragMoveEvent(QGraphicsSceneDragDropEvent *event) final;
void dropEvent(QGraphicsSceneDragDropEvent *event) final;
picker->addColor(color);
}
+void ColorButton::resizeEvent(QGraphicsSceneResizeEvent *event)
+{
+ const QSizeF sizef = size();
+ const int minsize = qRound(qMin(sizef.width(), sizef.height())) - 4;
+ nativeWidget()->setIconSize(QSize(minsize, minsize));
+ Plasma::ToolButton::resizeEvent(event);
+}
+
+
Kolourpicker::Kolourpicker(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args),
m_grabWidget(0)