diff options
Diffstat (limited to 'tagit/apps')
-rw-r--r-- | tagit/apps/__init__.py | 10 | ||||
-rw-r--r-- | tagit/apps/desktop.py | 55 |
2 files changed, 65 insertions, 0 deletions
diff --git a/tagit/apps/__init__.py b/tagit/apps/__init__.py new file mode 100644 index 0000000..4c64128 --- /dev/null +++ b/tagit/apps/__init__.py @@ -0,0 +1,10 @@ +""" + +Part of the tagit module. +A copy of the license is provided with the project. +Author: Matthias Baumgartner, 2022 +""" +# inner-module imports +from .desktop import main as desktop + +## EOF ## diff --git a/tagit/apps/desktop.py b/tagit/apps/desktop.py new file mode 100644 index 0000000..67733f0 --- /dev/null +++ b/tagit/apps/desktop.py @@ -0,0 +1,55 @@ +""" + +Part of the tagit module. +A copy of the license is provided with the project. +Author: Matthias Baumgartner, 2022 +""" +# standard imports +import typing + +# kivy imports +from kivy.app import App +from kivy.uix.settings import SettingsWithSidebar + +# tagit imports +from tagit.widgets import desktop + +# exports +__all__: typing.Sequence[str] = ( + 'main', + ) + + +## code ## + +class TagitApp(App): + """The tagit main application.""" + + def build(self): + # set settings panel style + self.settings_cls = SettingsWithSidebar + + # set title + self.title = 'tagit v2.0' + + # create widget + return desktop.MainWindow() + + def on_start(self): + # trigger startup operations + self.root.on_startup() + + +def main(): + """Start the tagit GUI. Opens a window to browse images.""" + # Run the GUI + app = TagitApp() + app.run() + + +## main ## + +if __name__ == '__main__': + main() + +## EOF ## |