344{
345
346
347
348 KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
349 KConfigGroup hsxcfg = KSharedConfig::openConfig()->group("hsxColorSlider");
350 KConfigGroup hotkeycfg = KSharedConfig::openConfig()->group("colorhotkeys");
351
352
353
354 ui->dockerResizeOptionsComboBox->setCurrentIndex( (
int)cfg.readEntry(
"onDockerResize", 0) );
355 ui->zoomSelectorOptionComboBox->setCurrentIndex( (
int) cfg.readEntry(
"zoomSelectorOptions", 0) );
356 ui->popupSize->setValue(cfg.readEntry(
"zoomSize", 280));
357 ui->chkShowColorSelector->setChecked((
bool) cfg.readEntry(
"showColorSelector",
true));
358
359 {
361 const KoColorSpace *cs = kisconfig.customColorSelectorColorSpace();
362
363 if (cs) {
364 ui->useDifferentColorSpaceCheckbox->setChecked(
true);
365 ui->colorSpace->setEnabled(
true);
366 ui->colorSpace->setCurrentColorSpace(cs);
367 } else {
368 ui->useDifferentColorSpaceCheckbox->setChecked(
false);
369 ui->colorSpace->setEnabled(
false);
370 }
371 }
372
373
374
375 ui->lastUsedColorsPerDocument->setChecked(cfg.readEntry(
"lastUsedColorsPerDocument",
false));
376 ui->lastUsedColorsShow->setChecked(cfg.readEntry(
"lastUsedColorsShow",
true));
377 bool a = cfg.readEntry("lastUsedColorsAlignment", true);
378 ui->lastUsedColorsAlignVertical->setChecked(a);
379 ui->lastUsedColorsAlignHorizontal->setChecked(!a);
380 ui->lastUsedColorsAllowScrolling->setChecked(cfg.readEntry(
"lastUsedColorsScrolling",
true));
381 ui->lastUsedColorsNumCols->setValue(cfg.readEntry(
"lastUsedColorsNumCols", 1));
382 ui->lastUsedColorsNumRows->setValue(cfg.readEntry(
"lastUsedColorsNumRows", 1));
383 ui->lastUsedColorsPatchCount->setValue(cfg.readEntry(
"lastUsedColorsCount", 20));
384 ui->lastUsedColorsWidth->setValue(cfg.readEntry(
"lastUsedColorsWidth", 16));
385 ui->lastUsedColorsHeight->setValue(cfg.readEntry(
"lastUsedColorsHeight", 16));
386
387 ui->commonColorsShow->setChecked(cfg.readEntry(
"commonColorsShow",
true));
388 a = cfg.readEntry("commonColorsAlignment", false);
389 ui->commonColorsAlignVertical->setChecked(a);
390 ui->commonColorsAlignHorizontal->setChecked(!a);
391 ui->commonColorsAllowScrolling->setChecked(cfg.readEntry(
"commonColorsScrolling",
true));
392 ui->commonColorsNumCols->setValue(cfg.readEntry(
"commonColorsNumCols", 1));
393 ui->commonColorsNumRows->setValue(cfg.readEntry(
"commonColorsNumRows", 1));
394 ui->commonColorsPatchCount->setValue(cfg.readEntry(
"commonColorsCount", 12));
395 ui->commonColorsWidth->setValue(cfg.readEntry(
"commonColorsWidth", 16));
396 ui->commonColorsHeight->setValue(cfg.readEntry(
"commonColorsHeight", 16));
397 ui->commonColorsAutoUpdate->setChecked(cfg.readEntry(
"commonColorsAutoUpdate",
false));
398
399
400 QString shadeSelectorType=cfg.readEntry("shadeSelectorType", "Minimal");
401
402 if ( shadeSelectorType == "MyPaint") {
403 ui->ACSShadeSelectorTypeComboBox->setCurrentIndex(0);
404 } else if (shadeSelectorType == "Minimal") {
405 ui->ACSShadeSelectorTypeComboBox->setCurrentIndex(1);
406 } else {
407 ui->ACSShadeSelectorTypeComboBox->setCurrentIndex(2);
408 }
409
410 ui->shadeSelectorUpdateOnRightClick->setChecked(cfg.readEntry(
"shadeSelectorUpdateOnRightClick",
false));
411 ui->shadeSelectorUpdateOnLeftClick->setChecked(cfg.readEntry(
"shadeSelectorUpdateOnLeftClick",
false));
412 ui->shadeSelectorUpdateOnForeground->setChecked(cfg.readEntry(
"shadeSelectorUpdateOnForeground",
true));
413 ui->shadeSelectorUpdateOnBackground->setChecked(cfg.readEntry(
"shadeSelectorUpdateOnBackground",
true));
414 ui->hidePopupOnClickCheck->setChecked(cfg.readEntry(
"hidePopupOnClickCheck",
false));
415 ui->useCustomColorForBackground->setChecked(cfg.readEntry(
"useCustomColorForBackground",
false));
417
418
419 QColor storedColor = cfg.readEntry("customSelectorBackgroundColor", QColor(Qt::gray));
422 ui->customColorBackgroundSelector->setColor(c);
423
424 ui->customColorBackgroundSelector->setEnabled(cfg.readEntry(
"useCustomColorForBackground",
false));
425
426 QString shadeMyPaintType = cfg.readEntry("shadeMyPaintType", "HSV");
427
428 if (shadeMyPaintType == "HSV" ) {
429 ui->ACSshadeSelectorMyPaintColorModelComboBox->setCurrentIndex(0);
430 } else if (shadeMyPaintType == "HSL" ) {
431 ui->ACSshadeSelectorMyPaintColorModelComboBox->setCurrentIndex(1);
432 } else if (shadeMyPaintType == "HSI" ) {
433 ui->ACSshadeSelectorMyPaintColorModelComboBox->setCurrentIndex(2);
434 } else {
435 ui->ACSshadeSelectorMyPaintColorModelComboBox->setCurrentIndex(3);
436 }
437
438
439 bool asGradient = cfg.readEntry("minimalShadeSelectorAsGradient", true);
440 if(asGradient)
ui->minimalShadeSelectorAsGradient->setChecked(
true);
441 else ui->minimalShadeSelectorAsColorPatches->setChecked(
true);
442
443 ui->minimalShadeSelectorPatchesPerLine->setValue(cfg.readEntry(
"minimalShadeSelectorPatchCount", 10));
444 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;"));
445 ui->minimalShadeSelectorLineHeight->setValue(cfg.readEntry(
"minimalShadeSelectorLineHeight", 10));
446
447 int hsxSettingType= (int)cfg.readEntry("hsxSettingType", 0);
448 ui->colorSelectorTypeComboBox->setCurrentIndex(hsxSettingType);
449
450
451
455
456
457 ui->l_lumaR->setValue(cfg.readEntry(
"lumaR", 0.2126));
458 ui->l_lumaG->setValue(cfg.readEntry(
"lumaG", 0.7152));
459 ui->l_lumaB->setValue(cfg.readEntry(
"lumaB", 0.0722));
460 ui->SP_Gamma->setValue(cfg.readEntry(
"gamma", 2.2));
461
462
463 ui->sb_lightness->setValue(hotkeycfg.readEntry(
"steps_lightness", 10));
464 ui->sb_saturation->setValue(hotkeycfg.readEntry(
"steps_saturation", 10));
465 ui->sb_hue->setValue(hotkeycfg.readEntry(
"steps_hue", 36));
466 ui->sb_rg->setValue(hotkeycfg.readEntry(
"steps_redgreen", 10));
467 ui->sb_by->setValue(hotkeycfg.readEntry(
"steps_blueyellow", 10));
468
469
470}
static KisColorSelectorConfiguration fromString(QString string)
void useCustomColorForSelector(bool)
void fromQColor(const QColor &c)
Convenient function for converting from a QColor.