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

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

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