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

@ -42,17 +42,17 @@ impl Page {
action_update: Arc<SimpleAction>,
) -> Page {
// Init actions
let action_open = Arc::new(SimpleAction::new(
let action_page_open = Arc::new(SimpleAction::new(
"open",
Some(&String::static_variant_type()),
));
// Init action group
let action_group = SimpleActionGroup::new();
action_group.add_action(action_open.as_ref());
action_group.add_action(action_page_open.as_ref());
// Init components
let content = Arc::new(Content::new(action_open.clone()));
let content = Arc::new(Content::new(action_page_open.clone()));
let navigation = Arc::new(Navigation::new(
navigation_request_text,
action_tab_page_reload.clone(),
@ -74,7 +74,7 @@ impl Page {
let meta = Arc::new(RefCell::new(Meta::new()));
// Init events
action_open.connect_activate({
action_page_open.connect_activate({
let navigation = navigation.clone();
move |_, request| {
let uri = request

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