Krita Source Code Documentation
Loading...
Searching...
No Matches
WGColorSelectorSettings Class Reference

#include <WGColorSelectorSettings.h>

+ Inheritance diagram for WGColorSelectorSettings:

Public Slots

void loadDefaultPreferences () override
 
void loadPreferences () override
 
void savePreferences () const override
 
- Public Slots inherited from KisPreferenceSet
virtual void loadDefaultPreferences ()=0
 
virtual void loadPreferences ()=0
 
virtual void savePreferences () const =0
 

Public Member Functions

QString header () override
 
QIcon icon () override
 
QString id () override
 
QString name () override
 
 WGColorSelectorSettings (QWidget *parent=0)
 
 ~WGColorSelectorSettings () override
 
- Public Member Functions inherited from KisPreferenceSet
 KisPreferenceSet (QWidget *parent=0)
 

Static Public Member Functions

static QString stringID ()
 

Private Slots

void slotColorSpaceSourceChanged (int index)
 
void slotLineEdited (int lineNum)
 
void slotSetColorModel (int index)
 
void slotSetSelectorConfiguration (const KisColorSelectorConfiguration &cfg)
 
void slotSetShadeLineCount (int count)
 
void slotShowLineEditor (int lineNum)
 

Private Member Functions

void loadPreferencesImpl (bool loadDefaults)
 

Private Attributes

WGSelectorConfigGridm_favoriteConfigGrid
 
WGSelectorConfigGridm_selectorConfigGrid
 
QVector< QToolButton * > m_shadeLineButtons
 
QVector< WGConfig::ShadeLinem_shadeLineConfig
 
WGShadeLineEditorm_shadeLineEditor
 
QButtonGroup * m_shadeLineGroup
 
QScopedPointer< Ui::WGConfigWidget > m_ui
 

Detailed Description

Definition at line 26 of file WGColorSelectorSettings.h.

Constructor & Destructor Documentation

◆ WGColorSelectorSettings()

WGColorSelectorSettings::WGColorSelectorSettings ( QWidget * parent = 0)
explicit

Definition at line 23 of file WGColorSelectorSettings.cpp.

24 : KisPreferenceSet(parent)
25 , m_ui(new Ui::WGConfigWidget)
26 , m_shadeLineGroup(new QButtonGroup(this))
27{
28 m_ui->setupUi(this);
31 m_ui->btnSelectorShape->setPopupWidget(m_selectorConfigGrid);
35 m_ui->btnSelectorShape, SLOT(hidePopupWidget()));
36 connect(m_ui->cmbColorModel, SIGNAL(currentIndexChanged(int)), SLOT(slotSetColorModel(int)));
37 connect(m_ui->sbShadeLineCount, SIGNAL(valueChanged(int)), SLOT(slotSetShadeLineCount(int)));
40 m_ui->btnFavoriteSelectors->setPopupWidget(m_favoriteConfigGrid);
41
43 m_shadeLineEditor->hide();
44 connect(m_shadeLineEditor, SIGNAL(sigEditorClosed(int)), SLOT(slotLineEdited(int)));
45
46 slotColorSpaceSourceChanged(m_ui->cmbSelectionColorSpace->currentIndex());
47 connect(m_ui->cmbSelectionColorSpace, SIGNAL(currentIndexChanged(int)), SLOT(slotColorSpaceSourceChanged(int)));
48
49 m_shadeLineGroup->setExclusive(false);
50 slotSetShadeLineCount(m_ui->sbShadeLineCount->value());
51 connect(m_shadeLineGroup, SIGNAL(idClicked(int)), SLOT(slotShowLineEditor(int)));
52}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisPreferenceSet(QWidget *parent=0)
WGShadeLineEditor * m_shadeLineEditor
WGSelectorConfigGrid * m_selectorConfigGrid
QScopedPointer< Ui::WGConfigWidget > m_ui
void slotSetSelectorConfiguration(const KisColorSelectorConfiguration &cfg)
WGSelectorConfigGrid * m_favoriteConfigGrid
void setConfigurations(const QVector< KisColorSelectorConfiguration > &configurations)
static QVector< KisColorSelectorConfiguration > hueBasedConfigurations()

References connect(), WGSelectorConfigGrid::hueBasedConfigurations(), m_favoriteConfigGrid, m_selectorConfigGrid, m_shadeLineEditor, m_shadeLineGroup, m_ui, WGSelectorConfigGrid::setConfigurations(), slotColorSpaceSourceChanged(), slotLineEdited(), slotSetColorModel(), slotSetSelectorConfiguration(), slotSetShadeLineCount(), and slotShowLineEditor().

◆ ~WGColorSelectorSettings()

WGColorSelectorSettings::~WGColorSelectorSettings ( )
override

Definition at line 54 of file WGColorSelectorSettings.cpp.

55{
56}

Member Function Documentation

◆ header()

QString WGColorSelectorSettings::header ( )
overridevirtual

Implements KisPreferenceSet.

Definition at line 68 of file WGColorSelectorSettings.cpp.

69{
70 return QString(i18n("Wide Gamut Color Selector Settings"));
71}

◆ icon()

QIcon WGColorSelectorSettings::icon ( )
overridevirtual

Implements KisPreferenceSet.

Definition at line 73 of file WGColorSelectorSettings.cpp.

74{
75 return QIcon();
76}

◆ id()

QString WGColorSelectorSettings::id ( )
overridevirtual

Implements KisPreferenceSet.

Definition at line 58 of file WGColorSelectorSettings.cpp.

59{
60 return stringID();
61}

References stringID().

◆ loadDefaultPreferences

void WGColorSelectorSettings::loadDefaultPreferences ( )
overrideslot

Definition at line 142 of file WGColorSelectorSettings.cpp.

143{
145}
void loadPreferencesImpl(bool loadDefaults)

References loadPreferencesImpl().

◆ loadPreferences

void WGColorSelectorSettings::loadPreferences ( )
overrideslot

Definition at line 137 of file WGColorSelectorSettings.cpp.

138{
139 loadPreferencesImpl(false);
140}

References loadPreferencesImpl().

◆ loadPreferencesImpl()

void WGColorSelectorSettings::loadPreferencesImpl ( bool loadDefaults)
private

Definition at line 147 of file WGColorSelectorSettings.cpp.

148{
150 m_ui->cmbSelectorRenderingMode->setCurrentIndex(cfg.get(WGConfig::selectorRenderMode, defaults));
151 m_ui->cmbColorModel->setCurrentIndex(cfg.get(WGConfig::rgbColorModel, defaults) - KisVisualColorModel::HSV);
152 KisColorSelectorConfiguration selectorCfg = defaults ? cfg.defaultColorSelectorConfiguration
153 : cfg.colorSelectorConfiguration();
154 m_selectorConfigGrid->setChecked(selectorCfg);
155 m_ui->btnSelectorShape->setIcon(m_selectorConfigGrid->generateIcon(selectorCfg, devicePixelRatioF()));
156 // General
157 m_ui->grpQuickSettingsMenu->setChecked(cfg.get(WGConfig::quickSettingsEnabled, defaults));
158 QVector<KisColorSelectorConfiguration> favoriteConfigs = cfg.favoriteConfigurations(defaults);
159 for (const KisColorSelectorConfiguration &fav : std::as_const(favoriteConfigs)) {
161 }
162 m_ui->cmbSelectionColorSpace->setCurrentIndex(cfg.get(WGConfig::colorSpaceSource, defaults));
163 m_ui->wdgColorspace->setCurrentColorSpace(cfg.customSelectionColorSpace(defaults));
164 m_ui->chkProofColors->setChecked(cfg.get(WGConfig::proofToPaintingColors, defaults));
165 // Pop-ups
166 m_ui->sbPopupSize->setValue(cfg.get(WGConfig::popupSize, defaults));
167 Qt::Orientation patchOrientation = cfg.get(WGConfig::popupPatches.orientation, defaults);
168 if (patchOrientation == Qt::Horizontal) {
169 m_ui->rbPopupHorizontal->setChecked(true);
170 } else {
171 m_ui->rbPopupVertical->setChecked(true);
172 }
173 QSize colorPatchSize = cfg.get(WGConfig::popupPatches.patchSize, defaults);
174 m_ui->sbPatchWidth->setValue(colorPatchSize.width());
175 m_ui->sbPatchHeight->setValue(colorPatchSize.height());
176 m_ui->sbPopupMaxPatches->setValue(cfg.get(WGConfig::popupPatches.maxCount, defaults));
177 m_ui->sbPopupPatchesRows->setValue(cfg.get(WGConfig::popupPatches.rows, defaults));
178 m_ui->cbPopupScrolling->setCurrentIndex(static_cast<int>(cfg.get(WGConfig::popupPatches.scrolling, defaults)));
179 // Shade Selector
180 m_ui->grpMinimalShadeSelector->setChecked(cfg.get(WGConfig::minimalShadeSelectorEnabled, defaults));
181 m_ui->chkShadeSelUpdateExternal->setChecked(cfg.get(WGConfig::shadeSelectorUpdateOnExternalChanges, defaults));
182 m_ui->chkShadeSelUpdateInteraction->setChecked(cfg.get(WGConfig::shadeSelectorUpdateOnInteractionEnd, defaults));
183 m_ui->chkShadeSelUpdateOnRightClick->setChecked(cfg.get(WGConfig::shadeSelectorUpdateOnRightClick, defaults));
184 m_shadeLineConfig = cfg.shadeSelectorLines(defaults);
185 // update shade lines we will re-use, the rest is handled by slotSetShadeLineCount()
186 for (int i = 0, end = qMin(m_shadeLineButtons.size(), m_shadeLineConfig.size()); i < end; i++) {
188 }
189 m_ui->sbShadeLineCount->setValue(m_shadeLineConfig.size());
190 m_ui->sbShadeLineHeight->setValue(cfg.get(WGConfig::shadeSelectorLineHeight, defaults));
191 // Color History
192 m_ui->historyGroupBox->setChecked(cfg.get(WGConfig::colorHistoryEnabled, defaults));
193 patchOrientation = cfg.get(WGConfig::colorHistory.orientation, defaults);
194 if (patchOrientation == Qt::Horizontal) {
195 m_ui->rbHistoryHorizontal->setChecked(true);
196 } else {
197 m_ui->rbHistoryVertical->setChecked(true);
198 }
199 colorPatchSize = cfg.get(WGConfig::colorHistory.patchSize, defaults);
200 m_ui->sbHistoryPatchWidth->setValue(colorPatchSize.width());
201 m_ui->sbHistoryPatchHeight->setValue(colorPatchSize.height());
202 m_ui->sbHistoryMaxPatches->setValue(cfg.get(WGConfig::colorHistory.maxCount));
203 m_ui->sbHistoryRows->setValue(cfg.get(WGConfig::colorHistory.rows, defaults));
204 m_ui->cbScrolling->setCurrentIndex(static_cast<int>(cfg.get(WGConfig::colorHistory.scrolling, defaults)));
205 m_ui->ckHistoryClearButton->setChecked(cfg.get(WGConfig::colorHistoryShowClearButton, defaults));
206 // Common Colors (Colors from Image)
207 m_ui->commonColorsGroupBox->setChecked(cfg.get(WGConfig::commonColorsEnabled, defaults));
208 patchOrientation = cfg.get(WGConfig::commonColors.orientation, defaults);
209 if (patchOrientation == Qt::Horizontal) {
210 m_ui->rbCommonColorsHorizontal->setChecked(true);
211 } else {
212 m_ui->rbCommonColorsVertical->setChecked(true);
213 }
214 colorPatchSize = cfg.get(WGConfig::commonColors.patchSize, defaults);
215 m_ui->sbCommonColorsPatchWidth->setValue(colorPatchSize.width());
216 m_ui->sbCommonColorsPatchHeight->setValue(colorPatchSize.height());
217 m_ui->sbCommonColorsPatches->setValue(cfg.get(WGConfig::commonColors.maxCount, defaults));
218 m_ui->sbCommonColorsRows->setValue(cfg.get(WGConfig::commonColors.rows, defaults));
219 m_ui->cbCommonColorsScrolling->setCurrentIndex(static_cast<int>(cfg.get(WGConfig::commonColors.scrolling, defaults)));
220 m_ui->ckCCAutoUpdate->setChecked(cfg.get(WGConfig::commonColorsAutoUpdate, defaults));
221}
QVector< WGConfig::ShadeLine > m_shadeLineConfig
QVector< QToolButton * > m_shadeLineButtons
QIcon generateIcon(const KisColorSelectorConfiguration &configuration, qreal pixelRatio=1.0, bool dualState=false) const
void setChecked(const KisColorSelectorConfiguration &configuration)
QIcon generateIcon(const WGConfig::ShadeLine &cfg)
const GenericSetting< bool > colorHistoryEnabled
Definition WGConfig.cpp:238
const ColorPatches commonColors
Definition WGConfig.cpp:221
const GenericSetting< bool > minimalShadeSelectorEnabled
Definition WGConfig.cpp:246
const GenericSetting< bool > commonColorsEnabled
Definition WGConfig.cpp:239
const NumericSetting< KisVisualColorSelector::RenderMode > selectorRenderMode
Definition WGConfig.cpp:255
const ColorPatches popupPatches
Definition WGConfig.cpp:229
const NumericSetting< WGColorSelectorDock::ColorSpaceSource > colorSpaceSource
const GenericSetting< bool > colorHistoryShowClearButton
Definition WGConfig.cpp:240
const NumericSetting< KisVisualColorModel::ColorModel > rgbColorModel
Definition WGConfig.cpp:252
const NumericSetting< int > shadeSelectorLineHeight
Definition WGConfig.cpp:247
class WGConfig Accessor
const GenericSetting< bool > proofToPaintingColors
Definition WGConfig.cpp:237
const NumericSetting< int > popupSize
Definition WGConfig.cpp:244
const GenericSetting< bool > shadeSelectorUpdateOnExternalChanges
Definition WGConfig.cpp:248
const GenericSetting< bool > quickSettingsEnabled
Definition WGConfig.cpp:243
const GenericSetting< bool > commonColorsAutoUpdate
Definition WGConfig.cpp:241
const GenericSetting< bool > shadeSelectorUpdateOnInteractionEnd
Definition WGConfig.cpp:249
const ColorPatches colorHistory
Definition WGConfig.cpp:213
const GenericSetting< bool > shadeSelectorUpdateOnRightClick
Definition WGConfig.cpp:250
NumericSetting< Scrolling > scrolling
Definition WGConfig.h:200
NumericSetting< int > rows
Definition WGConfig.h:199
NumericSetting< int > maxCount
Definition WGConfig.h:198

References WGConfig::colorHistory, WGConfig::colorHistoryEnabled, WGConfig::colorHistoryShowClearButton, WGConfig::colorSpaceSource, WGConfig::commonColors, WGConfig::commonColorsAutoUpdate, WGConfig::commonColorsEnabled, WGSelectorConfigGrid::generateIcon(), WGShadeLineEditor::generateIcon(), KisVisualColorModel::HSV, m_favoriteConfigGrid, m_selectorConfigGrid, m_shadeLineButtons, m_shadeLineConfig, m_shadeLineEditor, m_ui, WGConfig::ColorPatches::maxCount, WGConfig::minimalShadeSelectorEnabled, WGConfig::popupPatches, WGConfig::popupSize, WGConfig::proofToPaintingColors, WGConfig::quickSettingsEnabled, WGConfig::rgbColorModel, WGConfig::ColorPatches::rows, WGConfig::ColorPatches::scrolling, WGConfig::selectorRenderMode, WGSelectorConfigGrid::setChecked(), WGConfig::shadeSelectorLineHeight, WGConfig::shadeSelectorUpdateOnExternalChanges, WGConfig::shadeSelectorUpdateOnInteractionEnd, and WGConfig::shadeSelectorUpdateOnRightClick.

◆ name()

QString WGColorSelectorSettings::name ( )
overridevirtual

Implements KisPreferenceSet.

Definition at line 63 of file WGColorSelectorSettings.cpp.

64{
65 return QString(i18n("Wide Gamut Selector"));
66}

◆ savePreferences

void WGColorSelectorSettings::savePreferences ( ) const
overrideslot

Definition at line 83 of file WGColorSelectorSettings.cpp.

84{
85 WGConfig::Accessor cfg(false);
87 static_cast<KisVisualColorSelector::RenderMode>(m_ui->cmbSelectorRenderingMode->currentIndex()));
89 m_ui->cmbColorModel->currentIndex() + KisVisualColorModel::HSV));
90 cfg.setColorSelectorConfiguration(m_selectorConfigGrid->currentConfiguration());
91 // General
92 cfg.set(WGConfig::quickSettingsEnabled, m_ui->grpQuickSettingsMenu->isChecked());
93 cfg.setFavoriteConfigurations(m_favoriteConfigGrid->selectedConfigurations());
95 static_cast<WGColorSelectorDock::ColorSpaceSource>(m_ui->cmbSelectionColorSpace->currentIndex()));
96 cfg.setCustomSelectionColorSpace(m_ui->wdgColorspace->currentColorSpace());
97 cfg.set(WGConfig::proofToPaintingColors, m_ui->chkProofColors->isChecked());
98 // Pop-ups
99 cfg.set(WGConfig::popupSize, m_ui->sbPopupSize->value());
100 cfg.set(WGConfig::popupPatches.orientation, m_ui->rbPopupHorizontal->isChecked() ? Qt::Horizontal : Qt::Vertical);
101 cfg.set(WGConfig::popupPatches.patchSize, QSize(m_ui->sbPatchWidth->value(), m_ui->sbPatchHeight->value()));
102 cfg.set(WGConfig::popupPatches.maxCount, m_ui->sbPopupMaxPatches->value());
103 cfg.set(WGConfig::popupPatches.rows, m_ui->sbPopupPatchesRows->value());
104 cfg.set(WGConfig::popupPatches.scrolling, static_cast<WGConfig::Scrolling>(m_ui->cbPopupScrolling->currentIndex()));
105 // Shade Selector
106 cfg.set(WGConfig::minimalShadeSelectorEnabled, m_ui->grpMinimalShadeSelector->isChecked());
107 cfg.set(WGConfig::shadeSelectorUpdateOnExternalChanges, m_ui->chkShadeSelUpdateExternal->isChecked());
108 cfg.set(WGConfig::shadeSelectorUpdateOnInteractionEnd, m_ui->chkShadeSelUpdateInteraction->isChecked());
109 cfg.set(WGConfig::shadeSelectorUpdateOnRightClick, m_ui->chkShadeSelUpdateOnRightClick->isChecked());
110 // we don't discard shade line configurations right away so we need to trim here
112 lineConfig.resize(m_ui->sbShadeLineCount->value());
113 cfg.setShadeSelectorLines(lineConfig);
114 cfg.set(WGConfig::shadeSelectorLineHeight, m_ui->sbShadeLineHeight->value());
115 // Color History
116 cfg.set(WGConfig::colorHistoryEnabled, m_ui->historyGroupBox->isChecked());
117 cfg.set(WGConfig::colorHistory.orientation, m_ui->rbHistoryHorizontal->isChecked() ? Qt::Horizontal : Qt::Vertical);
118 cfg.set(WGConfig::colorHistory.patchSize, { m_ui->sbHistoryPatchWidth->value(), m_ui->sbHistoryPatchHeight->value() });
119 cfg.set(WGConfig::colorHistory.maxCount, m_ui->sbHistoryMaxPatches->value());
120 cfg.set(WGConfig::colorHistory.rows, m_ui->sbHistoryRows->value());
121 cfg.set(WGConfig::colorHistory.scrolling, static_cast<WGConfig::Scrolling>(m_ui->cbScrolling->currentIndex()));
122 cfg.set(WGConfig::colorHistoryShowClearButton, m_ui->ckHistoryClearButton->isChecked());
123 // Common Colors (Colors from Image)
124 cfg.set(WGConfig::commonColorsEnabled, m_ui->commonColorsGroupBox->isChecked());
125 cfg.set(WGConfig::commonColors.orientation, m_ui->rbCommonColorsHorizontal->isChecked() ? Qt::Horizontal : Qt::Vertical);
126 cfg.set(WGConfig::commonColors.patchSize, { m_ui->sbCommonColorsPatchWidth->value(),
127 m_ui->sbCommonColorsPatchHeight->value() });
128 cfg.set(WGConfig::commonColors.maxCount, m_ui->sbCommonColorsPatches->value());
129 cfg.set(WGConfig::commonColors.rows, m_ui->sbCommonColorsRows->value());
130 cfg.set(WGConfig::commonColors.scrolling, static_cast<WGConfig::Scrolling>(m_ui->cbCommonColorsScrolling->currentIndex()));
131 cfg.set(WGConfig::commonColorsAutoUpdate, m_ui->ckCCAutoUpdate->isChecked());
132
135}
QVector< KisColorSelectorConfiguration > selectedConfigurations() const
KisColorSelectorConfiguration currentConfiguration() const
WGConfigNotifier * notifier()
Definition WGConfig.cpp:190

References WGConfig::colorHistory, WGConfig::colorHistoryEnabled, WGConfig::colorHistoryShowClearButton, WGConfig::colorSpaceSource, WGConfig::commonColors, WGConfig::commonColorsAutoUpdate, WGConfig::commonColorsEnabled, WGSelectorConfigGrid::currentConfiguration(), KisVisualColorModel::HSV, m_favoriteConfigGrid, m_selectorConfigGrid, m_shadeLineConfig, m_ui, WGConfig::minimalShadeSelectorEnabled, WGConfig::notifier(), WGConfig::WGConfigNotifier::notifyConfigChanged(), WGConfig::WGConfigNotifier::notifySelectorConfigChanged(), WGConfig::popupPatches, WGConfig::popupSize, WGConfig::proofToPaintingColors, WGConfig::quickSettingsEnabled, WGConfig::rgbColorModel, WGSelectorConfigGrid::selectedConfigurations(), WGConfig::selectorRenderMode, WGConfig::shadeSelectorLineHeight, WGConfig::shadeSelectorUpdateOnExternalChanges, WGConfig::shadeSelectorUpdateOnInteractionEnd, and WGConfig::shadeSelectorUpdateOnRightClick.

◆ slotColorSpaceSourceChanged

void WGColorSelectorSettings::slotColorSpaceSourceChanged ( int index)
privateslot

Definition at line 250 of file WGColorSelectorSettings.cpp.

251{
253 m_ui->wdgColorspace->setEnabled(csSource == WGColorSelectorDock::FixedColorSpace);
254}

References WGColorSelectorDock::FixedColorSpace, and m_ui.

◆ slotLineEdited

void WGColorSelectorSettings::slotLineEdited ( int lineNum)
privateslot

◆ slotSetColorModel

void WGColorSelectorSettings::slotSetColorModel ( int index)
privateslot

Definition at line 229 of file WGColorSelectorSettings.cpp.

230{
232 switch (index) {
233 case 0:
234 default:
236 break;
237 case 1:
239 break;
240 case 2:
242 break;
243 case 3:
245 }
247 m_ui->btnSelectorShape->setIcon(m_selectorConfigGrid->currentIcon());
248}
void setColorModel(KisVisualColorModel::ColorModel model)

References WGSelectorConfigGrid::currentIcon(), KisVisualColorModel::HSI, KisVisualColorModel::HSL, KisVisualColorModel::HSV, KisVisualColorModel::HSY, m_selectorConfigGrid, m_ui, and WGSelectorConfigGrid::setColorModel().

◆ slotSetSelectorConfiguration

void WGColorSelectorSettings::slotSetSelectorConfiguration ( const KisColorSelectorConfiguration & cfg)
privateslot

Definition at line 223 of file WGColorSelectorSettings.cpp.

224{
225 Q_UNUSED(cfg);
226 m_ui->btnSelectorShape->setIcon(m_selectorConfigGrid->currentIcon());
227}

References WGSelectorConfigGrid::currentIcon(), m_selectorConfigGrid, and m_ui.

◆ slotSetShadeLineCount

void WGColorSelectorSettings::slotSetShadeLineCount ( int count)
privateslot

Definition at line 256 of file WGColorSelectorSettings.cpp.

257{
258 if (m_shadeLineConfig.size() < count) {
259 m_shadeLineConfig.resize(count);
260 }
261 while (m_shadeLineButtons.size() < count) {
262 QToolButton *lineButton = new QToolButton(this);
263 lineButton->setIconSize(QSize(128, 10));
264 // TODO: update icon
265 lineButton->setIcon(m_shadeLineEditor->generateIcon(m_shadeLineConfig.at(m_shadeLineButtons.size())));
266 m_shadeLineGroup->addButton(lineButton, m_shadeLineButtons.size());
267 m_shadeLineButtons.append(lineButton);
268 m_ui->shadeLineLayout->addWidget(lineButton);
269 }
270 while (m_shadeLineButtons.size() > count)
271 {
272 m_ui->shadeLineLayout->removeWidget(m_shadeLineButtons.last());
273 delete m_shadeLineButtons.last();
274 m_shadeLineButtons.removeLast();
275 }
276}

References WGShadeLineEditor::generateIcon(), m_shadeLineButtons, m_shadeLineConfig, m_shadeLineEditor, m_shadeLineGroup, and m_ui.

◆ slotShowLineEditor

void WGColorSelectorSettings::slotShowLineEditor ( int lineNum)
privateslot

Definition at line 278 of file WGColorSelectorSettings.cpp.

279{
280 KIS_SAFE_ASSERT_RECOVER_RETURN(lineNum >= 0 && lineNum < m_shadeLineConfig.size());
281
283 m_shadeLineEditor->show();
284
285 QWidget *btn = m_shadeLineButtons.at(lineNum);
286 QRect fitRect = kisGrowRect(btn->screen()->availableGeometry(), -10);
287 QRect popupRect = m_shadeLineEditor->rect();
288 popupRect.moveTo(btn->mapToGlobal(QPoint()));
289 popupRect = kisEnsureInRect(popupRect, fitRect);
290 m_shadeLineEditor->move(popupRect.topLeft());
291}
void setConfiguration(const WGConfig::ShadeLine &cfg, int lineIndex)
T kisGrowRect(const T &rect, U offset)
Definition kis_global.h:186
QRect kisEnsureInRect(QRect rc, const QRect &bounds)
Definition kis_global.h:267

References KIS_SAFE_ASSERT_RECOVER_RETURN, kisEnsureInRect(), kisGrowRect(), m_shadeLineButtons, m_shadeLineConfig, m_shadeLineEditor, and WGShadeLineEditor::setConfiguration().

◆ stringID()

QString WGColorSelectorSettings::stringID ( )
static

Definition at line 78 of file WGColorSelectorSettings.cpp.

79{
80 return QString("WideGamutColorSelector");
81}

Member Data Documentation

◆ m_favoriteConfigGrid

WGSelectorConfigGrid* WGColorSelectorSettings::m_favoriteConfigGrid
private

Definition at line 56 of file WGColorSelectorSettings.h.

◆ m_selectorConfigGrid

WGSelectorConfigGrid* WGColorSelectorSettings::m_selectorConfigGrid
private

Definition at line 55 of file WGColorSelectorSettings.h.

◆ m_shadeLineButtons

QVector<QToolButton*> WGColorSelectorSettings::m_shadeLineButtons
private

Definition at line 60 of file WGColorSelectorSettings.h.

◆ m_shadeLineConfig

QVector<WGConfig::ShadeLine> WGColorSelectorSettings::m_shadeLineConfig
private

Definition at line 59 of file WGColorSelectorSettings.h.

◆ m_shadeLineEditor

WGShadeLineEditor* WGColorSelectorSettings::m_shadeLineEditor
private

Definition at line 57 of file WGColorSelectorSettings.h.

◆ m_shadeLineGroup

QButtonGroup* WGColorSelectorSettings::m_shadeLineGroup
private

Definition at line 58 of file WGColorSelectorSettings.h.

◆ m_ui

QScopedPointer<Ui::WGConfigWidget> WGColorSelectorSettings::m_ui
private

Definition at line 54 of file WGColorSelectorSettings.h.


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