rename action

This commit is contained in:
yggverse 2024-09-28 03:59:05 +03:00
parent ae2bb93ea7
commit 7587e02aff
5 changed files with 14 additions and 14 deletions

View file

@ -25,15 +25,15 @@ pub struct Content {
// GTK
widget: Box,
// Actions
action_open: Arc<SimpleAction>,
action_page_open: Arc<SimpleAction>,
}
impl Content {
// Construct
pub fn new(action_open: Arc<SimpleAction>) -> Self {
pub fn new(action_page_open: Arc<SimpleAction>) -> Self {
Self {
widget: Box::builder().orientation(Orientation::Vertical).build(),
action_open,
action_page_open,
}
}
@ -47,7 +47,7 @@ impl Content {
// Re-compose
match mime {
Mime::TextGemini => {
let child = Text::gemini(data, base, self.action_open.clone());
let child = Text::gemini(data, base, self.action_page_open.clone());
self.widget.append(child.widget());

View file

@ -21,9 +21,9 @@ pub struct Text {
impl Text {
// Construct
pub fn gemini(gemtext: &str, base: &Uri, action_open: Arc<SimpleAction>) -> Self {
pub fn gemini(gemtext: &str, base: &Uri, action_page_open: Arc<SimpleAction>) -> Self {
// Init components
let gemini = Gemini::new(gemtext, base, action_open);
let gemini = Gemini::new(gemtext, base, action_page_open);
// Init meta
let meta = Meta {

View file

@ -17,9 +17,9 @@ pub struct Gemini {
impl Gemini {
// Construct
pub fn new(gemtext: &str, base: &Uri, action_open: Arc<SimpleAction>) -> Self {
pub fn new(gemtext: &str, base: &Uri, action_page_open: Arc<SimpleAction>) -> Self {
// Init components
let reader = Reader::new(gemtext, base, action_open);
let reader = Reader::new(gemtext, base, action_page_open);
// Init widget
let widget = Viewport::builder().scroll_to_focus(false).build();

View file

@ -21,7 +21,7 @@ pub struct Reader {
impl Reader {
// Construct
pub fn new(gemtext: &str, base: &Uri, action_open: Arc<SimpleAction>) -> Self {
pub fn new(gemtext: &str, base: &Uri, action_page_open: Arc<SimpleAction>) -> Self {
// Init title
let mut title = None;
@ -91,7 +91,7 @@ impl Reader {
return match uri.scheme().as_str() {
"gemini" => {
// Open new page
action_open.activate(Some(&uri.to_str().to_variant()));
action_page_open.activate(Some(&uri.to_str().to_variant()));
// Prevent link open in external application
Propagation::Stop