diff --git a/tools/dumb_paint_lib/__init__.py b/tools/dumb_paint_lib/__init__.py index ce1faa75..225f73b1 100644 --- a/tools/dumb_paint_lib/__init__.py +++ b/tools/dumb_paint_lib/__init__.py @@ -4,4 +4,5 @@ from .painttoolkit import * from .textarea import * from .palette import * from .layers import * -from .canvaslayer import * \ No newline at end of file +from .canvaslayer import * +from .about import * \ No newline at end of file diff --git a/tools/dumb_paint_lib/about.py b/tools/dumb_paint_lib/about.py new file mode 100644 index 00000000..349aec3a --- /dev/null +++ b/tools/dumb_paint_lib/about.py @@ -0,0 +1,33 @@ +# MIT License +# +# Copyright (c) 2024 Eugenio Parodi +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +__all__ = ['About'] + +from TermTk.TTkCore.log import TTkLog +from TermTk.TTkCore.color import TTkColor +from TermTk.TTkCore.string import TTkString +from TermTk import TTkAbout, TTkWindow +# from .cfg import TTkDesignerCfg + +class About(TTkAbout): + def paintEvent(self, canvas): + super().paintEvent(canvas) diff --git a/tools/dumb_paint_lib/maintemplate.py b/tools/dumb_paint_lib/maintemplate.py index ea2c4a35..17d06128 100644 --- a/tools/dumb_paint_lib/maintemplate.py +++ b/tools/dumb_paint_lib/maintemplate.py @@ -33,6 +33,7 @@ from .painttoolkit import PaintToolKit from .palette import Palette from .textarea import TextArea from .layers import Layers,LayerData +from .about import About class LeftPanel(ttk.TTkVBoxLayout): __slots__ = ('_palette', @@ -287,9 +288,14 @@ class PaintTemplate(ttk.TTkAppTemplate): # extraMenu.addMenu("Scratchpad").menuButtonClicked.connect(self.scratchpad) # extraMenu.addSpacer() + def _showAbout(btn): + ttk.TTkHelper.overlay(None, About(), 30,10) + def _showAboutTTk(btn): + ttk.TTkHelper.overlay(None, ttk.TTkAbout(), 30,10) + helpMenu = appMenuBar.addMenu("&Help", alignment=ttk.TTkK.RIGHT_ALIGN) - helpMenu.addMenu("About ...").menuButtonClicked - helpMenu.addMenu("About tlogg").menuButtonClicked + helpMenu.addMenu("About ...").menuButtonClicked.connect(_showAboutTTk) + helpMenu.addMenu("About DPT").menuButtonClicked.connect(_showAbout) palette.colorSelected.connect(self._parea.setGlyphColor) palette.colorSelected.connect(ptoolkit.setColor)