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

Constructor & Destructor Documentation

◆ PopupPaletteTab()

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

Definition at line 2573 of file kis_dlg_preferences.cc.

2574 : WdgPopupPaletteSettingsBase(parent, name)
2575{
2576 using namespace PopupPaletteTabPrivate;
2577
2578 load();
2579
2580 connect(chkShowColorHistory, SIGNAL(toggled(bool)), cmbColorHistorySorting, SLOT(setEnabled(bool)));
2581 connect(chkShowColorHistory, SIGNAL(toggled(bool)), lblColorHistorySorting, SLOT(setEnabled(bool)));
2582 connect(cmbSelectorType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSelectorTypeChanged(int)));
2583 KIS_SAFE_ASSERT_RECOVER_NOOP(cmbColorHistorySorting->count() == allowedColorHistorySortingValues.size());
2584}
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 2586 of file kis_dlg_preferences.cc.

2587{
2588 using namespace PopupPaletteTabPrivate;
2589
2590 KisConfig config(true);
2591 sbNumPresets->setValue(config.favoritePresets());
2592 sbPaletteSize->setValue(config.readEntry("popuppalette/size", 385));
2593 sbSelectorSize->setValue(config.readEntry("popuppalette/selectorSize", 140));
2594 cmbSelectorType->setCurrentIndex(config.readEntry<bool>("popuppalette/usevisualcolorselector", false) ? 1 : 0);
2595 chkShowColorHistory->setChecked(config.readEntry("popuppalette/showColorHistory", true));
2596 chkShowRotationTrack->setChecked(config.readEntry("popuppalette/showRotationTrack", true));
2597 chkUseDynamicSlotCount->setChecked(config.readEntry("popuppalette/useDynamicSlotCount", true));
2598 grpFixTriangleRotation->setChecked(config.readEntry("popuppalette/fixTriangleRotation", false));
2599 sbTriangleRotationAngle->setValue(config.readEntry("popuppalette/triangleRotationAngle", 0));
2600
2601 QString currentSorting = config.readEntry("popuppalette/colorHistorySorting", QString("hsv"));
2602 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2603 currentSorting = "hsv";
2604 }
2605 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2606 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2607 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2608 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2609}

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

◆ save()

void PopupPaletteTab::save ( )

Definition at line 2611 of file kis_dlg_preferences.cc.

2612{
2613 using namespace PopupPaletteTabPrivate;
2614
2615 KisConfig config(true);
2616 config.setFavoritePresets(sbNumPresets->value());
2617 config.writeEntry("popuppalette/size", sbPaletteSize->value());
2618 config.writeEntry("popuppalette/selectorSize", sbSelectorSize->value());
2619 config.writeEntry<bool>("popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2620 config.writeEntry<bool>("popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2621 config.writeEntry<bool>("popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2622 config.writeEntry<bool>("popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2623 config.writeEntry("popuppalette/colorHistorySorting",
2624 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2625 config.writeEntry<bool>("popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2626 config.writeEntry("popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2627}

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

◆ setDefault()

void PopupPaletteTab::setDefault ( )

Definition at line 2629 of file kis_dlg_preferences.cc.

2630{
2631 KisConfig config(true);
2632 sbNumPresets->setValue(config.favoritePresets(true));
2633 sbPaletteSize->setValue(385);
2634 sbSelectorSize->setValue(140);
2635 cmbSelectorType->setCurrentIndex(0);
2636 chkShowColorHistory->setChecked(true);
2637 chkShowRotationTrack->setChecked(true);
2638 chkUseDynamicSlotCount->setChecked(true);
2639 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2640 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2641 grpFixTriangleRotation->setChecked(false);
2642 sbTriangleRotationAngle->setValue(0);
2643}

References KisConfig::favoritePresets().

◆ slotSelectorTypeChanged

void PopupPaletteTab::slotSelectorTypeChanged ( int index)
protectedslot

Definition at line 2645 of file kis_dlg_preferences.cc.

2645 {
2646 grpFixTriangleRotation->setEnabled(!index);
2647}

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