namespace StillExplore {
    public class Application : Adw.Application {
        public Application() {
            Object(
                application_id: "io.stillhq.explore",
                flags: ApplicationFlags.FLAGS_NONE
            );
        }

        protected override void startup() {
            base.startup();
            init_gettext();
            load_custom_css();
        }

        protected override void activate() {
            var window = new Window(this);
            window.present ();
        }

        private void load_custom_css() {
            var provider = new Gtk.CssProvider();
            provider.load_from_string("""
            :root {
                --sidebar-border-color: transparent;
                --sidebar-shade-color: transparent;
            }
            """);

            Gtk.StyleContext.add_provider_for_display(
                Gdk.Display.get_default(),
                provider,
                Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
            );
        }

        private void init_gettext() {
            Intl.setlocale(LocaleCategory.ALL, "");
            Intl.bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR_PATH);
            Intl.bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
            Intl.textdomain(GETTEXT_PACKAGE);
        }

        public static int main (string[] args) {
            var app = new Application ();
            return app.run (args);
        }
    }
}
