26 self.setWindowTitle(i18nc(
"@title:window",
"Workflow Buttons"))
32 mainWidget = QWidget(self)
33 self.setWidget(mainWidget)
34 mainLayout = QVBoxLayout(mainWidget)
35 mainLayout.setSpacing(2)
36 mainLayout.setContentsMargins(0, 0, 0, 0)
38 buttonsScrollArea = QScrollArea(mainWidget)
41 buttonsScrollArea.setWidgetResizable(
True)
44 mainLayout.addWidget(buttonsScrollArea)
55 barSpacer = QWidget(mainWidget)
56 barSpacer.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Ignored)
65 self.
settingsAction.setToolTip(i18n(
"Open workflow buttons settings dialog"))
86 savedSize = Application.readSetting(
"workflowbuttons",
"buttonsSize",
"")
88 self.sizeIndex = int(savedSize)
89 self.refreshButtonsSize()
90 savedList = Application.readSetting(
"workflowbuttons",
"buttons",
"")
92 self.buttonsContentList = ast.literal_eval(savedList)
93 savedSettingsButtonPosition = Application.readSetting(
"workflowbuttons",
"settingsButtonPosition",
"")
94 if savedSettingsButtonPosition:
95 self.settingsButtonPosition = int(savedSettingsButtonPosition)
117 allBrushPresets = INSTANCE.resources(
'preset')
120 if buttonToCreate[
"iconMode"] == 0:
121 buttonIcon = QIcon(buttonToCreate[
"icon"])
122 elif buttonToCreate[
"iconMode"] == 1
and buttonToCreate[
"toolIndex"] != 0:
123 buttonIcon = INSTANCE.icon(LISTOFTOOLS[buttonToCreate[
"toolIndex"]][
"toolIcon"])
124 elif buttonToCreate[
"iconMode"] == 2
and buttonToCreate[
"presetName"] !=
"":
125 brushPreset = allBrushPresets[buttonToCreate[
"presetName"]]
126 buttonIcon = QIcon(QPixmap.fromImage(brushPreset.image()))
131 button.setIcon(buttonIcon)