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

Constructor & Destructor Documentation

◆ PopupPaletteTab()

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

Definition at line 2604 of file kis_dlg_preferences.cc.

2605 : WdgPopupPaletteSettingsBase(parent, name)
2606{
2607 using namespace PopupPaletteTabPrivate;
2608
2609 load();
2610
2611 connect(chkShowColorHistory, SIGNAL(toggled(bool)), cmbColorHistorySorting, SLOT(setEnabled(bool)));
2612 connect(chkShowColorHistory, SIGNAL(toggled(bool)), lblColorHistorySorting, SLOT(setEnabled(bool)));
2613 connect(cmbSelectorType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSelectorTypeChanged(int)));
2614 KIS_SAFE_ASSERT_RECOVER_NOOP(cmbColorHistorySorting->count() == allowedColorHistorySortingValues.size());
2615}
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 2617 of file kis_dlg_preferences.cc.

2618{
2619 using namespace PopupPaletteTabPrivate;
2620
2621 KisConfig config(true);
2622 sbNumPresets->setValue(config.favoritePresets());
2623 sbPaletteSize->setValue(config.readEntry("popuppalette/size", 385));
2624 sbSelectorSize->setValue(config.readEntry("popuppalette/selectorSize", 140));
2625 cmbSelectorType->setCurrentIndex(config.readEntry<bool>("popuppalette/usevisualcolorselector", false) ? 1 : 0);
2626 chkShowColorHistory->setChecked(config.readEntry("popuppalette/showColorHistory", true));
2627 chkShowRotationTrack->setChecked(config.readEntry("popuppalette/showRotationTrack", true));
2628 chkUseDynamicSlotCount->setChecked(config.readEntry("popuppalette/useDynamicSlotCount", true));
2629 grpFixTriangleRotation->setChecked(config.readEntry("popuppalette/fixTriangleRotation", false));
2630 sbTriangleRotationAngle->setValue(config.readEntry("popuppalette/triangleRotationAngle", 0));
2631
2632 QString currentSorting = config.readEntry("popuppalette/colorHistorySorting", QString("hsv"));
2633 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2634 currentSorting = "hsv";
2635 }
2636 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2637 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2638 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2639 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2640}

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

◆ save()

void PopupPaletteTab::save ( )

Definition at line 2642 of file kis_dlg_preferences.cc.

2643{
2644 using namespace PopupPaletteTabPrivate;
2645
2646 KisConfig config(true);
2647 config.setFavoritePresets(sbNumPresets->value());
2648 config.writeEntry("popuppalette/size", sbPaletteSize->value());
2649 config.writeEntry("popuppalette/selectorSize", sbSelectorSize->value());
2650 config.writeEntry<bool>("popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2651 config.writeEntry<bool>("popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2652 config.writeEntry<bool>("popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2653 config.writeEntry<bool>("popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2654 config.writeEntry("popuppalette/colorHistorySorting",
2655 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2656 config.writeEntry<bool>("popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2657 config.writeEntry("popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2658}

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

◆ setDefault()

void PopupPaletteTab::setDefault ( )

Definition at line 2660 of file kis_dlg_preferences.cc.

2661{
2662 KisConfig config(true);
2663 sbNumPresets->setValue(config.favoritePresets(true));
2664 sbPaletteSize->setValue(385);
2665 sbSelectorSize->setValue(140);
2666 cmbSelectorType->setCurrentIndex(0);
2667 chkShowColorHistory->setChecked(true);
2668 chkShowRotationTrack->setChecked(true);
2669 chkUseDynamicSlotCount->setChecked(true);
2670 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2671 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2672 grpFixTriangleRotation->setChecked(false);
2673 sbTriangleRotationAngle->setValue(0);
2674}

References KisConfig::favoritePresets().

◆ slotSelectorTypeChanged

void PopupPaletteTab::slotSelectorTypeChanged ( int index)
protectedslot

Definition at line 2676 of file kis_dlg_preferences.cc.

2676 {
2677 grpFixTriangleRotation->setEnabled(!index);
2678}

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