diff --git a/data/ui/welcome_page.blp b/data/ui/welcome_page.blp index 17ef185..9c6075d 100644 --- a/data/ui/welcome_page.blp +++ b/data/ui/welcome_page.blp @@ -32,8 +32,8 @@ template $WelcomePage : Adw.NavigationPage { // } [start] - Spinner spinner { - spinning: false; + Adw.Spinner spinner { + visible: false; } [end] diff --git a/flatpak/com.github.tenderowl.frog.json b/flatpak/com.github.tenderowl.frog.json index 34b03c7..7b2129a 100644 --- a/flatpak/com.github.tenderowl.frog.json +++ b/flatpak/com.github.tenderowl.frog.json @@ -1,7 +1,7 @@ { "app-id" : "com.github.tenderowl.frog", "runtime" : "org.gnome.Platform", - "runtime-version" : "46", + "runtime-version" : "47", "sdk" : "org.gnome.Sdk", "command" : "frog", "finish-args" : [ diff --git a/frog/widgets/welcome_page.py b/frog/widgets/welcome_page.py index f2c68cb..fd20c71 100644 --- a/frog/widgets/welcome_page.py +++ b/frog/widgets/welcome_page.py @@ -40,7 +40,7 @@ class WelcomePage(Adw.NavigationPage): __gtype_name__ = "WelcomePage" - spinner: Gtk.Spinner = Gtk.Template.Child() + spinner: Adw.Spinner = Gtk.Template.Child() welcome: Adw.StatusPage = Gtk.Template.Child() lang_combo: Gtk.MenuButton = Gtk.Template.Child() language_popover: LanguagePopover = Gtk.Template.Child() diff --git a/frog/window.py b/frog/window.py index 363e5ff..5d1ce2c 100644 --- a/frog/window.py +++ b/frog/window.py @@ -129,7 +129,6 @@ def on_language_change(self, widget: Gtk.ListBox, row: Gtk.ListBoxRow) -> None: def get_screenshot(self, copy: bool = False) -> None: self.extracted_page.listen_cancel() lang = self.get_language() - # self.welcome_page.spinner.start() self.hide() self.backend.capture(lang, copy) @@ -178,11 +177,11 @@ def on_shot_done(self, sender, text: str, copy: bool) -> None: finally: self.present() - self.welcome_page.spinner.stop() + self.welcome_page.spinner.set_visible(False) def on_shot_error(self, sender, message: str) -> None: self.present() - self.welcome_page.spinner.stop() + self.welcome_page.spinner.set_visible(False) if message: self.show_toast(message) # self.display_error(self, message) @@ -207,7 +206,7 @@ def on_open_image(self, dialog: Gtk.FileDialog, result: Gio.AsyncResult) -> None try: item = dialog.open_finish(result) lang = self.get_language() - self.welcome_page.spinner.start() + self.welcome_page.spinner.set_visible(True) GObjectWorker.call(self.backend.decode_image, (lang, item.get_path())) except GLib.Error as e: if not e.matches(Gio.io_error_quark(), Gio.IOErrorEnum.CANCELLED): @@ -219,7 +218,7 @@ def _on_paste_from_clipboard( pngbytes = BytesIO(texture.save_to_png_bytes().get_data()) try: lang = self.get_language() - self.welcome_page.spinner.start() + self.welcome_page.spinner.set_visible(True) GObjectWorker.call(self.backend.decode_image, (lang, pngbytes)) except GLib.Error as e: if not e.matches(Gio.io_error_quark(), Gio.IOErrorEnum.CANCELLED): @@ -261,7 +260,7 @@ def on_dnd_drop(self, drop_target, value: Gdk.FileList, x: int, y: int) -> None: return self.show_toast(_("Only images can be processed that way.")) lang = self.get_language() - self.welcome_page.spinner.start() + self.welcome_page.spinner.set_visible(True) GObjectWorker.call(self.backend.decode_image, (lang, item.get_path())) def on_configure_event(self, window, event):