diff --git a/data/style.css b/data/style.css index e69de29..af75c8b 100644 --- a/data/style.css +++ b/data/style.css @@ -0,0 +1,10 @@ +/* Thanks, TheEvilSkeleton! */ +.drag-overlay-status-page { + background-color: alpha(var(--accent-bg-color), 0.5); + color: var(--accent-fg-color); + padding: 32px; +} + +.blurred { + filter: blur(6px); +} diff --git a/src/main_window/window.blp b/src/main_window/window.blp index 91fc18b..8b4c7b9 100644 --- a/src/main_window/window.blp +++ b/src/main_window/window.blp @@ -16,8 +16,18 @@ template $WarehouseWindow: Adw.ApplicationWindow { } content: Adw.ToastOverlay toast_overlay { - Stack file_drop_stack { - transition-type: crossfade; + Overlay { + [overlay] + Revealer file_drop_revealer { + can-target: false; + transition-type: crossfade; + Adw.StatusPage file_drop_view { + icon-name: "folder-open-symbolic"; + title: _("Drop to Open"); + description: _("Install Flatpaks or Add a Remotes"); + styles ["drag-overlay-status-page"] + } + } Adw.OverlaySplitView main_split { collapsed: true; show-sidebar: true; @@ -123,11 +133,6 @@ template $WarehouseWindow: Adw.ApplicationWindow { } ; } - Adw.StatusPage file_drop_view { - icon-name: "folder-open-symbolic"; - title: _("Drop to Open"); - description: _("Install Flatpaks or Add a Remotes"); - } } } ; diff --git a/src/main_window/window.py b/src/main_window/window.py index febcfef..dbf1ebc 100644 --- a/src/main_window/window.py +++ b/src/main_window/window.py @@ -32,7 +32,7 @@ class WarehouseWindow(Adw.ApplicationWindow): gtc = Gtk.Template.Child main_breakpoint = gtc() toast_overlay = gtc() - file_drop_stack = gtc() + file_drop_revealer = gtc() main_split = gtc() file_drop_view = gtc() stack = gtc() @@ -177,11 +177,13 @@ class WarehouseWindow(Adw.ApplicationWindow): self.toast_overlay.add_toast(ErrorToast(_("Could not open files"), str(e)).toast) def on_drop_enter(self, *args): - self.file_drop_stack.set_visible_child(self.file_drop_view) + self.main_split.add_css_class("blurred") + self.file_drop_revealer.set_reveal_child(True) return 1 def on_drop_leave(self, *args): - self.file_drop_stack.set_visible_child(self.main_split) + self.main_split.remove_css_class("blurred") + self.file_drop_revealer.set_reveal_child(False) def switch_page_shortcut_handler(self, letter): self.activate_row(self.shortcut_to_pages[letter]) diff --git a/src/warehouse.gresource.xml b/src/warehouse.gresource.xml index 0275988..8102b6d 100644 --- a/src/warehouse.gresource.xml +++ b/src/warehouse.gresource.xml @@ -1,7 +1,7 @@ - ../data/style.css + ../data/style.css gtk/help-overlay.ui gtk/loading_status.ui gtk/app_row.ui