Commit cb207e27 authored by Halla Rempt's avatar Halla Rempt
Browse files

BUG:337328 Make it possible to show only the shade selector

REVIEW:122638
CCMAIL:ranveeraggarwal@gmail.com

Patch by Ranveer Aggarwal. Thanks!
parent eacd6322
......@@ -46,6 +46,7 @@ KisColorSelectorContainer::KisColorSelectorContainer(QWidget *parent) :
m_minimalShadeSelector(new KisMinimalShadeSelector(this)),
m_shadeSelector(m_myPaintShadeSelector),
m_shadeSelectorHideable(false),
m_hideColorSelector(false),
m_allowHorizontalLayout(true),
m_colorSelAction(0),
m_mypaintAction(0),
......@@ -128,6 +129,7 @@ void KisColorSelectorContainer::updateSettings()
KConfigGroup cfg = KGlobal::config()->group("advancedColorSelector");
m_shadeSelectorHideable = cfg.readEntry("shadeSelectorHideable", false);
m_allowHorizontalLayout = cfg.readEntry("allowHorizontalLayout", true);
m_hideColorSelector = cfg.readEntry("hideColorSelector", true);
QString type = cfg.readEntry("shadeSelectorType", "MyPaint");
......@@ -139,6 +141,10 @@ void KisColorSelectorContainer::updateSettings()
else
newShadeSelector = 0;
if (m_hideColorSelector)
m_colorSelector->hide();
else
m_colorSelector->show();
if(m_shadeSelector!=newShadeSelector && m_shadeSelector!=0) {
......
......@@ -56,6 +56,7 @@ private:
QWidget* m_shadeSelector;
bool m_shadeSelectorHideable;
bool m_hideColorSelector;
bool m_allowHorizontalLayout;
QBoxLayout* m_widgetLayout;
......
......@@ -187,6 +187,8 @@ void KisColorSelectorSettings::savePreferences() const
cfg.writeEntry("minimalShadeSelectorLineHeight", ui->minimalShadeSelectorLineHeight->value());
//color selector
cfg.writeEntry("hideColorSelector", ui->hideColorSelector->isChecked());
KisColorSelectorComboBox* cstw = dynamic_cast<KisColorSelectorComboBox*>(ui->colorSelectorConfiguration);
cfg.writeEntry("colorSelectorConfiguration", cstw->configuration().toString());
......@@ -327,6 +329,8 @@ void KisColorSelectorSettings::loadPreferences()
ui->minimalShadeSelectorLineSettings->fromString(cfg.readEntry("minimalShadeSelectorLineConfig", "0|0.2|0|0|0|0|0;1|0|1|1|0|0|0;2|0|-1|1|0|0|0;"));
ui->minimalShadeSelectorLineHeight->setValue(cfg.readEntry("minimalShadeSelectorLineHeight", 10));
ui->hideColorSelector->setChecked(cfg.readEntry("hideColorSelector", true));
QString hsxSettingType=cfg.readEntry("hsxSettingType", "HSV");
ui->colorSelectorHSVtype->setChecked(hsxSettingType=="HSV");
ui->colorSelectorHSLtype->setChecked(hsxSettingType=="HSL");
......@@ -427,6 +431,8 @@ void KisColorSelectorSettings::loadDefaultPreferences()
ui->colorSelectorHSVtype->setChecked(false);
ui->colorSelectorHSVtype->setChecked(false);
ui->colorSelectorHSVtype->setChecked(false);
ui->hideColorSelector->setChecked(false);
KisColorSelectorComboBox* cstw = dynamic_cast<KisColorSelectorComboBox*>(ui->colorSelectorConfiguration);
cstw->setConfiguration(KisColorSelector::Configuration("3|0|5|0")); // triangle selector
......
......@@ -459,6 +459,13 @@
</property>
</widget>
</item>
<item row="0" column="6" colspan="2">
<widget class="QCheckBox" name="hideColorSelector">
<property name="text">
<string>Hide color selector</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
......
Supports Markdown
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