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 356 of file kis_dlg_preferences.h.

Constructor & Destructor Documentation

◆ PopupPaletteTab()

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

Definition at line 2284 of file kis_dlg_preferences.cc.

2285 : WdgPopupPaletteSettingsBase(parent, name)
2286{
2287 using namespace PopupPaletteTabPrivate;
2288
2289 load();
2290
2291 connect(chkShowColorHistory, SIGNAL(toggled(bool)), cmbColorHistorySorting, SLOT(setEnabled(bool)));
2292 connect(chkShowColorHistory, SIGNAL(toggled(bool)), lblColorHistorySorting, SLOT(setEnabled(bool)));
2293 KIS_SAFE_ASSERT_RECOVER_NOOP(cmbColorHistorySorting->count() == allowedColorHistorySortingValues.size());
2294}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
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 connect(), KIS_SAFE_ASSERT_RECOVER_NOOP, and load().

Member Function Documentation

◆ load()

void PopupPaletteTab::load ( )

Definition at line 2296 of file kis_dlg_preferences.cc.

2297{
2298 using namespace PopupPaletteTabPrivate;
2299
2300 KisConfig config(true);
2301 sbNumPresets->setValue(config.favoritePresets());
2302 sbPaletteSize->setValue(config.readEntry("popuppalette/size", 385));
2303 sbSelectorSize->setValue(config.readEntry("popuppalette/selectorSize", 140));
2304 cmbSelectorType->setCurrentIndex(config.readEntry<bool>("popuppalette/usevisualcolorselector", false) ? 1 : 0);
2305 chkShowColorHistory->setChecked(config.readEntry("popuppalette/showColorHistory", true));
2306 chkShowRotationTrack->setChecked(config.readEntry("popuppalette/showRotationTrack", true));
2307 chkUseDynamicSlotCount->setChecked(config.readEntry("popuppalette/useDynamicSlotCount", true));
2308
2309 QString currentSorting = config.readEntry("popuppalette/colorHistorySorting", QString("hsv"));
2310 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2311 currentSorting = "hsv";
2312 }
2313 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2314 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2315 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2316}

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

◆ save()

void PopupPaletteTab::save ( )

Definition at line 2318 of file kis_dlg_preferences.cc.

2319{
2320 using namespace PopupPaletteTabPrivate;
2321
2322 KisConfig config(true);
2323 config.setFavoritePresets(sbNumPresets->value());
2324 config.writeEntry("popuppalette/size", sbPaletteSize->value());
2325 config.writeEntry("popuppalette/selectorSize", sbSelectorSize->value());
2326 config.writeEntry<bool>("popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2327 config.writeEntry<bool>("popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2328 config.writeEntry<bool>("popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2329 config.writeEntry<bool>("popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2330 config.writeEntry("popuppalette/colorHistorySorting",
2331 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2332}

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

◆ setDefault()

void PopupPaletteTab::setDefault ( )

Definition at line 2334 of file kis_dlg_preferences.cc.

2335{
2336 KisConfig config(true);
2337 sbNumPresets->setValue(config.favoritePresets(true));
2338 sbPaletteSize->setValue(385);
2339 sbSelectorSize->setValue(140);
2340 cmbSelectorType->setCurrentIndex(0);
2341 chkShowColorHistory->setChecked(true);
2342 chkShowRotationTrack->setChecked(true);
2343 chkUseDynamicSlotCount->setChecked(true);
2344 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2345 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2346}

References KisConfig::favoritePresets().


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