add view source menu item

This commit is contained in:
yggverse 2024-12-11 16:52:42 +02:00
parent 85735d33e2
commit e66b065fc3
8 changed files with 124 additions and 0 deletions

View file

@ -94,6 +94,10 @@ impl Request {
self.widget.entry.set_text(&self.download());
}
pub fn to_source(&self) {
self.widget.entry.set_text(&self.source());
}
// Getters
pub fn uri(&self) -> Option<Uri> {
@ -120,6 +124,10 @@ impl Request {
pub fn download(&self) -> GString {
gformat!("download:{}", self.strip_prefix())
}
pub fn source(&self) -> GString {
gformat!("source:{}", self.strip_prefix())
}
}
// Tools

View file

@ -56,6 +56,19 @@ impl Menu {
main.append_section(None, &main_mark);
let main_tools = gtk::gio::Menu::new();
main_tools.append(
Some("Source"),
Some(&format!(
"{}.{}",
window_action.id,
window_action.source.gobject.name()
)),
);
main.append_section(None, &main_tools);
let navigation = gtk::gio::Menu::new();
navigation.append(