Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
TenBrushes: Add an option to disable on-canvas messages
Joshua Goinsf4c93dbb16fa
diff --git a/plugins/python/tenbrushes/tenbrushes.py b/plugins/python/tenbrushes/tenbrushes.pyindex 05b48677e1..d0abc65126 100644--- a/plugins/python/tenbrushes/tenbrushes.py+++ b/plugins/python/tenbrushes/tenbrushes.py@@ -22,6 +22,8 @@ class TenBrushesExtension(krita.Extension):# Indicates whether we want to select the freehand brush tool# on the press of a preset shortcutself.autoBrush = False+ # Indicates whether to show an on-canvas message when changing preset+ self.showMessage = Trueself.oldPreset = Nonedef setup(self):@@ -61,6 +63,10 @@ class TenBrushesExtension(krita.Extension):"", "tenbrushesAutoBrushOnPress", "False")self.autoBrush = setting == 'True'+ setting = Application.readSetting(+ "", "tenbrushesShowMessage", "True")+ self.showMessage = setting == 'True'+def writeSettings(self):presets = []@@ -73,6 +79,8 @@ class TenBrushesExtension(krita.Extension):str(self.activatePrev))Application.writeSetting("", "tenbrushesAutoBrushOnPress",str(self.autoBrush))+ Application.writeSetting("", "tenbrushesShowMessage",+ str(self.showMessage))def loadActions(self, window):allPresets = Application.resources("preset")@@ -108,7 +116,9 @@ class TenBrushesExtension(krita.Extension):window.views()[0].activateResource(allPresets[preset])preset = window.views()[0].currentBrushPreset()- window.activeView().showFloatingMessage(str(i18n("{}\nselected")).format(preset.name()),- QIcon(QPixmap.fromImage(preset.image())),- 1000, 1)++ if self.showMessage:+ window.activeView().showFloatingMessage(str(i18n("{}\nselected")).format(preset.name()),+ QIcon(QPixmap.fromImage(preset.image())),+ 1000, 1)diff --git a/plugins/python/tenbrushes/uitenbrushes.py b/plugins/python/tenbrushes/uitenbrushes.pyindex 219ae72332..09e781f944 100644--- a/plugins/python/tenbrushes/uitenbrushes.py+++ b/plugins/python/tenbrushes/uitenbrushes.py@@ -34,6 +34,10 @@ class UITenBrushes(object):i18n("&Select freehand brush tool when pressing a shortcut"),self.mainDialog)+ self.checkBoxShowMessage = QCheckBox(+ i18n("Show on-canvas &popup message when activating brush preset"),+ self.mainDialog)+self.buttonBox.accepted.connect(self.mainDialog.accept)self.buttonBox.rejected.connect(self.mainDialog.reject)@@ -66,6 +70,10 @@ class UITenBrushes(object):self.checkBoxAutoBrush.toggled.connect(self.setAutoBrush)self.vbox.addWidget(self.checkBoxAutoBrush)+ self.checkBoxShowMessage.setChecked(self.tenbrushes.showMessage)+ self.checkBoxShowMessage.toggled.connect(self.setShowMessage)+ self.vbox.addWidget(self.checkBoxShowMessage)+self.vbox.addWidget(self.buttonBox)self.mainDialog.show()@@ -78,6 +86,9 @@ class UITenBrushes(object):def setAutoBrush(self, checked):self.tenbrushes.autoBrush = checked+ def setShowMessage(self, checked):+ self.tenbrushes.showMessage = checked+def loadButtons(self):self.tenbrushes.buttons = []