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
 
ColorSamplerSource sampleSource
 
bool toForegroundColor
 
bool updateColor
 

Static Private Attributes

static const QString CONFIG_GROUP_NAME = "tool_color_sampler"
 

Detailed Description

Definition at line 27 of file kis_tool_utils.h.

Constructor & Destructor Documentation

◆ ColorSamplerConfig()

KisToolUtils::ColorSamplerConfig::ColorSamplerConfig ( )

Member Function Documentation

◆ load()

void KisToolUtils::ColorSamplerConfig::load ( )

Definition at line 296 of file kis_tool_utils.cpp.

297 {
299
300 KConfigGroup config = KSharedConfig::openConfig()->group(CONFIG_GROUP_NAME);
301 props.fromXML(config.readEntry("ColorSamplerDefaultActivation"));
302
303 toForegroundColor = props.getBool("toForegroundColor", true);
304 updateColor = props.getBool("updateColor", true);
305 addColorToCurrentPalette = props.getBool("addPalette", false);
306 normaliseValues = props.getBool("normaliseValues", false);
307 sampleSource = static_cast<ColorSamplerSource>(props.getInt("sampleSource", static_cast<int>(SampleSourceImage)));
308 radius = props.getInt("radius", 1);
309 blend = props.getInt("blend", 100);
310 }
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, sampleSource, KisToolUtils::SampleSourceImage, toForegroundColor, and updateColor.

◆ save()

void KisToolUtils::ColorSamplerConfig::save ( ) const

Definition at line 280 of file kis_tool_utils.cpp.

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

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

Member Data Documentation

◆ addColorToCurrentPalette

bool KisToolUtils::ColorSamplerConfig::addColorToCurrentPalette

Definition at line 32 of file kis_tool_utils.h.

◆ blend

int KisToolUtils::ColorSamplerConfig::blend

Definition at line 36 of file kis_tool_utils.h.

◆ CONFIG_GROUP_NAME

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

Definition at line 41 of file kis_tool_utils.h.

◆ normaliseValues

bool KisToolUtils::ColorSamplerConfig::normaliseValues

Definition at line 33 of file kis_tool_utils.h.

◆ radius

int KisToolUtils::ColorSamplerConfig::radius

Definition at line 35 of file kis_tool_utils.h.

◆ sampleSource

ColorSamplerSource KisToolUtils::ColorSamplerConfig::sampleSource

Definition at line 34 of file kis_tool_utils.h.

◆ toForegroundColor

bool KisToolUtils::ColorSamplerConfig::toForegroundColor

Definition at line 30 of file kis_tool_utils.h.

◆ updateColor

bool KisToolUtils::ColorSamplerConfig::updateColor

Definition at line 31 of file kis_tool_utils.h.


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