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)
57 self.
bottomBar.setStyleSheet(
"QToolBar{spacing:0px; margin:0px;}")
59 barSpacer.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
65 self.
settingsAction.setToolTip(i18n(
"Open workflow buttons settings dialog"))
84 savedSize = Application.readSetting(
"workflowbuttons",
"buttonsSize",
"")
86 self.sizeIndex = int(savedSize)
87 self.refreshButtonsSize()
88 savedList = Application.readSetting(
"workflowbuttons",
"buttons",
"")
90 self.buttonsContentList = ast.literal_eval(savedList)
91 savedSettingsButtonPosition = Application.readSetting(
"workflowbuttons",
"settingsButtonPosition",
"")
92 if savedSettingsButtonPosition:
93 self.settingsButtonPosition = int(savedSettingsButtonPosition)
115 allBrushPresets = INSTANCE.resources(
'preset')
118 if buttonToCreate[
"iconMode"] == 0:
119 buttonIcon = QIcon(buttonToCreate[
"icon"])
120 elif buttonToCreate[
"iconMode"] == 1
and buttonToCreate[
"toolIndex"] != 0:
121 buttonIcon = INSTANCE.icon(LISTOFTOOLS[buttonToCreate[
"toolIndex"]][
"toolIcon"])
122 elif buttonToCreate[
"iconMode"] == 2
and buttonToCreate[
"presetName"] !=
"":
123 brushPreset = allBrushPresets[buttonToCreate[
"presetName"]]
124 buttonIcon = QIcon(QPixmap.fromImage(brushPreset.image()))
129 button.setIcon(buttonIcon)