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)
 

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 2417 of file kis_dlg_preferences.cc.

2418 : WdgPopupPaletteSettingsBase(parent, name)
2419{
2420 using namespace PopupPaletteTabPrivate;
2421
2422 load();
2423
2424 connect(chkShowColorHistory, SIGNAL(toggled(bool)), cmbColorHistorySorting, SLOT(setEnabled(bool)));
2425 connect(chkShowColorHistory, SIGNAL(toggled(bool)), lblColorHistorySorting, SLOT(setEnabled(bool)));
2426 KIS_SAFE_ASSERT_RECOVER_NOOP(cmbColorHistorySorting->count() == allowedColorHistorySortingValues.size());
2427}
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, and load().

Member Function Documentation

◆ load()

void PopupPaletteTab::load ( )

Definition at line 2429 of file kis_dlg_preferences.cc.

2430{
2431 using namespace PopupPaletteTabPrivate;
2432
2433 KisConfig config(true);
2434 sbNumPresets->setValue(config.favoritePresets());
2435 sbPaletteSize->setValue(config.readEntry("popuppalette/size", 385));
2436 sbSelectorSize->setValue(config.readEntry("popuppalette/selectorSize", 140));
2437 cmbSelectorType->setCurrentIndex(config.readEntry<bool>("popuppalette/usevisualcolorselector", false) ? 1 : 0);
2438 chkShowColorHistory->setChecked(config.readEntry("popuppalette/showColorHistory", true));
2439 chkShowRotationTrack->setChecked(config.readEntry("popuppalette/showRotationTrack", true));
2440 chkUseDynamicSlotCount->setChecked(config.readEntry("popuppalette/useDynamicSlotCount", true));
2441
2442 QString currentSorting = config.readEntry("popuppalette/colorHistorySorting", QString("hsv"));
2443 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2444 currentSorting = "hsv";
2445 }
2446 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2447 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2448 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2449}

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

◆ save()

void PopupPaletteTab::save ( )

Definition at line 2451 of file kis_dlg_preferences.cc.

2452{
2453 using namespace PopupPaletteTabPrivate;
2454
2455 KisConfig config(true);
2456 config.setFavoritePresets(sbNumPresets->value());
2457 config.writeEntry("popuppalette/size", sbPaletteSize->value());
2458 config.writeEntry("popuppalette/selectorSize", sbSelectorSize->value());
2459 config.writeEntry<bool>("popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2460 config.writeEntry<bool>("popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2461 config.writeEntry<bool>("popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2462 config.writeEntry<bool>("popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2463 config.writeEntry("popuppalette/colorHistorySorting",
2464 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2465}

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

◆ setDefault()

void PopupPaletteTab::setDefault ( )

Definition at line 2467 of file kis_dlg_preferences.cc.

2468{
2469 KisConfig config(true);
2470 sbNumPresets->setValue(config.favoritePresets(true));
2471 sbPaletteSize->setValue(385);
2472 sbSelectorSize->setValue(140);
2473 cmbSelectorType->setCurrentIndex(0);
2474 chkShowColorHistory->setChecked(true);
2475 chkShowRotationTrack->setChecked(true);
2476 chkUseDynamicSlotCount->setChecked(true);
2477 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2478 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2479}

References KisConfig::favoritePresets().


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