mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
draft page open action
This commit is contained in:
parent
fa95f7ffdd
commit
8bff9ce719
2 changed files with 38 additions and 5 deletions
|
|
@ -5,8 +5,8 @@ use parser::link::Link;
|
|||
use parser::plain::Plain;
|
||||
|
||||
use gtk::{
|
||||
glib::{GString, Uri},
|
||||
prelude::{StyleContextExt, WidgetExt},
|
||||
glib::{GString, Propagation, Uri},
|
||||
prelude::{StyleContextExt, ToVariant, WidgetExt},
|
||||
Align, CssProvider, Label, STYLE_PROVIDER_PRIORITY_APPLICATION,
|
||||
};
|
||||
|
||||
|
|
@ -76,6 +76,12 @@ impl Reader {
|
|||
.style_context()
|
||||
.add_provider(&css, STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
|
||||
// Connect actions @TODO move actions init outside
|
||||
widget.connect_activate_link(|label, uri| {
|
||||
let _ = label.activate_action("page.open", Some(&uri.to_variant()));
|
||||
Propagation::Stop // |Proceed @TODO parse external scheme
|
||||
});
|
||||
|
||||
// Result
|
||||
Self { title, css, widget }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue