remove deprecated feature

This commit is contained in:
yggverse 2025-01-27 15:00:58 +02:00
parent 50158c2f64
commit ee8f7f69af
4 changed files with 3 additions and 25 deletions

View File

@ -10,19 +10,13 @@ use crate::Profile;
use action::Action; use action::Action;
use adw::TabView; use adw::TabView;
use client::Client; use client::Client;
use gtk::{ use gtk::prelude::{ActionMapExt, Cast, EditableExt};
glib::{uuid_string_random, GString},
prelude::{ActionMapExt, Cast, EditableExt},
};
use page::Page; use page::Page;
use sqlite::Transaction; use sqlite::Transaction;
use std::rc::Rc; use std::rc::Rc;
use widget::Widget; use widget::Widget;
pub struct Item { pub struct Item {
// Auto-generated unique item ID
// useful as widget name in GTK actions callback
pub id: Rc<GString>,
// Multi-protocol handler // Multi-protocol handler
pub client: Rc<Client>, pub client: Rc<Client>,
// Components // Components
@ -52,9 +46,6 @@ impl Item {
bool, bool,
), ),
) -> Self { ) -> Self {
// Generate unique ID for new page components
let id = Rc::new(uuid_string_random());
// Init components // Init components
let action = Rc::new(Action::new()); let action = Rc::new(Action::new());
@ -70,13 +61,11 @@ impl Item {
.add_action(&action.history.forward); .add_action(&action.history.forward);
let page = Rc::new(Page::build( let page = Rc::new(Page::build(
&id,
profile, profile,
(browser_action, window_action, tab_action, &action), (browser_action, window_action, tab_action, &action),
)); ));
let widget = Rc::new(Widget::build( let widget = Rc::new(Widget::build(
id.as_str(),
tab_view, tab_view,
&page.widget.g_box, &page.widget.g_box,
None, None,
@ -146,7 +135,6 @@ impl Item {
} }
// Done // Done
Self { Self {
id,
client, client,
page, page,
widget, widget,

View File

@ -15,12 +15,11 @@ use widget::Widget;
use super::{Action as ItemAction, BrowserAction, Profile, TabAction, WindowAction}; use super::{Action as ItemAction, BrowserAction, Profile, TabAction, WindowAction};
use gtk::{glib::GString, prelude::EditableExt}; use gtk::prelude::EditableExt;
use sqlite::Transaction; use sqlite::Transaction;
use std::rc::Rc; use std::rc::Rc;
pub struct Page { pub struct Page {
pub id: Rc<GString>,
pub profile: Rc<Profile>, pub profile: Rc<Profile>,
// Actions // Actions
pub browser_action: Rc<BrowserAction>, pub browser_action: Rc<BrowserAction>,
@ -38,7 +37,6 @@ impl Page {
// Constructors // Constructors
pub fn build( pub fn build(
id: &Rc<GString>,
profile: &Rc<Profile>, profile: &Rc<Profile>,
(browser_action, window_action, tab_action, item_action): ( (browser_action, window_action, tab_action, item_action): (
&Rc<BrowserAction>, &Rc<BrowserAction>,
@ -60,7 +58,6 @@ impl Page {
let input = Rc::new(Input::new()); let input = Rc::new(Input::new());
let widget = Rc::new(Widget::build( let widget = Rc::new(Widget::build(
id,
&navigation.widget.g_box, &navigation.widget.g_box,
&content.g_box, &content.g_box,
&search.g_box, &search.g_box,
@ -69,7 +66,6 @@ impl Page {
// Done // Done
Self { Self {
id: id.clone(),
profile: profile.clone(), profile: profile.clone(),
// Actions // Actions
browser_action: browser_action.clone(), browser_action: browser_action.clone(),

View File

@ -12,7 +12,6 @@ impl Widget {
/// Build new `Self` /// Build new `Self`
pub fn build( pub fn build(
name: &str,
// Components // Components
navigation: &impl IsA<gtk::Widget>, navigation: &impl IsA<gtk::Widget>,
content: &impl IsA<gtk::Widget>, content: &impl IsA<gtk::Widget>,
@ -20,10 +19,7 @@ impl Widget {
input: &impl IsA<gtk::Widget>, input: &impl IsA<gtk::Widget>,
) -> Self { ) -> Self {
// Init self // Init self
let g_box = Box::builder() let g_box = Box::builder().orientation(Orientation::Vertical).build();
.orientation(Orientation::Vertical)
.name(name)
.build();
g_box.append(navigation); g_box.append(navigation);
g_box.append(content); g_box.append(content);

View File

@ -16,7 +16,6 @@ impl Widget {
/// Build new `Self` /// Build new `Self`
pub fn build( pub fn build(
keyword: &str, // ID
tab_view: &TabView, tab_view: &TabView,
child: &impl IsA<gtk::Widget>, child: &impl IsA<gtk::Widget>,
title: Option<&str>, title: Option<&str>,
@ -38,7 +37,6 @@ impl Widget {
// Setup // Setup
tab_page.set_needs_attention(is_attention); tab_page.set_needs_attention(is_attention);
tab_page.set_keyword(keyword);
tab_page.set_title(match title { tab_page.set_title(match title {
Some(value) => value, Some(value) => value,
None => DEFAULT_TITLE, None => DEFAULT_TITLE,