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

Constructor & Destructor Documentation

◆ PopupPaletteTab()

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

Definition at line 2648 of file kis_dlg_preferences.cc.

2649 : WdgPopupPaletteSettingsBase(parent, name)
2650{
2651 using namespace PopupPaletteTabPrivate;
2652
2653 load();
2654
2655 connect(chkShowColorHistory, SIGNAL(toggled(bool)), cmbColorHistorySorting, SLOT(setEnabled(bool)));
2656 connect(chkShowColorHistory, SIGNAL(toggled(bool)), lblColorHistorySorting, SLOT(setEnabled(bool)));
2657 connect(cmbSelectorType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSelectorTypeChanged(int)));
2658 KIS_SAFE_ASSERT_RECOVER_NOOP(cmbColorHistorySorting->count() == allowedColorHistorySortingValues.size());
2659}
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 2661 of file kis_dlg_preferences.cc.

2662{
2663 using namespace PopupPaletteTabPrivate;
2664
2665 KisConfig config(true);
2666 sbNumPresets->setValue(config.favoritePresets());
2667 sbPaletteSize->setValue(config.readEntry("popuppalette/size", 385));
2668 sbSelectorSize->setValue(config.readEntry("popuppalette/selectorSize", 140));
2669 cmbSelectorType->setCurrentIndex(config.readEntry<bool>("popuppalette/usevisualcolorselector", false) ? 1 : 0);
2670 chkShowColorHistory->setChecked(config.readEntry("popuppalette/showColorHistory", true));
2671 chkShowRotationTrack->setChecked(config.readEntry("popuppalette/showRotationTrack", true));
2672 chkUseDynamicSlotCount->setChecked(config.readEntry("popuppalette/useDynamicSlotCount", true));
2673 grpFixTriangleRotation->setChecked(config.readEntry("popuppalette/fixTriangleRotation", false));
2674 sbTriangleRotationAngle->setValue(config.readEntry("popuppalette/triangleRotationAngle", 0));
2675
2676 QString currentSorting = config.readEntry("popuppalette/colorHistorySorting", QString("hsv"));
2677 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2678 currentSorting = "hsv";
2679 }
2680 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2681 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2682 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2683 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2684}

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

◆ save()

void PopupPaletteTab::save ( )

Definition at line 2686 of file kis_dlg_preferences.cc.

2687{
2688 using namespace PopupPaletteTabPrivate;
2689
2690 KisConfig config(true);
2691 config.setFavoritePresets(sbNumPresets->value());
2692 config.writeEntry("popuppalette/size", sbPaletteSize->value());
2693 config.writeEntry("popuppalette/selectorSize", sbSelectorSize->value());
2694 config.writeEntry<bool>("popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2695 config.writeEntry<bool>("popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2696 config.writeEntry<bool>("popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2697 config.writeEntry<bool>("popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2698 config.writeEntry("popuppalette/colorHistorySorting",
2699 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2700 config.writeEntry<bool>("popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2701 config.writeEntry("popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2702}

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

◆ setDefault()

void PopupPaletteTab::setDefault ( )

Definition at line 2704 of file kis_dlg_preferences.cc.

2705{
2706 KisConfig config(true);
2707 sbNumPresets->setValue(config.favoritePresets(true));
2708 sbPaletteSize->setValue(385);
2709 sbSelectorSize->setValue(140);
2710 cmbSelectorType->setCurrentIndex(0);
2711 chkShowColorHistory->setChecked(true);
2712 chkShowRotationTrack->setChecked(true);
2713 chkUseDynamicSlotCount->setChecked(true);
2714 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2715 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2716 grpFixTriangleRotation->setChecked(false);
2717 sbTriangleRotationAngle->setValue(0);
2718}

References KisConfig::favoritePresets().

◆ slotSelectorTypeChanged

void PopupPaletteTab::slotSelectorTypeChanged ( int index)
protectedslot

Definition at line 2720 of file kis_dlg_preferences.cc.

2720 {
2721 grpFixTriangleRotation->setEnabled(!index);
2722}

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