60 : QWidget(parent, Qt::FramelessWindowHint),
63 m_d->provider = provider;
65 QVBoxLayout *layout =
new QVBoxLayout(
this);
67 QHBoxLayout *labelLayout =
new QHBoxLayout();
68 m_d->lblPresetIcon =
new QLabel(
this);
72 m_d->lblPresetIcon->setScaledContents(
true);
76 m_d->btnReloadPreset =
new QToolButton(
this);
77 m_d->btnReloadPreset->setAutoRaise(
true);
78 m_d->btnReloadPreset->setToolTip(i18n(
"Reload Original Preset"));
80 m_d->btnConfigure =
new QToolButton(
this);
81 m_d->btnConfigure->setAutoRaise(
true);
82 m_d->btnConfigure->setToolTip(i18n(
"Configure the on-canvas brush editor"));
87 labelLayout->addWidget(
m_d->lblPresetIcon);
88 labelLayout->addWidget(
m_d->lblPresetName);
89 labelLayout->addWidget(
m_d->btnReloadPreset);
90 labelLayout->addWidget(
m_d->btnConfigure);
92 layout->addLayout(labelLayout);
94 m_d->wdgPropertiesArea =
new QScrollArea(
this);
95 m_d->wdgPropertiesArea->setAlignment(Qt::AlignLeft | Qt::AlignTop);
96 m_d->wdgPropertiesArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
98 m_d->wdgPropertiesArea->setWidgetResizable(
true);
100 m_d->wdgProperties =
new QWidget(
this);
101 m_d->propertiesLayout =
new QVBoxLayout(
m_d->wdgProperties);
102 m_d->propertiesLayout->setSpacing(0);
103 m_d->propertiesLayout->setContentsMargins(0, 0, 22, 0);
104 m_d->propertiesLayout->setSizeConstraint(QLayout::SetMinimumSize);
108 m_d->wdgPropertiesArea->setWidget(
m_d->wdgProperties);
109 layout->addWidget(
m_d->wdgPropertiesArea);
114 m_d->wdgProperties->installEventFilter(
this);
118 setCursor(Qt::ArrowCursor);
121 setAttribute(Qt::WA_NoMousePropagation,
true);
132 this->setPalette(qApp->palette());
133 for(
int i=0; i<this->children().size(); i++) {
134 QWidget *w = qobject_cast<QWidget*>(this->children().at(i));
136 w->setPalette(qApp->palette());
139 for(
int i=0; i<
m_d->wdgProperties->children().size(); i++) {
142 w->slotThemeChanged(qApp->palette());
176 if (preset ==
m_d->currentPreset)
return;
178 m_d->presetConnections.clear();
181 m_d->currentPreset = preset;
182 m_d->presetConnections.addConnection(
183 m_d->currentPreset->updateProxy(), SIGNAL(sigUniformPropertiesChanged()),
186 m_d->lblPresetIcon->setPixmap(QPixmap::fromImage(preset->image()));
187 m_d->lblPresetName->setLongText(preset->name());
199 &discardedProperties);
202 Q_FOREACH(
auto property, properties) {
205 if (!property->isVisible())
continue;
218 w->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
219 m_d->propertiesLayout->addWidget(w);
223 m_d->propertiesLayout->addStretch();
291 if (watched ==
m_d->wdgProperties &&
event->type() == QEvent::LayoutRequest)
293 int totalMargin = 2 *
m_d->wdgPropertiesArea->frameWidth();
294 m_d->wdgPropertiesArea->setMinimumWidth(
m_d->wdgProperties->sizeHint().width() + totalMargin);