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

Beginning refactor

parent 7d6587c6
......@@ -232,10 +232,11 @@ void KisColorSelector::paintEvent(QPaintEvent* e)
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
// If checked, use theme colors for background of selector
if (cfg.readEntry("useBackgroundColorForSelector", true)) {
p.fillRect(0,0,width(), height(), qApp->palette().window().color());
if (cfg.readEntry("useCustomColorForBackground", false)) {
QColor customColor = cfg.readEntry("customSelectorBackgroundColor", QColor(Qt::gray));
p.fillRect(0,0,width(), height(), customColor);
} else {
p.fillRect(0,0,width(), height(), QColor(128,128,128));
p.fillRect(0,0,width(), height(), qApp->palette().window().color());
}
p.setRenderHint(QPainter::Antialiasing);
......
......@@ -217,7 +217,7 @@ void KisColorSelectorSettings::savePreferences() const
cfg.writeEntry("shadeSelectorUpdateOnLeftClick", ui->shadeSelectorUpdateOnLeftClick->isChecked());
cfg.writeEntry("shadeSelectorUpdateOnBackground", ui->shadeSelectorUpdateOnBackground->isChecked());
cfg.writeEntry("hidePopupOnClickCheck", ui->hidePopupOnClickCheck->isChecked());
cfg.writeEntry("useBackgroundColorForSelector", ui->useBackgroundColorForSelector->isChecked());
cfg.writeEntry("useCustomColorForBackground", ui->useCustomColorForBackground->isChecked());
//mypaint model
......@@ -456,7 +456,7 @@ void KisColorSelectorSettings::loadPreferences()
ui->shadeSelectorUpdateOnForeground->setChecked(cfg.readEntry("shadeSelectorUpdateOnForeground", true));
ui->shadeSelectorUpdateOnBackground->setChecked(cfg.readEntry("shadeSelectorUpdateOnBackground", true));
ui->hidePopupOnClickCheck->setChecked(cfg.readEntry("hidePopupOnClickCheck", false));
ui->useBackgroundColorForSelector->setChecked(cfg.readEntry("useBackgroundColorForSelector", true));
ui->useCustomColorForBackground->setChecked(cfg.readEntry("useCustomColorForBackground", false));
QString shadeMyPaintType = cfg.readEntry("shadeMyPaintType", "HSV");
......
......@@ -175,7 +175,7 @@ void KisMinimalShadeSelector::paintEvent(QPaintEvent *)
QPainter p(this);
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
if (cfg.readEntry("useBackgroundColorForSelector", true)) {
if (cfg.readEntry("useCustomColorForBackground", false)) {
p.fillRect(0,0,width(), height(), qApp->palette().window().color());
} else {
p.fillRect(0,0,width(), height(), QColor(128,128,128));
......
......@@ -124,7 +124,7 @@ void KisShadeSelectorLineComboBoxPopup::paintEvent(QPaintEvent *)
QPainter p(this);
KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
if (cfg.readEntry("useBackgroundColorForSelector", true)) {
if (cfg.readEntry("useCustomColorForBackground", false)) {
p.fillRect(0,0,width(), height(), qApp->palette().window().color());
} else {
p.fillRect(0,0,width(), height(), QColor(128,128,128));
......
......@@ -356,12 +356,19 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="useBackgroundColorForSelector">
<widget class="QCheckBox" name="useCustomColorForBackground">
<property name="text">
<string>Use background color for selector.</string>
<string>Use custom color for selector background.</string>
</property>
</widget>
</item>
<item>
<widget class="KisColorButton" name="customColorBackgroundSelector">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="useDifferentColorSpaceCheckbox">
<property name="minimumSize">
......@@ -1530,6 +1537,11 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KisColorButton</class>
<extends>QPushButton</extends>
<header>kis_color_button.h</header>
</customwidget>
<customwidget>
<class>KisDoubleParseSpinBox</class>
<extends>QDoubleSpinBox</extends>
......
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