12#include <ksharedconfig.h>
13#include <kconfiggroup.h>
46 using ST =
typename std::conditional_t<std::is_enum<T>::value, std::underlying_type<T>, std::remove_cv<T>>::type;
59 T
boundFunc(
const T &min,
const T &val,
const T &max)
const
61 return qBound(min, val, max);
80 return val.expandedTo(min).boundedTo(max);
85 explicit ShadeLine(QVector4D grad, QVector4D offs=QVector4D(),
int patchC=-1)
96 explicit WGConfig(
bool readOnly =
true);
100 typename T::ValueType
get(
const T &setting,
bool defaultValue =
false)
const
103 return setting.defaultValue;
105 return setting.readValue(m_cfg);
109 void set(
const T &setting,
const typename T::ValueType &
value) { setting.writeValue(m_cfg,
value); }
111 static QString configGroupName();
125 const KoColorSpace* customSelectionColorSpace(
bool defaultValue =
false)
const;
126 void setCustomSelectionColorSpace(
const KoColorSpace *cs);
130 m_cfg.writeEntry(name,
value);
134 T
readEntry(
const QString& name,
const T& defaultValue=T()) {
135 return m_cfg.readEntry(name, defaultValue);
float value(const T *src, size_t ch)
WGConfigNotifier(const WGConfigNotifier &)=delete
void notifyConfigChanged()
void selectorConfigChanged()
WGConfigNotifier operator=(const WGConfigNotifier &)=delete
~WGConfigNotifier() override=default
WGConfigNotifier()=default
void notifySelectorConfigChanged()
static const KisColorSelectorConfiguration defaultColorSelectorConfiguration
void set(const T &setting, const typename T::ValueType &value)
void writeEntry(const QString &name, const T &value)
T::ValueType get(const T &setting, bool defaultValue=false) const
T readEntry(const QString &name, const T &defaultValue=T())
const GenericSetting< bool > colorHistoryEnabled
const ColorPatches commonColors
const GenericSetting< bool > minimalShadeSelectorEnabled
const GenericSetting< bool > commonColorsEnabled
const ColorPatches popupPatches
WGConfigNotifier * notifier()
const GenericSetting< bool > colorHistoryShowClearButton
const NumericSetting< int > shadeSelectorLineHeight
const GenericSetting< bool > proofToPaintingColors
const NumericSetting< int > popupSize
const GenericSetting< bool > shadeSelectorUpdateOnExternalChanges
const GenericSetting< bool > quickSettingsEnabled
const GenericSetting< bool > commonColorsAutoUpdate
const GenericSetting< bool > shadeSelectorUpdateOnInteractionEnd
const ColorPatches colorHistory
const GenericSetting< bool > shadeSelectorUpdateOnRightClick
NumericSetting< Scrolling > scrolling
NumericSetting< Qt::Orientation > orientation
NumericSetting< int > rows
NumericSetting< int > maxCount
NumericSetting< QSize > patchSize
T readValue(const KConfigGroup &group) const
void writeValue(KConfigGroup &group, const T &value) const
T readValue(const KConfigGroup &group) const
T boundFunc(const T &min, const T &val, const T &max) const
typename std::conditional_t< std::is_enum< T >::value, std::underlying_type< T >, std::remove_cv< T > >::type ST
T applyLimits(T value) const
void writeValue(KConfigGroup &group, const T &value) const
ShadeLine(QVector4D grad, QVector4D offs=QVector4D(), int patchC=-1)