Krita Source Code Documentation
Loading...
Searching...
No Matches
workflow_buttons.workflow_buttons.CustomButton Class Reference
+ Inheritance diagram for workflow_buttons.workflow_buttons.CustomButton:

Public Member Functions

 __init__ (self, parent=None, buttonID=-1, values={})
 
 triggeredFunction (self)
 

Public Attributes

 buttonID
 
 triggeredFunction
 
 values
 

Detailed Description

Definition at line 152 of file workflow_buttons.py.

Constructor & Destructor Documentation

◆ __init__()

workflow_buttons.workflow_buttons.CustomButton.__init__ ( self,
parent = None,
buttonID = -1,
values = {} )

Definition at line 154 of file workflow_buttons.py.

154 def __init__(self, parent=None, buttonID=-1, values={}):
155 super().__init__(parent)
156 self.buttonID = buttonID
157 self.values = values
158 self.clicked.connect(self.triggeredFunction)
159 if self.values["tooltip"]:
160 self.setToolTip(values["tooltip"])
161
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))

References workflow_buttons.workflow_buttons.CustomButton.__init__().

Member Function Documentation

◆ triggeredFunction()

workflow_buttons.workflow_buttons.CustomButton.triggeredFunction ( self)

Definition at line 162 of file workflow_buttons.py.

162 def triggeredFunction(self):
163 currentView = INSTANCE.activeWindow().activeView()
164 # select given tool
165 if self.values["toolIndex"] != "":
166 toolIndex = int(self.values["toolIndex"])
167 if(toolIndex > 0 and toolIndex < len(LISTOFTOOLS)):
168 INSTANCE.action(LISTOFTOOLS[int(self.values["toolIndex"])]["toolName"]).trigger()
169
170 # get list of all presets
171 if self.values["presetName"] != "":
172 allBrushPresets = INSTANCE.resources('preset')
173 # find given preset by name
174 brushPreset = allBrushPresets[self.values["presetName"]]
175 # select the brush preset
176 currentView.setCurrentBrushPreset(brushPreset)
177
178 # set given FGColor
179 if self.values["FGColorValues"]["model"] != "":
180 colorToSelect = ManagedColor(self.values["FGColorValues"]["model"],
181 self.values["FGColorValues"]["depth"],
182 self.values["FGColorValues"]["profile"])
183 colorComponents = self.values["FGColorValues"]["components"]
184 colorToSelect.setComponents(colorComponents)
185 currentView.setForeGroundColor(colorToSelect)
186
187 # set given BGColor
188 if self.values["BGColorValues"]["model"] != "":
189 colorToSelect = ManagedColor(self.values["BGColorValues"]["model"],
190 self.values["BGColorValues"]["depth"],
191 self.values["BGColorValues"]["profile"])
192 colorComponents = self.values["BGColorValues"]["components"]
193 colorToSelect.setComponents(colorComponents)
194 currentView.setBackGroundColor(colorToSelect)
195
196 # run extra script
197 if self.values["script"] != "":
198 scriptPath = self.values["script"]
199 exec(open(scriptPath).read())
200
201
The ManagedColor class is a class to handle colors that are color managed. A managed color is a color...

References KoRTree< T >.values(), KoRTree< KoShape * >.values(), KoGenericRegistry< const KisMetaData::Filter * >.values(), KoGenericRegistry< KoColorTransformationFactory * >.values(), KoGenericRegistry< KisExportCheckFactory * >.values(), KoGenericRegistry< KisResourceLoaderBase * >.values(), KoGenericRegistry< KisFilterSP >.values(), KoGenericRegistry< KisGeneratorSP >.values(), KoGenericRegistry< KisFilterStrategy * >.values(), KoGenericRegistry< KisOperation * >.values(), KoGenericRegistry< KoShapeFactoryBase * >.values(), KoGenericRegistry< KisPaintOpFactory * >.values(), KoGenericRegistry< KisMetaData::IOBackend * >.values(), KoGenericRegistry< const Filter * >.values(), KoGenericRegistry< KisPaintingAssistantFactory * >.values(), KoGenericRegistry< KoHistogramProducerFactory * >.values(), KoGenericRegistry< KisAbstractPreferenceSetFactory * >.values(), KoGenericRegistry< KoColorSpaceEngine * >.values(), KoGenericRegistry< KisOperationUIFactory * >.values(), KoGenericRegistry< KisDynamicSensorFactory * >.values(), KoGenericRegistry< KisBrushFactory * >.values(), KoGenericRegistry< KoColorSpaceFactory * >.values(), KoGenericRegistry< T >.values(), KoGenericRegistry< const KisMetaData::MergeStrategy * >.values(), KoGenericRegistry< KoToolFactoryBase * >.values(), KoGenericRegistry< KoFilterEffectFactoryBase * >.values(), KoGenericRegistry< KoDockFactoryBase * >.values(), KoRTree< KoShape * >::NonLeafNode.values(), KoRTree< KoShape * >::LeafNode.values(), KoRTree< KoShape * >::Node.values(), KoRTree< T >::Node.values(), KoRTree< T >::NonLeafNode.values(), KoRTree< T >::LeafNode.values(), KisToolBar::Private::IntSetting.values, and workflow_buttons.workflow_buttons.CustomButton.values.

Member Data Documentation

◆ buttonID

workflow_buttons.workflow_buttons.CustomButton.buttonID

Definition at line 156 of file workflow_buttons.py.

◆ triggeredFunction

workflow_buttons.workflow_buttons.CustomButton.triggeredFunction

Definition at line 158 of file workflow_buttons.py.

◆ values

workflow_buttons.workflow_buttons.CustomButton.values

Definition at line 157 of file workflow_buttons.py.


The documentation for this class was generated from the following file: