diff options
-rw-r--r-- | tagit/dialogues/__init__.py | 9 | ||||
-rw-r--r-- | tagit/dialogues/message.py | 47 |
2 files changed, 49 insertions, 7 deletions
diff --git a/tagit/dialogues/__init__.py b/tagit/dialogues/__init__.py index f63ec87..a467699 100644 --- a/tagit/dialogues/__init__.py +++ b/tagit/dialogues/__init__.py @@ -17,20 +17,17 @@ Author: Matthias Baumgartner, 2022 import typing # inner-module imports -##from .spash import Splash from .autoinput import AutoTextInput from .console import Console #from .dir_creator import DirCreator #from .dir_picker import DirPicker from .error import Error -#from .export import Export #from .file_creator import FileCreator #from .file_picker import FilePicker -#from .message import Message +from .message import Message from .numeric_input import NumericInput #from .path_creator import PathCreator #from .path_picker import PathPicker -#from .progress import Progress #from .project import Project from .simple_input import SimpleInput from .stoken import TokenEdit @@ -42,14 +39,12 @@ __all__: typing.Sequence[str] = ( #'DirCreator', #'DirPicker', 'Error', - #'Export', #'FileCreator', #'FilePicker', - #'Message', + 'Message', 'NumericInput', #'PathCreator', #'PathPicker', - #'Progress', #'Project', 'SimpleInput', 'TokenEdit', diff --git a/tagit/dialogues/message.py b/tagit/dialogues/message.py new file mode 100644 index 0000000..ab67180 --- /dev/null +++ b/tagit/dialogues/message.py @@ -0,0 +1,47 @@ +"""Dialogue to show some message. + +Part of the tagit module. +A copy of the license is provided with the project. +Author: Matthias Baumgartner, 2022 +""" +# kivy imports +from kivy.lang import Builder +import kivy.properties as kp + +# inner-module imports +from .dialogue import Dialogue + +# exports +__all__ = ('Message', ) + + +## code ## + +# load kv +Builder.load_string(''' +<Message>: + text: '' + align: 'center' + textcolor: 1,1,1,1 + + DialogueContentNoTitle: + Label: + text: root.text + size_hint_y: None + color: root.textcolor + height: self.texture_size[1] + dp(16) + text_size: self.width - dp(16), None + halign: root.align + markup: True + + DialogueButtons_One: +''') + +# classes +class Message(Dialogue): + """Dialogue to show a text message.""" + text = kp.StringProperty() + align = kp.StringProperty() + textcolor: kp.ListProperty() + +## EOF ## |