Differential D20680 Diff 56579 plugins/dockers/advancedcolorselector/kis_shade_selector_line_editor.cpp
Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/advancedcolorselector/kis_shade_selector_line_editor.cpp
Context not available. | |||||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
---|---|---|---|---|---|
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "kis_shade_selector_line_editor.h" | 20 | #include <QMouseEvent> | ||
21 | 21 | | |||
22 | #include "kis_shade_selector_line_editor.h" | ||||
22 | #include "kis_double_parse_spin_box.h" | 23 | #include "kis_double_parse_spin_box.h" | ||
24 | #include "kis_config.h" | ||||
23 | 25 | | |||
24 | KisShadeSelectorLineEditor::KisShadeSelectorLineEditor(QWidget* parent) | 26 | KisShadeSelectorLineEditor::KisShadeSelectorLineEditor(QWidget* parent, KisShadeSelectorLine* preview) | ||
25 | : KisShadeSelectorLineBase(parent) | 27 | : KisShadeSelectorLineBase(parent) | ||
28 | , m_line_preview(preview) | ||||
26 | { | 29 | { | ||
27 | QVBoxLayout* layout = new QVBoxLayout(this); | 30 | QVBoxLayout* layout = new QVBoxLayout(this); | ||
28 | 31 | | |||
Context not available. | |||||
70 | connect(m_saturationShift, SIGNAL(valueChanged(double)), SLOT(valueChanged())); | 73 | connect(m_saturationShift, SIGNAL(valueChanged(double)), SLOT(valueChanged())); | ||
71 | connect(m_valueShift, SIGNAL(valueChanged(double)), SLOT(valueChanged())); | 74 | connect(m_valueShift, SIGNAL(valueChanged(double)), SLOT(valueChanged())); | ||
72 | 75 | | |||
76 | KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector"); | ||||
77 | QString lineset = cfg.readEntry( | ||||
78 | "minimalShadeSelectorLineConfig", "0|0.2|0|0|0|0|0;1|0|1|1|0|0|0;2|0|-1|1|0|0|0;").split(";").at(0); | ||||
79 | fromString(lineset); | ||||
80 | | ||||
81 | updatePreview(); | ||||
82 | } | ||||
83 | | ||||
84 | void KisShadeSelectorLineEditor::updatePreview(){ | ||||
85 | m_line_preview->setParam( | ||||
86 | m_hueDelta->value(), m_saturationDelta->value(), m_valueDelta->value(), | ||||
87 | m_hueShift->value(), m_saturationShift->value(), m_valueShift->value() | ||||
88 | ); | ||||
89 | this->parentWidget()->update(m_line_preview->geometry()); | ||||
73 | } | 90 | } | ||
74 | 91 | | |||
75 | QString KisShadeSelectorLineEditor::toString() const | 92 | QString KisShadeSelectorLineEditor::toString() const | ||
Context not available. | |||||
98 | } | 115 | } | ||
99 | 116 | | |||
100 | void KisShadeSelectorLineEditor::valueChanged() { | 117 | void KisShadeSelectorLineEditor::valueChanged() { | ||
118 | updatePreview(); | ||||
101 | emit requestActivateLine(this); | 119 | emit requestActivateLine(this); | ||
102 | } | 120 | } | ||
121 | | ||||
122 | void KisShadeSelectorLineEditor::mousePressEvent(QMouseEvent* e) { | ||||
123 | e->accept(); | ||||
124 | } | ||||
125 | | ||||
Context not available. |