diff options
author | P. J. McDermott <pj@pehjota.net> | 2023-10-01 16:32:49 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2023-10-01 16:32:49 (EDT) |
commit | bab4f35fc5c13341fb9cc96a7cb863c5cd5c3f53 (patch) | |
tree | 75d9463a02eb5984e1f33aadba830f490f2b103c /src/main.py | |
download | siglo-bab4f35fc5c13341fb9cc96a7cb863c5cd5c3f53.zip siglo-bab4f35fc5c13341fb9cc96a7cb863c5cd5c3f53.tar.gz siglo-bab4f35fc5c13341fb9cc96a7cb863c5cd5c3f53.tar.bz2 |
New upstream version 0.9.9upstream/0.9.9upstream/latest
Diffstat (limited to 'src/main.py')
-rw-r--r-- | src/main.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..a6cdb94 --- /dev/null +++ b/src/main.py @@ -0,0 +1,51 @@ +import sys +import gi + +gi.require_version("Gtk", "3.0") + +from gi.repository import Gtk, Gio, Gdk +from .window import SigloWindow +from .config import config + + +class Application(Gtk.Application): + def __init__(self): + self.manager = None + self.conf = config() + self.conf.load_defaults() + super().__init__( + application_id="com.github.theironrobin.siglo", flags=Gio.ApplicationFlags.FLAGS_NONE + ) + + def do_activate(self): + win = self.props.active_window + if not win: + win = SigloWindow(application=self) + win.present() + win.do_scanning() + + def do_window_removed(self, window): + win = self.props.active_window + if win: + win.destroy_manager() + self.quit() + + +def main(version): + def gtk_style(): + css = b""" +#multi_mac_label { font-size: 33px; } +#bluetooth_button { background-color: blue; + background-image: none; } + """ + style_provider = Gtk.CssProvider() + style_provider.load_from_data(css) + Gtk.StyleContext.add_provider_for_screen( + Gdk.Screen.get_default(), + style_provider, + Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION, + ) + + gtk_style() + app = Application() + return app.run(sys.argv) |