Commit b6e4af65 authored by Scott Petrovic's avatar Scott Petrovic

fix themed icons on the kis widget chooser

parent a725ae17
......@@ -197,6 +197,7 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
for (int i = 0; i < 3; ++i) {
m_sliderChooser[i] = new KisWidgetChooser(i + 1);
KisDoubleSliderSpinBox* slOpacity;
KisDoubleSliderSpinBox* slFlow;
KisDoubleSliderSpinBox* slSize;
......@@ -289,16 +290,19 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
view->actionCollection()->addAction("brushslider1", action);
action->setDefaultWidget(m_sliderChooser[0]);
connect(action, SIGNAL(triggered()), m_sliderChooser[0], SLOT(showPopupWidget()));
connect(m_viewManager->mainWindow(), SIGNAL(themeChanged()), m_sliderChooser[0], SLOT(updateThemedIcons()));
action = new KAction(i18n("Brush option slider 2"), this);
view->actionCollection()->addAction("brushslider2", action);
action->setDefaultWidget(m_sliderChooser[1]);
connect(action, SIGNAL(triggered()), m_sliderChooser[1], SLOT(showPopupWidget()));
connect(m_viewManager->mainWindow(), SIGNAL(themeChanged()), m_sliderChooser[1], SLOT(updateThemedIcons()));
action = new KAction(i18n("Brush option slider 3"), this);
view->actionCollection()->addAction("brushslider3", action);
action->setDefaultWidget(m_sliderChooser[2]);
connect(action, SIGNAL(triggered()), m_sliderChooser[2], SLOT(showPopupWidget()));
connect(m_viewManager->mainWindow(), SIGNAL(themeChanged()), m_sliderChooser[2], SLOT(updateThemedIcons()));
action = new KAction(i18n("Next Favourite Preset"), this);
view->actionCollection()->addAction("next_favorite_preset", action);
......
......@@ -31,6 +31,8 @@
#include <QStylePainter>
#include <QStyleOption>
#include <kis_icon_utils.h>
#include "kis_config.h"
KisWidgetChooser::KisWidgetChooser(int id, QWidget* parent)
......@@ -39,7 +41,7 @@ KisWidgetChooser::KisWidgetChooser(int id, QWidget* parent)
{
// QFrame::setFrameStyle(QFrame::StyledPanel|QFrame::Raised);
m_acceptIcon = themedIcon("list-add");
m_acceptIcon = KisIconUtils::loadIcon("list-add");
m_buttons = new QButtonGroup();
m_popup = new QFrame(0, Qt::Popup);
m_arrowButton = new QToolButton();
......@@ -138,6 +140,8 @@ QLayout* KisWidgetChooser::createPopupLayout()
if(!i->choosen) {
if(row == buttons.size()) {
QToolButton* bn = new QToolButton();
m_acceptIcon = KisIconUtils::loadIcon("list-add");
bn->setIcon(m_acceptIcon);
bn->setAutoRaise(true);
buttons.push_back(bn);
......@@ -245,6 +249,16 @@ void KisWidgetChooser::showPopupWidget()
m_popup->show();
}
void KisWidgetChooser::updateThemedIcons()
{
for (int i = 0; i < m_buttons->buttons().length(); i++) {
if ( m_buttons->button(i)) {
m_buttons->button(i)->setIcon(KisIconUtils::loadIcon("list-add"));
}
}
}
void KisWidgetChooser::slotButtonPressed()
{
showPopupWidget();
......
......@@ -76,6 +76,7 @@ public:
public Q_SLOTS:
void showPopupWidget();
void updateThemedIcons();
private:
void removeWidget(const QString& id);
......
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