Changeset View
Changeset View
Standalone View
Standalone View
libs/widgets/kis_palette_view.cpp
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Line(s) | |||||
205 | void KisPaletteView::slotFGColorChanged(const KoColor &color) | 205 | void KisPaletteView::slotFGColorChanged(const KoColor &color) | ||
206 | { | 206 | { | ||
207 | KConfigGroup group(KSharedConfig::openConfig(), ""); | 207 | KConfigGroup group(KSharedConfig::openConfig(), ""); | ||
208 | if (group.readEntry("colorsettings/forcepalettecolors", false)) { | 208 | if (group.readEntry("colorsettings/forcepalettecolors", false)) { | ||
209 | selectClosestColor(color); | 209 | selectClosestColor(color); | ||
210 | } | 210 | } | ||
211 | } | 211 | } | ||
212 | 212 | | |||
213 | void KisPaletteView::slotFGColorResourceChanged(const KoColor& color) | ||||
214 | { | ||||
215 | // This slot is called, because fg color was changed in the resource manager. | ||||
216 | // To enable re-picking the swatch color again, we reset currentIndex | ||||
217 | // of the selectionModel. We are not clearing the selection itself, | ||||
218 | // so the user can see the swatch selected previously. | ||||
219 | // See bug 402072 | ||||
220 | selectionModel()->clearCurrentIndex(); | ||||
221 | slotFGColorChanged(color); | ||||
222 | } | ||||
223 | | ||||
224 | void KisPaletteView::slotSelectColor(const KoColor &color) | ||||
225 | { | ||||
226 | selectClosestColor(color); | ||||
227 | } | ||||
228 | | ||||
213 | void KisPaletteView::setPaletteModel(KisPaletteModel *model) | 229 | void KisPaletteView::setPaletteModel(KisPaletteModel *model) | ||
214 | { | 230 | { | ||
215 | if (m_d->model) { | 231 | if (m_d->model) { | ||
216 | disconnect(m_d->model, Q_NULLPTR, this, Q_NULLPTR); | 232 | disconnect(m_d->model, Q_NULLPTR, this, Q_NULLPTR); | ||
217 | } | 233 | } | ||
218 | m_d->model = model; | 234 | m_d->model = model; | ||
219 | setModel(model); | 235 | setModel(model); | ||
220 | slotAdditionalGuiUpdate(); | 236 | slotAdditionalGuiUpdate(); | ||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |