Skip to content

Commit 65c71a5

Browse files
committed
Add Discover Integrations button
1 parent 3b41ed5 commit 65c71a5

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

data/resources/ui/window.blp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,26 @@ template $NotifyWindow : Adw.ApplicationWindow {
7474
Adw.StatusPage welcome_view {
7575
title: "Notify";
7676
description: "Subscribe to one topic and start listening for notifications";
77-
child: Gtk.Button {
78-
label: "Subscribe To Topic";
79-
clicked => $show_add_topic() swapped;
80-
halign: center;
81-
styles [
82-
"suggested-action",
83-
"pill"
84-
]
77+
child: Gtk.Box {
78+
orientation: vertical;
79+
spacing: 8;
80+
Gtk.Button {
81+
label: "Subscribe To Topic";
82+
clicked => $show_add_topic() swapped;
83+
halign: center;
84+
styles [
85+
"suggested-action",
86+
"pill"
87+
]
88+
}
89+
Gtk.Button {
90+
label: "Discover Integrations";
91+
clicked => $discover_integrations() swapped;
92+
halign: center;
93+
styles [
94+
"pill"
95+
]
96+
}
8597
};
8698
}
8799
ScrolledWindow list_view {

src/widgets/window.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ mod imp {
139139
None
140140
});
141141
}
142+
#[template_callback]
143+
fn discover_integrations(&self, _btn: &gtk::Button) {
144+
gtk::UriLauncher::new("https://docs.ntfy.sh/integrations/").launch(
145+
Some(&self.obj().clone()),
146+
gio::Cancellable::NONE,
147+
|_| {},
148+
);
149+
}
142150
}
143151

144152
#[glib::object_subclass]

0 commit comments

Comments
 (0)