Add Discover Integrations button

This commit is contained in:
ranfdev
2023-10-27 00:06:12 +02:00
parent 3b41ed55ed
commit 65c71a524b
2 changed files with 28 additions and 8 deletions

View File

@ -74,7 +74,10 @@ template $NotifyWindow : Adw.ApplicationWindow {
Adw.StatusPage welcome_view { Adw.StatusPage welcome_view {
title: "Notify"; title: "Notify";
description: "Subscribe to one topic and start listening for notifications"; description: "Subscribe to one topic and start listening for notifications";
child: Gtk.Button { child: Gtk.Box {
orientation: vertical;
spacing: 8;
Gtk.Button {
label: "Subscribe To Topic"; label: "Subscribe To Topic";
clicked => $show_add_topic() swapped; clicked => $show_add_topic() swapped;
halign: center; halign: center;
@ -82,6 +85,15 @@ template $NotifyWindow : Adw.ApplicationWindow {
"suggested-action", "suggested-action",
"pill" "pill"
] ]
}
Gtk.Button {
label: "Discover Integrations";
clicked => $discover_integrations() swapped;
halign: center;
styles [
"pill"
]
}
}; };
} }
ScrolledWindow list_view { ScrolledWindow list_view {

View File

@ -139,6 +139,14 @@ mod imp {
None None
}); });
} }
#[template_callback]
fn discover_integrations(&self, _btn: &gtk::Button) {
gtk::UriLauncher::new("https://docs.ntfy.sh/integrations/").launch(
Some(&self.obj().clone()),
gio::Cancellable::NONE,
|_| {},
);
}
} }
#[glib::object_subclass] #[glib::object_subclass]