rename identity widget

This commit is contained in:
yggverse 2024-11-16 14:52:37 +02:00
parent d717c1c246
commit 3e6f95833d
3 changed files with 13 additions and 13 deletions

View File

@ -1,16 +1,16 @@
mod auth;
mod bookmark; mod bookmark;
mod database; mod database;
mod history; mod history;
mod home; mod home;
mod identity;
mod reload; mod reload;
mod request; mod request;
mod widget; mod widget;
use auth::Auth;
use bookmark::Bookmark; use bookmark::Bookmark;
use history::History; use history::History;
use home::Home; use home::Home;
use identity::Identity;
use reload::Reload; use reload::Reload;
use request::Request; use request::Request;
use widget::Widget; use widget::Widget;
@ -24,11 +24,11 @@ use sqlite::Transaction;
use std::rc::Rc; use std::rc::Rc;
pub struct Navigation { pub struct Navigation {
auth: Rc<Auth>,
profile: Rc<Profile>,
bookmark: Rc<Bookmark>, bookmark: Rc<Bookmark>,
history: Rc<History>, history: Rc<History>,
home: Rc<Home>, home: Rc<Home>,
identity: Rc<Identity>,
profile: Rc<Profile>,
reload: Rc<Reload>, reload: Rc<Reload>,
request: Rc<Request>, request: Rc<Request>,
widget: Rc<Widget>, widget: Rc<Widget>,
@ -40,7 +40,7 @@ impl Navigation {
action: (Rc<BrowserAction>, Rc<WindowAction>, Rc<TabAction>), action: (Rc<BrowserAction>, Rc<WindowAction>, Rc<TabAction>),
) -> Self { ) -> Self {
// Init components // Init components
let auth = Rc::new(Auth::new(action.2.clone())); let identity = Rc::new(Identity::new(action.2.clone()));
let home = Rc::new(Home::new(action.1.clone())); let home = Rc::new(Home::new(action.1.clone()));
let history = Rc::new(History::new(action.1.clone())); let history = Rc::new(History::new(action.1.clone()));
let reload = Rc::new(Reload::new(action.1.clone())); let reload = Rc::new(Reload::new(action.1.clone()));
@ -49,7 +49,7 @@ impl Navigation {
// Init widget // Init widget
let widget = Rc::new(Widget::new( let widget = Rc::new(Widget::new(
auth.widget().gobject(), identity.widget().gobject(),
home.widget().gobject(), home.widget().gobject(),
history.widget().gobject(), history.widget().gobject(),
reload.widget().gobject(), reload.widget().gobject(),
@ -59,11 +59,11 @@ impl Navigation {
// Done // Done
Self { Self {
auth,
profile,
bookmark, bookmark,
history, history,
home, home,
identity,
profile,
reload, reload,
request, request,
widget, widget,
@ -75,7 +75,7 @@ impl Navigation {
pub fn update(&self, progress_fraction: Option<f64>) { pub fn update(&self, progress_fraction: Option<f64>) {
let request = self.request.widget().gobject().text(); let request = self.request.widget().gobject().text();
self.auth.update(); self.identity.update();
self.bookmark self.bookmark
.update(self.profile.bookmark.get(&request).is_ok()); .update(self.profile.bookmark.get(&request).is_ok());
self.history.update(); self.history.update();

View File

@ -4,11 +4,11 @@ use widget::Widget;
use crate::app::browser::window::tab::item::Action; use crate::app::browser::window::tab::item::Action;
use std::rc::Rc; use std::rc::Rc;
pub struct Auth { pub struct Identity {
widget: Rc<Widget>, widget: Rc<Widget>,
} }
impl Auth { impl Identity {
// Construct // Construct
pub fn new(action: Rc<Action>) -> Self { pub fn new(action: Rc<Action>) -> Self {
Self { Self {
@ -18,7 +18,7 @@ impl Auth {
// Actions // Actions
pub fn update(&self) { pub fn update(&self) {
// @TODO self.widget.update(false) // @TODO
} }
// Getters // Getters

View File

@ -15,7 +15,7 @@ impl Widget {
// Init gobject // Init gobject
let gobject = Button::builder() let gobject = Button::builder()
.icon_name("avatar-default-symbolic") .icon_name("avatar-default-symbolic")
.tooltip_text("Auth") .tooltip_text("Identity")
.sensitive(false) .sensitive(false)
.build(); .build();