From 76a8e785026e9583db62c92c4451b334e178db9f Mon Sep 17 00:00:00 2001 From: heliguy Date: Wed, 27 Mar 2024 01:34:29 -0400 Subject: [PATCH] Convert filter window to an adw.dialog --- data/ui/filter.blp | 13 ++++++------- src/filter_window.py | 6 ++---- src/window.py | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/data/ui/filter.blp b/data/ui/filter.blp index 70f71ea..093ec0c 100644 --- a/data/ui/filter.blp +++ b/data/ui/filter.blp @@ -1,16 +1,15 @@ using Gtk 4.0; using Adw 1; -template $FilterWindow: Adw.Window { - default-width: 500; - default-height: 450; +template $FilterWindow: Adw.Dialog { title: _("Set Filters"); - modal: true; + content-width: 500; + content-height: 450; + child: Adw.ToolbarView main_toolbar_view { [top] - HeaderBar header_bar { - show-title-buttons: true; + Adw.HeaderBar header_bar { } content: Adw.ToastOverlay toast_overlay { @@ -80,5 +79,5 @@ template $FilterWindow: Adw.Window { } } }; - } + }; } diff --git a/src/filter_window.py b/src/filter_window.py index 882c2de..5457576 100644 --- a/src/filter_window.py +++ b/src/filter_window.py @@ -6,7 +6,7 @@ import pathlib @Gtk.Template(resource_path="/io/github/flattool/Warehouse/../data/ui/filter.ui") -class FilterWindow(Adw.Window): +class FilterWindow(Adw.Dialog): __gtype_name__ = "FilterWindow" show_apps_switch = Gtk.Template.Child() @@ -196,9 +196,7 @@ class FilterWindow(Adw.Window): self.total_runtimes_selected = 0 # Window Things - self.set_transient_for(main_window) self.add_controller(event_controller) - self.set_size_request(260, 230) self.show_apps_switch.set_active(self.settings.get_boolean("show-apps")) self.show_runtimes_switch.set_active(self.settings.get_boolean("show-runtimes")) @@ -226,4 +224,4 @@ class FilterWindow(Adw.Window): else: self.generate_runtimes() self.check_is_resetable() - self.present() + self.present(main_window) diff --git a/src/window.py b/src/window.py index 98c4a99..9c052e0 100644 --- a/src/window.py +++ b/src/window.py @@ -23,7 +23,7 @@ import re import time from gi.repository import Adw, Gdk, Gio, GLib, Gtk -from .properties_window import PropertiesWindow +# from .properties_window import PropertiesWindow from .filter_window import FilterWindow from .common import myUtils from .remotes_window import RemotesWindow