mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Make the overlay status look really good (fix style.css not being recognized)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/io/github/flattool/Warehouse">
|
||||
<file>../data/style.css</file>
|
||||
<file alias="style.css">../data/style.css</file>
|
||||
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
|
||||
<file preprocess="xml-stripblanks">gtk/loading_status.ui</file>
|
||||
<file preprocess="xml-stripblanks">gtk/app_row.ui</file>
|
||||
|
||||
Reference in New Issue
Block a user