Commit 7ef2ef54 authored by Scott Petrovic's avatar Scott Petrovic

Update icon when theme changed for advanced color selector configure button

parent 3a10987f
......@@ -151,6 +151,12 @@ void KisColorSelector::updateSettings()
setConfiguration(KisColorSelectorConfiguration::fromString(cfg.readEntry("colorSelectorConfiguration", KisColorSelectorConfiguration().toString())));
}
void KisColorSelector::updateIcons() {
if (m_button) {
m_button->setIcon(KisIconUtils::loadIcon("configure"));
}
}
void KisColorSelector::reset()
{
KisColorSelectorBase::reset();
......@@ -338,6 +344,7 @@ void KisColorSelector::init()
if(displaySettingsButton()) {
m_button = new QPushButton(this);
m_button->setIcon(KisIconUtils::loadIcon("configure"));
m_button->setFlat(true);
connect(m_button, SIGNAL(clicked()), SIGNAL(settingsButtonClicked()));
}
......
......@@ -42,10 +42,14 @@ public:
KisColorSelectorConfiguration configuration() const;
void setColor(const KoColor &color) override;
/// update icons when a theme update happens
void updateIcons();
public Q_SLOTS:
void reset() override;
void updateSettings() override;
Q_SIGNALS:
void settingsButtonClicked();
......
......@@ -87,6 +87,11 @@ void KisColorSelectorContainer::unsetCanvas()
m_canvas = 0;
}
void KisColorSelectorContainer::slotUpdateIcons()
{
m_colorSelector->updateIcons();
}
void KisColorSelectorContainer::setCanvas(KisCanvas2* canvas)
{
if (m_canvas) {
......
......@@ -38,6 +38,9 @@ public:
enum ShadeSelectorType{MyPaintSelector, MinimalSelector, NoSelector};
public Q_SLOTS:
void slotUpdateIcons();
Q_SIGNALS:
void openSettings();
void settingsChanged();
......
......@@ -107,6 +107,8 @@ void KisColorSelectorNgDockerWidget::unsetCanvas()
m_commonColorsWidget->unsetCanvas();
m_colorHistoryWidget->unsetCanvas();
m_colorSelectorContainer->unsetCanvas();
disconnect(m_canvas->viewManager()->mainWindow(), SIGNAL(themeChanged()), m_colorSelectorContainer, SLOT(slotUpdateIcons()));
}
void KisColorSelectorNgDockerWidget::setCanvas(KisCanvas2 *canvas)
......@@ -132,6 +134,8 @@ void KisColorSelectorNgDockerWidget::setCanvas(KisCanvas2 *canvas)
actionCollection->addAction("show_color_history", m_colorHistoryAction);
actionCollection->addAction("show_common_colors", m_commonColorsAction);
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(themeChanged()), m_colorSelectorContainer, SLOT(slotUpdateIcons()));
}
reactOnLayerChange();
......
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