Browse Source

added About

pull/244/head
Eugenio Parodi 2 years ago
parent
commit
f6ec664b51
  1. 3
      tools/dumb_paint_lib/__init__.py
  2. 33
      tools/dumb_paint_lib/about.py
  3. 10
      tools/dumb_paint_lib/maintemplate.py

3
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 *
from .canvaslayer import *
from .about import *

33
tools/dumb_paint_lib/about.py

@ -0,0 +1,33 @@
# MIT License
#
# Copyright (c) 2024 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com>
#
# 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)

10
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)

Loading…
Cancel
Save