Krita Source Code Documentation
Loading...
Searching...
No Matches
KisToolUtils::ColorSamplerConfig Struct Reference

#include <kis_tool_utils.h>

Public Member Functions

 ColorSamplerConfig ()
 
void load ()
 
void save () const
 

Public Attributes

bool addColorToCurrentPalette
 
int blend
 
bool normaliseValues
 
int radius
 
bool sampleMerged
 
bool toForegroundColor
 
bool updateColor
 

Static Private Attributes

static const QString CONFIG_GROUP_NAME = "tool_color_sampler"
 

Detailed Description

Definition at line 21 of file kis_tool_utils.h.

Constructor & Destructor Documentation

◆ ColorSamplerConfig()

KisToolUtils::ColorSamplerConfig::ColorSamplerConfig ( )

Member Function Documentation

◆ load()

void KisToolUtils::ColorSamplerConfig::load ( )

Definition at line 291 of file kis_tool_utils.cpp.

292 {
294
295 KConfigGroup config = KSharedConfig::openConfig()->group(CONFIG_GROUP_NAME);
296 props.fromXML(config.readEntry("ColorSamplerDefaultActivation"));
297
298 toForegroundColor = props.getBool("toForegroundColor", true);
299 updateColor = props.getBool("updateColor", true);
300 addColorToCurrentPalette = props.getBool("addPalette", false);
301 normaliseValues = props.getBool("normaliseValues", false);
302 sampleMerged = props.getBool("sampleMerged", true);
303 radius = props.getInt("radius", 1);
304 blend = props.getInt("blend", 100);
305 }
bool fromXML(const QString &xml, bool clear=true) override
bool getBool(const QString &name, bool def=false) const
int getInt(const QString &name, int def=0) const
static const QString CONFIG_GROUP_NAME

References addColorToCurrentPalette, blend, CONFIG_GROUP_NAME, KisPropertiesConfiguration::fromXML(), KisPropertiesConfiguration::getBool(), KisPropertiesConfiguration::getInt(), normaliseValues, radius, sampleMerged, toForegroundColor, and updateColor.

◆ save()

void KisToolUtils::ColorSamplerConfig::save ( ) const

Definition at line 275 of file kis_tool_utils.cpp.

276 {
278 props.setProperty("toForegroundColor", toForegroundColor);
279 props.setProperty("updateColor", updateColor);
280 props.setProperty("addPalette", addColorToCurrentPalette);
281 props.setProperty("normaliseValues", normaliseValues);
282 props.setProperty("sampleMerged", sampleMerged);
283 props.setProperty("radius", radius);
284 props.setProperty("blend", blend);
285
286 KConfigGroup config = KSharedConfig::openConfig()->group(CONFIG_GROUP_NAME);
287
288 config.writeEntry("ColorSamplerDefaultActivation", props.toXML());
289 }
void toXML(QDomDocument &, QDomElement &) const override
virtual void setProperty(const QString &name, const QVariant &value)

References addColorToCurrentPalette, blend, CONFIG_GROUP_NAME, normaliseValues, radius, sampleMerged, KisPropertiesConfiguration::setProperty(), toForegroundColor, KisPropertiesConfiguration::toXML(), and updateColor.

Member Data Documentation

◆ addColorToCurrentPalette

bool KisToolUtils::ColorSamplerConfig::addColorToCurrentPalette

Definition at line 26 of file kis_tool_utils.h.

◆ blend

int KisToolUtils::ColorSamplerConfig::blend

Definition at line 30 of file kis_tool_utils.h.

◆ CONFIG_GROUP_NAME

const QString KisToolUtils::ColorSamplerConfig::CONFIG_GROUP_NAME = "tool_color_sampler"
staticprivate

Definition at line 35 of file kis_tool_utils.h.

◆ normaliseValues

bool KisToolUtils::ColorSamplerConfig::normaliseValues

Definition at line 27 of file kis_tool_utils.h.

◆ radius

int KisToolUtils::ColorSamplerConfig::radius

Definition at line 29 of file kis_tool_utils.h.

◆ sampleMerged

bool KisToolUtils::ColorSamplerConfig::sampleMerged

Definition at line 28 of file kis_tool_utils.h.

◆ toForegroundColor

bool KisToolUtils::ColorSamplerConfig::toForegroundColor

Definition at line 24 of file kis_tool_utils.h.

◆ updateColor

bool KisToolUtils::ColorSamplerConfig::updateColor

Definition at line 25 of file kis_tool_utils.h.


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