Browse Source

drop label mod

master
yggverse 2 months ago
parent
commit
5529fcaa71
  1. 6
      src/app/browser/window/tab.rs
  2. 24
      src/app/browser/window/tab/item.rs

6
src/app/browser/window/tab.rs

@ -106,8 +106,9 @@ impl Tab { @@ -106,8 +106,9 @@ impl Tab {
self.index.borrow_mut().insert(item.id(), item.clone());
// Append new Notebook page
/* @TODO
self.widget
.append(item.label(), item.page(), item.is_initially_current());
.append(item.label(), item.page(), item.is_initially_current()); */
if page_navigation_request_text.is_none() {
item.page_navigation_request_grab_focus(); // @TODO
@ -223,11 +224,12 @@ impl Tab { @@ -223,11 +224,12 @@ impl Tab {
self.index.borrow_mut().insert(item.id(), item.clone());
// Append new Notebook page
/* @TODO
self.widget.append(
item.label(),
item.page(),
item.is_initially_current(),
);
); */
}
}
Err(e) => return Err(e.to_string()),

24
src/app/browser/window/tab/item.rs

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
mod database;
mod label;
mod page;
use database::Database;
use label::Label;
use page::Page;
use sqlite::Transaction;
@ -21,7 +19,6 @@ pub struct Item { @@ -21,7 +19,6 @@ pub struct Item {
// useful as widget name in GTK actions callback
id: GString,
// Components
label: Arc<Label>,
page: Arc<Page>,
// Extras, useful for session restore
is_initially_current: bool,
@ -43,8 +40,6 @@ impl Item { @@ -43,8 +40,6 @@ impl Item {
let id = uuid_string_random();
// Init components
let label = Label::new_arc(id.clone(), false);
let page = Page::new_arc(
id.clone(),
page_navigation_request_text.clone(),
@ -59,14 +54,13 @@ impl Item { @@ -59,14 +54,13 @@ impl Item {
Arc::new(Self {
id,
is_initially_current,
label,
page,
})
}
// Actions
pub fn pin(&self) {
self.label.pin(!self.label.is_pinned()) // toggle
//self.label.pin(!self.label.is_pinned()) // toggle
}
pub fn page_navigation_base(&self) {
@ -91,11 +85,6 @@ impl Item { @@ -91,11 +85,6 @@ impl Item {
pub fn update(&self) {
self.page.update();
if let Some(title) = self.page.title() {
self.label.update(Some(&title));
} else {
self.label.update(None);
}
}
pub fn clean(
@ -109,7 +98,6 @@ impl Item { @@ -109,7 +98,6 @@ impl Item {
match Database::delete(transaction, &record.id) {
Ok(_) => {
// Delegate clean action to the item childs
self.label.clean(transaction, &record.id)?;
/* @TODO
self.page.clean(transaction, &record.id)?;*/
@ -154,7 +142,9 @@ impl Item { @@ -154,7 +142,9 @@ impl Item {
);
// Delegate restore action to the item childs
item.label.restore(transaction, &record.id)?;
/* @TODO
self.page.restore(transaction, &id)?; */
// Result
items.push(item);
@ -183,7 +173,6 @@ impl Item { @@ -183,7 +173,6 @@ impl Item {
let id = Database::last_insert_id(transaction);
// Delegate save action to childs
self.label.save(transaction, &id)?;
/* @TODO
self.page.save(transaction, &id)?; */
@ -203,10 +192,6 @@ impl Item { @@ -203,10 +192,6 @@ impl Item {
self.is_initially_current
}
pub fn label(&self) -> &Box {
&self.label.gobject()
}
pub fn page(&self) -> &Box {
&self.page.widget() // @TODO
}
@ -227,7 +212,6 @@ impl Item { @@ -227,7 +212,6 @@ impl Item {
}
// Delegate migration to childs
Label::migrate(&tx)?;
/* @TODO
Page::migrate(&tx)? */

Loading…
Cancel
Save