Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 767bb990 authored by Gener ne's avatar Gener ne Committed by Boudewijn Rempt

Disable "Contour" and "Texture" by default and re-enables them when "Bevel and Emboss" is applied.

BUG:396015
parent 853dac03
......@@ -101,6 +101,8 @@ KisDlgLayerStyle::KisDlgLayerStyle(KisPSDLayerStyleSP layerStyle, KisCanvasResou
wdgLayerStyles.stylesStack->addWidget(m_innerGlow);
connect(m_innerGlow, SIGNAL(configChanged()), SLOT(notifyGuiConfigChanged()));
// Contour and Texture are sub-styles of Bevel and Emboss
// They are only applied to canvas when Bevel and Emboss is active.
m_contour = new Contour(this);
m_texture = new Texture(this);
m_bevelAndEmboss = new BevelAndEmboss(m_contour, m_texture, this);
......@@ -109,6 +111,8 @@ KisDlgLayerStyle::KisDlgLayerStyle(KisPSDLayerStyleSP layerStyle, KisCanvasResou
wdgLayerStyles.stylesStack->addWidget(m_contour);
wdgLayerStyles.stylesStack->addWidget(m_texture);
// slotBevelAndEmbossChanged(QListWidgetItem*) enables/disables Contour and Texture on "Bevel and Emboss" toggle.
connect(wdgLayerStyles.lstStyleSelector, SIGNAL(itemClicked(QListWidgetItem*)), SLOT(slotBevelAndEmbossChanged(QListWidgetItem*)));
connect(m_bevelAndEmboss, SIGNAL(configChanged()), SLOT(notifyGuiConfigChanged()));
m_satin = new Satin(this);
......@@ -196,6 +200,32 @@ void KisDlgLayerStyle::notifyPredefinedStyleSelected(KisPSDLayerStyleSP style)
m_configChangedCompressor->start();
}
void KisDlgLayerStyle::slotBevelAndEmbossChanged(QListWidgetItem*) {
QListWidgetItem *item;
if (wdgLayerStyles.lstStyleSelector->item(6)->checkState() == Qt::Checked) {
// Enable "Contour" (list item 7)
item = wdgLayerStyles.lstStyleSelector->item(7);
Qt::ItemFlags currentFlags7 = item->flags();
item->setFlags(currentFlags7 | Qt::ItemIsEnabled);
// Enable "Texture" (list item 8)
item = wdgLayerStyles.lstStyleSelector->item(8);
Qt::ItemFlags currentFlags8 = item->flags();
item->setFlags(currentFlags8 | Qt::ItemIsEnabled);
}
else {
// Disable "Contour"
item = wdgLayerStyles.lstStyleSelector->item(7);
Qt::ItemFlags currentFlags7 = item->flags();
item->setFlags(currentFlags7 & (~Qt::ItemIsEnabled));
// Disable "Texture"
item = wdgLayerStyles.lstStyleSelector->item(8);
Qt::ItemFlags currentFlags8 = item->flags();
item->setFlags(currentFlags8 & (~Qt::ItemIsEnabled));
}
}
void KisDlgLayerStyle::slotNotifyOnAccept()
{
......
......@@ -252,6 +252,8 @@ public Q_SLOTS:
void notifyGuiConfigChanged();
void notifyPredefinedStyleSelected(KisPSDLayerStyleSP style);
void slotBevelAndEmbossChanged(QListWidgetItem*);
void changePage(QListWidgetItem *, QListWidgetItem*);
void slotNotifyOnAccept();
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>473</width>
<height>335</height>
<width>1607</width>
<height>924</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
......@@ -82,6 +82,9 @@
<property name="checkState">
<enum>Unchecked</enum>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable</set>
</property>
</item>
<item>
<property name="text">
......@@ -90,6 +93,9 @@
<property name="checkState">
<enum>Unchecked</enum>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsDragEnabled|ItemIsUserCheckable</set>
</property>
</item>
<item>
<property name="text">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment