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 23 of file kis_tool_utils.h.

Constructor & Destructor Documentation

◆ ColorSamplerConfig()

KisToolUtils::ColorSamplerConfig::ColorSamplerConfig ( )

Member Function Documentation

◆ load()

void KisToolUtils::ColorSamplerConfig::load ( )

Definition at line 294 of file kis_tool_utils.cpp.

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

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

◆ blend

int KisToolUtils::ColorSamplerConfig::blend

Definition at line 32 of file kis_tool_utils.h.

◆ CONFIG_GROUP_NAME

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

Definition at line 37 of file kis_tool_utils.h.

◆ normaliseValues

bool KisToolUtils::ColorSamplerConfig::normaliseValues

Definition at line 29 of file kis_tool_utils.h.

◆ radius

int KisToolUtils::ColorSamplerConfig::radius

Definition at line 31 of file kis_tool_utils.h.

◆ sampleMerged

bool KisToolUtils::ColorSamplerConfig::sampleMerged

Definition at line 30 of file kis_tool_utils.h.

◆ toForegroundColor

bool KisToolUtils::ColorSamplerConfig::toForegroundColor

Definition at line 26 of file kis_tool_utils.h.

◆ updateColor

bool KisToolUtils::ColorSamplerConfig::updateColor

Definition at line 27 of file kis_tool_utils.h.


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