From 65502c247d0338fe4e4b336317423c982bda9f97 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 8 Oct 2024 00:56:52 +0300 Subject: [PATCH] normalize tab items component --- src/app/browser/window/tab.rs | 156 +++++------ src/app/browser/window/tab/database.rs | 23 +- src/app/browser/window/tab/item.rs | 262 ++++++++++++++++++ .../window/tab/{label => item}/database.rs | 27 +- .../browser/window/tab/{ => item}/label.rs | 0 .../browser/window/tab/item/label/database.rs | 80 ++++++ .../window/tab/{ => item}/label/pin.rs | 0 .../window/tab/{ => item}/label/title.rs | 0 .../window/tab/{ => item}/label/widget.rs | 0 src/app/browser/window/tab/{ => item}/page.rs | 0 .../window/tab/{ => item}/page/content.rs | 0 .../tab/{ => item}/page/content/text.rs | 0 .../{ => item}/page/content/text/gemini.rs | 0 .../page/content/text/gemini/reader.rs | 0 .../content/text/gemini/reader/default.css | 0 .../page/content/text/gemini/reader/parser.rs | 0 .../text/gemini/reader/parser/header.rs | 0 .../content/text/gemini/reader/parser/link.rs | 0 .../text/gemini/reader/parser/plain.rs | 0 .../page/content/text/plain/reader.rs | 0 .../window/tab/{ => item}/page/meta.rs | 0 .../window/tab/{ => item}/page/navigation.rs | 0 .../tab/{ => item}/page/navigation/base.rs | 0 .../{ => item}/page/navigation/bookmark.rs | 0 .../tab/{ => item}/page/navigation/history.rs | 0 .../page/navigation/history/back.rs | 0 .../page/navigation/history/forward.rs | 0 .../tab/{ => item}/page/navigation/reload.rs | 0 .../tab/{ => item}/page/navigation/request.rs | 0 29 files changed, 429 insertions(+), 119 deletions(-) create mode 100644 src/app/browser/window/tab/item.rs rename src/app/browser/window/tab/{label => item}/database.rs (71%) rename src/app/browser/window/tab/{ => item}/label.rs (100%) create mode 100644 src/app/browser/window/tab/item/label/database.rs rename src/app/browser/window/tab/{ => item}/label/pin.rs (100%) rename src/app/browser/window/tab/{ => item}/label/title.rs (100%) rename src/app/browser/window/tab/{ => item}/label/widget.rs (100%) rename src/app/browser/window/tab/{ => item}/page.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content/text.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content/text/gemini.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content/text/gemini/reader.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content/text/gemini/reader/default.css (100%) rename src/app/browser/window/tab/{ => item}/page/content/text/gemini/reader/parser.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content/text/gemini/reader/parser/header.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content/text/gemini/reader/parser/link.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content/text/gemini/reader/parser/plain.rs (100%) rename src/app/browser/window/tab/{ => item}/page/content/text/plain/reader.rs (100%) rename src/app/browser/window/tab/{ => item}/page/meta.rs (100%) rename src/app/browser/window/tab/{ => item}/page/navigation.rs (100%) rename src/app/browser/window/tab/{ => item}/page/navigation/base.rs (100%) rename src/app/browser/window/tab/{ => item}/page/navigation/bookmark.rs (100%) rename src/app/browser/window/tab/{ => item}/page/navigation/history.rs (100%) rename src/app/browser/window/tab/{ => item}/page/navigation/history/back.rs (100%) rename src/app/browser/window/tab/{ => item}/page/navigation/history/forward.rs (100%) rename src/app/browser/window/tab/{ => item}/page/navigation/reload.rs (100%) rename src/app/browser/window/tab/{ => item}/page/navigation/request.rs (100%) diff --git a/src/app/browser/window/tab.rs b/src/app/browser/window/tab.rs index a71c8a09..108191a5 100644 --- a/src/app/browser/window/tab.rs +++ b/src/app/browser/window/tab.rs @@ -1,29 +1,21 @@ mod database; -mod label; -mod page; +mod item; mod widget; use database::Database; -use label::Label; -use page::Page; +use item::Item; use sqlite::Transaction; use widget::Widget; use gtk::{ gio::SimpleAction, - glib::{uuid_string_random, GString}, + glib::GString, prelude::{ActionExt, WidgetExt}, - GestureClick, Notebook, + Notebook, }; use std::{cell::RefCell, collections::HashMap, sync::Arc}; -// Common struct for HashMap index -pub struct TabItem { - label: Arc