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

Constructor & Destructor Documentation

◆ PopupPaletteTab()

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

Definition at line 2600 of file kis_dlg_preferences.cc.

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

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

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

◆ save()

void PopupPaletteTab::save ( )

Definition at line 2638 of file kis_dlg_preferences.cc.

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

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

◆ setDefault()

void PopupPaletteTab::setDefault ( )

Definition at line 2656 of file kis_dlg_preferences.cc.

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

References KisConfig::favoritePresets().

◆ slotSelectorTypeChanged

void PopupPaletteTab::slotSelectorTypeChanged ( int index)
protectedslot

Definition at line 2672 of file kis_dlg_preferences.cc.

2672 {
2673 grpFixTriangleRotation->setEnabled(!index);
2674}

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