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 0075250c authored by Pedro Reis's avatar Pedro Reis

Color Selector can use theme color for background

parent 2c9e61bf
......@@ -252,8 +252,6 @@ void ColorSelectorItem::setView(QObject* newView)
{
d->view = qobject_cast<KisViewManager*>( newView );
if (d->view) {
connect(d->view->mainWindow(), SIGNAL(themeChanged()), this, SLOT(repaint()));
connect(d->view->canvasResourceProvider(), SIGNAL(sigFGColorChanged(KoColor)),
this, SLOT(fgColorChanged(KoColor)));
connect(d->view->canvasResourceProvider(), SIGNAL(sigBGColorChanged(KoColor)),
......
......@@ -230,14 +230,13 @@ void KisColorSelector::paintEvent(QPaintEvent* e)
Q_UNUSED(e);
QPainter p(this);
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
if (cfg.readEntry("useBackgroundColorForSelector", true)) {
//p.fillRect(0,0,width(), height(), cfg.readEntry("colorEditorBackground", qApp->palette().window().color()));
p.fillRect(0,0,width(), height(), QColor(128,128,128));
p.fillRect(0,0,width(), height(), cfg.readEntry("colorEditorBackground", qApp->palette().window().color()));
} else {
p.fillRect(0,0,width(), height(), QColor(128,128,128));
}
p.setRenderHint(QPainter::Antialiasing);
// this variable name isn't entirely accurate to what always happens. see definition in header file to understand it better
......@@ -324,13 +323,6 @@ void KisColorSelector::resizeEvent(QResizeEvent* e) {
KisColorSelectorBase::resizeEvent(e);
}
/*
void KisColorSelector::setViewManager(KisViewManager *kisview)
{
connect(kisview->mainWindow(), SIGNAL(themeChanged()), this, SLOT(slotUpdateIcons()));
slotUpdateIcons();
} */
void KisColorSelector::mousePressEvent(QMouseEvent* e)
{
e->setAccepted(false);
......
......@@ -29,7 +29,6 @@ class KisColorSelectorComponent;
class KisColorSelectorSimple;
class KisColorSelectorWheel;
class QPushButton;
//class KisViewManager;
class KisSignalCompressor;
class KisColorSelector : public KisColorSelectorBase
......
......@@ -74,20 +74,11 @@ KisColorSelectorContainer::KisColorSelectorContainer(QWidget *parent) :
connect(m_colorSelector,SIGNAL(settingsButtonClicked()), SIGNAL(openSettings()));
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(themeChanged()), m_colorSelector, SLOT(updateSettings()));
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(signalThemeChanged()), m_colorSelector, SLOT(updateSettings()));
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(themeChanged()), m_myPaintShadeSelector, SLOT(updateSettings()));
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(signalThemeChanged()), m_myPaintShadeSelector, SLOT(updateSettings()));
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(themeChanged()), this, SLOT(updateSettings()));
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(signalThemeChanged()), this, SLOT(updateSettings()));
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(themeChanged()), m_minimalShadeSelector, SLOT(updateSettings()));
connect(m_canvas->viewManager()->mainWindow(), SIGNAL(signalThemeChanged()), m_minimalShadeSelector, SLOT(updateSettings()));
connect(this, SIGNAL(settingsChanged()), m_colorSelector, SLOT(updateSettings()));
connect(this, SIGNAL(settingsChanged()), m_myPaintShadeSelector, SLOT(updateSettings()));
connect(this, SIGNAL(settingsChanged()), this, SLOT(updateSettings()));
connect(this, SIGNAL(settingsChanged()), m_minimalShadeSelector, SLOT(updateSettings()));
m_colorSelAction = KisActionRegistry::instance()->makeQAction("show_color_selector", this);
connect(m_colorSelAction, SIGNAL(triggered()), m_colorSelector, SLOT(showPopup()), Qt::UniqueConnection);
......@@ -125,6 +116,9 @@ bool KisColorSelectorContainer::doesAtleastOneDocumentExist()
void KisColorSelectorContainer::slotUpdateIcons()
{
m_colorSelector->updateIcons();
m_colorSelector->updateSettings();
m_minimalShadeSelector->updateSettings();
m_myPaintShadeSelector->updateSettings();
}
void KisColorSelectorContainer::setCanvas(KisCanvas2* canvas)
......@@ -173,7 +167,6 @@ void KisColorSelectorContainer::setCanvas(KisCanvas2* canvas)
void KisColorSelectorContainer::updateSettings()
{
fprintf( stderr, "MERDA");
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
m_onDockerResizeSetting = (int)cfg.readEntry("onDockerResize", 0);
m_showColorSelector = (bool) cfg.readEntry("showColorSelector", true);
......
......@@ -174,10 +174,9 @@ void KisMinimalShadeSelector::paintEvent(QPaintEvent *)
{
QPainter p(this);
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
if (cfg.readEntry("useBackgroundColorForSelector", true)) {
//p.fillRect(0,0,width(), height(), cfg.readEntry("colorEditorBackground", qApp->palette().window().color()));
p.fillRect(0,0,width(), height(), QColor(128,128,128));
p.fillRect(0,0,width(), height(), cfg.readEntry("colorEditorBackground", qApp->palette().window().color()));
} else {
p.fillRect(0,0,width(), height(), QColor(128,128,128));
}
......
......@@ -125,8 +125,7 @@ void KisShadeSelectorLineComboBoxPopup::paintEvent(QPaintEvent *)
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
if (cfg.readEntry("useBackgroundColorForSelector", true)) {
//p.fillRect(0,0,width(), height(), cfg.readEntry("colorEditorBackground", qApp->palette().window().color()));
p.fillRect(0,0,width(), height(), QColor(128,128,128));
p.fillRect(0,0,width(), height(), cfg.readEntry("colorEditorBackground", qApp->palette().window().color()));
} else {
p.fillRect(0,0,width(), height(), QColor(128,128,128));
}
......
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