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 292 of file kis_tool_utils.cpp.

293 {
295
296 KConfigGroup config = KSharedConfig::openConfig()->group(CONFIG_GROUP_NAME);
297 props.fromXML(config.readEntry("ColorSamplerDefaultActivation"));
298
299 toForegroundColor = props.getBool("toForegroundColor", true);
300 updateColor = props.getBool("updateColor", true);
301 addColorToCurrentPalette = props.getBool("addPalette", false);
302 normaliseValues = props.getBool("normaliseValues", false);
303 sampleMerged = props.getBool("sampleMerged", true);
304 radius = props.getInt("radius", 1);
305 blend = props.getInt("blend", 100);
306 }
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 276 of file kis_tool_utils.cpp.

277 {
279 props.setProperty("toForegroundColor", toForegroundColor);
280 props.setProperty("updateColor", updateColor);
281 props.setProperty("addPalette", addColorToCurrentPalette);
282 props.setProperty("normaliseValues", normaliseValues);
283 props.setProperty("sampleMerged", sampleMerged);
284 props.setProperty("radius", radius);
285 props.setProperty("blend", blend);
286
287 KConfigGroup config = KSharedConfig::openConfig()->group(CONFIG_GROUP_NAME);
288
289 config.writeEntry("ColorSamplerDefaultActivation", props.toXML());
290 }
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: