draft new tab open on middle click

This commit is contained in:
yggverse 2024-10-14 01:13:26 +03:00
parent 0d55d492f3
commit 8f1e94dd68
8 changed files with 67 additions and 13 deletions

View file

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