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

2449 : WdgPopupPaletteSettingsBase(parent, name)
2450{
2451 using namespace PopupPaletteTabPrivate;
2452
2453 load();
2454
2455 connect(chkShowColorHistory, SIGNAL(toggled(bool)), cmbColorHistorySorting, SLOT(setEnabled(bool)));
2456 connect(chkShowColorHistory, SIGNAL(toggled(bool)), lblColorHistorySorting, SLOT(setEnabled(bool)));
2457 connect(cmbSelectorType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSelectorTypeChanged(int)));
2458 KIS_SAFE_ASSERT_RECOVER_NOOP(cmbColorHistorySorting->count() == allowedColorHistorySortingValues.size());
2459}
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 2461 of file kis_dlg_preferences.cc.

2462{
2463 using namespace PopupPaletteTabPrivate;
2464
2465 KisConfig config(true);
2466 sbNumPresets->setValue(config.favoritePresets());
2467 sbPaletteSize->setValue(config.readEntry("popuppalette/size", 385));
2468 sbSelectorSize->setValue(config.readEntry("popuppalette/selectorSize", 140));
2469 cmbSelectorType->setCurrentIndex(config.readEntry<bool>("popuppalette/usevisualcolorselector", false) ? 1 : 0);
2470 chkShowColorHistory->setChecked(config.readEntry("popuppalette/showColorHistory", true));
2471 chkShowRotationTrack->setChecked(config.readEntry("popuppalette/showRotationTrack", true));
2472 chkUseDynamicSlotCount->setChecked(config.readEntry("popuppalette/useDynamicSlotCount", true));
2473 grpFixTriangleRotation->setChecked(config.readEntry("popuppalette/fixTriangleRotation", false));
2474 sbTriangleRotationAngle->setValue(config.readEntry("popuppalette/triangleRotationAngle", 0));
2475
2476 QString currentSorting = config.readEntry("popuppalette/colorHistorySorting", QString("hsv"));
2477 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2478 currentSorting = "hsv";
2479 }
2480 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2481 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2482 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2483 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2484}

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

◆ save()

void PopupPaletteTab::save ( )

Definition at line 2486 of file kis_dlg_preferences.cc.

2487{
2488 using namespace PopupPaletteTabPrivate;
2489
2490 KisConfig config(true);
2491 config.setFavoritePresets(sbNumPresets->value());
2492 config.writeEntry("popuppalette/size", sbPaletteSize->value());
2493 config.writeEntry("popuppalette/selectorSize", sbSelectorSize->value());
2494 config.writeEntry<bool>("popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2495 config.writeEntry<bool>("popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2496 config.writeEntry<bool>("popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2497 config.writeEntry<bool>("popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2498 config.writeEntry("popuppalette/colorHistorySorting",
2499 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2500 config.writeEntry<bool>("popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2501 config.writeEntry("popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2502}

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

◆ setDefault()

void PopupPaletteTab::setDefault ( )

Definition at line 2504 of file kis_dlg_preferences.cc.

2505{
2506 KisConfig config(true);
2507 sbNumPresets->setValue(config.favoritePresets(true));
2508 sbPaletteSize->setValue(385);
2509 sbSelectorSize->setValue(140);
2510 cmbSelectorType->setCurrentIndex(0);
2511 chkShowColorHistory->setChecked(true);
2512 chkShowRotationTrack->setChecked(true);
2513 chkUseDynamicSlotCount->setChecked(true);
2514 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2515 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2516 grpFixTriangleRotation->setChecked(false);
2517 sbTriangleRotationAngle->setValue(0);
2518}

References KisConfig::favoritePresets().

◆ slotSelectorTypeChanged

void PopupPaletteTab::slotSelectorTypeChanged ( int index)
protectedslot

Definition at line 2520 of file kis_dlg_preferences.cc.

2520 {
2521 grpFixTriangleRotation->setEnabled(!index);
2522}

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