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 154 of file workflow_buttons.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 156 of file workflow_buttons.py.

156 def __init__(self, parent=None, buttonID=-1, values={}):
157 super().__init__(parent)
158 self.buttonID = buttonID
159 self.values = values
160 self.clicked.connect(self.triggeredFunction)
161 if self.values["tooltip"]:
162 self.setToolTip(values["tooltip"])
163

References workflow_buttons.workflow_buttons.CustomButton.__init__().

Member Function Documentation

◆ triggeredFunction()

workflow_buttons.workflow_buttons.CustomButton.triggeredFunction ( self)

Definition at line 164 of file workflow_buttons.py.

164 def triggeredFunction(self):
165 currentView = INSTANCE.activeWindow().activeView()
166 # select given tool
167 if self.values["toolIndex"] != "":
168 toolIndex = int(self.values["toolIndex"])
169 if(toolIndex > 0 and toolIndex < len(LISTOFTOOLS)):
170 INSTANCE.action(LISTOFTOOLS[int(self.values["toolIndex"])]["toolName"]).trigger()
171
172 # get list of all presets
173 if self.values["presetName"] != "":
174 allBrushPresets = INSTANCE.resources('preset')
175 # find given preset by name
176 brushPreset = allBrushPresets[self.values["presetName"]]
177 # select the brush preset
178 currentView.setCurrentBrushPreset(brushPreset)
179
180 # set given FGColor
181 if self.values["FGColorValues"]["model"] != "":
182 colorToSelect = ManagedColor(self.values["FGColorValues"]["model"],
183 self.values["FGColorValues"]["depth"],
184 self.values["FGColorValues"]["profile"])
185 colorComponents = self.values["FGColorValues"]["components"]
186 colorToSelect.setComponents(colorComponents)
187 currentView.setForeGroundColor(colorToSelect)
188
189 # set given BGColor
190 if self.values["BGColorValues"]["model"] != "":
191 colorToSelect = ManagedColor(self.values["BGColorValues"]["model"],
192 self.values["BGColorValues"]["depth"],
193 self.values["BGColorValues"]["profile"])
194 colorComponents = self.values["BGColorValues"]["components"]
195 colorToSelect.setComponents(colorComponents)
196 currentView.setBackGroundColor(colorToSelect)
197
198 # run extra script
199 if self.values["script"] != "":
200 scriptPath = self.values["script"]
201 exec(open(scriptPath).read())
202
203
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< KisOperationUIFactory * >.values(), KoGenericRegistry< KisExportCheckFactory * >.values(), KoGenericRegistry< KisResourceLoaderBase * >.values(), KoGenericRegistry< KisFilterSP >.values(), KoGenericRegistry< KisGeneratorSP >.values(), KoGenericRegistry< KisFilterStrategy * >.values(), KoGenericRegistry< KisOperation * >.values(), KoGenericRegistry< KoColorTransformationFactory * >.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< KoShapeFactoryBase * >.values(), KoGenericRegistry< KisDynamicSensorFactory * >.values(), KoGenericRegistry< KisBrushFactory * >.values(), KoGenericRegistry< KoColorSpaceFactory * >.values(), KoGenericRegistry< T >.values(), KoGenericRegistry< const KisMetaData::MergeStrategy * >.values(), KoGenericRegistry< KoToolFactoryBase * >.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 158 of file workflow_buttons.py.

◆ triggeredFunction

workflow_buttons.workflow_buttons.CustomButton.triggeredFunction

Definition at line 160 of file workflow_buttons.py.

◆ values

workflow_buttons.workflow_buttons.CustomButton.values

Definition at line 159 of file workflow_buttons.py.


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