Krita Source Code Documentation
Loading...
Searching...
No Matches
PopupPaletteTab Class Reference

#include <kis_dlg_preferences.h>

+ Inheritance diagram for PopupPaletteTab:

Public Member Functions

void load ()
 
 PopupPaletteTab (QWidget *parent=0, const char *name=0)
 
void save ()
 
void setDefault ()
 
- Public Member Functions inherited from WdgPopupPaletteSettingsBase
 WdgPopupPaletteSettingsBase (QWidget *parent, const char *name)
 

Protected Slots

void slotSelectorTypeChanged (int index)
 

Detailed Description

Definition at line 369 of file kis_dlg_preferences.h.

Constructor & Destructor Documentation

◆ PopupPaletteTab()

PopupPaletteTab::PopupPaletteTab ( QWidget * parent = 0,
const char * name = 0 )

Definition at line 2460 of file kis_dlg_preferences.cc.

2461 : WdgPopupPaletteSettingsBase(parent, name)
2462{
2463 using namespace PopupPaletteTabPrivate;
2464
2465 load();
2466
2467 connect(chkShowColorHistory, SIGNAL(toggled(bool)), cmbColorHistorySorting, SLOT(setEnabled(bool)));
2468 connect(chkShowColorHistory, SIGNAL(toggled(bool)), lblColorHistorySorting, SLOT(setEnabled(bool)));
2469 connect(cmbSelectorType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSelectorTypeChanged(int)));
2470 KIS_SAFE_ASSERT_RECOVER_NOOP(cmbColorHistorySorting->count() == allowedColorHistorySortingValues.size());
2471}
void slotSelectorTypeChanged(int index)
WdgPopupPaletteSettingsBase(QWidget *parent, const char *name)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130
static const QStringList allowedColorHistorySortingValues({"none", "hsv"})

References KIS_SAFE_ASSERT_RECOVER_NOOP, load(), and slotSelectorTypeChanged().

Member Function Documentation

◆ load()

void PopupPaletteTab::load ( )

Definition at line 2473 of file kis_dlg_preferences.cc.

2474{
2475 using namespace PopupPaletteTabPrivate;
2476
2477 KisConfig config(true);
2478 sbNumPresets->setValue(config.favoritePresets());
2479 sbPaletteSize->setValue(config.readEntry("popuppalette/size", 385));
2480 sbSelectorSize->setValue(config.readEntry("popuppalette/selectorSize", 140));
2481 cmbSelectorType->setCurrentIndex(config.readEntry<bool>("popuppalette/usevisualcolorselector", false) ? 1 : 0);
2482 chkShowColorHistory->setChecked(config.readEntry("popuppalette/showColorHistory", true));
2483 chkShowRotationTrack->setChecked(config.readEntry("popuppalette/showRotationTrack", true));
2484 chkUseDynamicSlotCount->setChecked(config.readEntry("popuppalette/useDynamicSlotCount", true));
2485 grpFixTriangleRotation->setChecked(config.readEntry("popuppalette/fixTriangleRotation", false));
2486 sbTriangleRotationAngle->setValue(config.readEntry("popuppalette/triangleRotationAngle", 0));
2487
2488 QString currentSorting = config.readEntry("popuppalette/colorHistorySorting", QString("hsv"));
2489 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2490 currentSorting = "hsv";
2491 }
2492 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2493 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2494 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2495 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2496}

References KisConfig::favoritePresets(), and KisConfig::readEntry().

◆ save()

void PopupPaletteTab::save ( )

Definition at line 2498 of file kis_dlg_preferences.cc.

2499{
2500 using namespace PopupPaletteTabPrivate;
2501
2502 KisConfig config(true);
2503 config.setFavoritePresets(sbNumPresets->value());
2504 config.writeEntry("popuppalette/size", sbPaletteSize->value());
2505 config.writeEntry("popuppalette/selectorSize", sbSelectorSize->value());
2506 config.writeEntry<bool>("popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2507 config.writeEntry<bool>("popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2508 config.writeEntry<bool>("popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2509 config.writeEntry<bool>("popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2510 config.writeEntry("popuppalette/colorHistorySorting",
2511 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2512 config.writeEntry<bool>("popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2513 config.writeEntry("popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2514}

References KisConfig::setFavoritePresets(), and KisConfig::writeEntry().

◆ setDefault()

void PopupPaletteTab::setDefault ( )

Definition at line 2516 of file kis_dlg_preferences.cc.

2517{
2518 KisConfig config(true);
2519 sbNumPresets->setValue(config.favoritePresets(true));
2520 sbPaletteSize->setValue(385);
2521 sbSelectorSize->setValue(140);
2522 cmbSelectorType->setCurrentIndex(0);
2523 chkShowColorHistory->setChecked(true);
2524 chkShowRotationTrack->setChecked(true);
2525 chkUseDynamicSlotCount->setChecked(true);
2526 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2527 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2528 grpFixTriangleRotation->setChecked(false);
2529 sbTriangleRotationAngle->setValue(0);
2530}

References KisConfig::favoritePresets().

◆ slotSelectorTypeChanged

void PopupPaletteTab::slotSelectorTypeChanged ( int index)
protectedslot

Definition at line 2532 of file kis_dlg_preferences.cc.

2532 {
2533 grpFixTriangleRotation->setEnabled(!index);
2534}

The documentation for this class was generated from the following files: