mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
use canonical module subfolder tree
This commit is contained in:
parent
80783d2ae4
commit
8969899a2f
24 changed files with 0 additions and 23 deletions
14
src/browser/main/mod.rs
Normal file
14
src/browser/main/mod.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
mod tab;
|
||||
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Box;
|
||||
|
||||
pub fn new() -> Box {
|
||||
let main = Box::builder()
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.build();
|
||||
|
||||
main.append(&tab::new());
|
||||
|
||||
main
|
||||
}
|
||||
16
src/browser/main/tab/label/mod.rs
Normal file
16
src/browser/main/tab/label/mod.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
mod pin;
|
||||
mod title;
|
||||
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Box;
|
||||
|
||||
pub fn new() -> Box {
|
||||
let label = Box::builder()
|
||||
.orientation(gtk::Orientation::Horizontal)
|
||||
.build();
|
||||
|
||||
label.append(&pin::new(false));
|
||||
label.append(&title::new());
|
||||
|
||||
label
|
||||
}
|
||||
8
src/browser/main/tab/label/pin/mod.rs
Normal file
8
src/browser/main/tab/label/pin/mod.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use gtk::Image;
|
||||
|
||||
pub fn new(visible: bool) -> Image {
|
||||
Image::builder()
|
||||
.icon_name("view-pin-symbolic")
|
||||
.visible(visible)
|
||||
.build()
|
||||
}
|
||||
10
src/browser/main/tab/label/title/mod.rs
Normal file
10
src/browser/main/tab/label/title/mod.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
use gtk::Label;
|
||||
|
||||
pub fn new() -> Label {
|
||||
Label::builder()
|
||||
.label("New page")
|
||||
.ellipsize(gtk::pango::EllipsizeMode::End)
|
||||
.width_chars(16)
|
||||
.single_line_mode(true)
|
||||
.build()
|
||||
}
|
||||
27
src/browser/main/tab/mod.rs
Normal file
27
src/browser/main/tab/mod.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
mod label;
|
||||
mod page;
|
||||
|
||||
use gtk::Notebook;
|
||||
|
||||
pub fn new() -> Notebook {
|
||||
let tab = Notebook::builder().scrollable(true).build();
|
||||
|
||||
// Add test tab @TODO restore from session
|
||||
append(&tab, true);
|
||||
|
||||
tab
|
||||
}
|
||||
|
||||
pub fn append(tab: &Notebook, current: bool) -> u32 {
|
||||
let page = page::new();
|
||||
|
||||
let page_number = tab.append_page(&page, Some(&label::new()));
|
||||
|
||||
tab.set_tab_reorderable(&page, true);
|
||||
|
||||
if current {
|
||||
tab.set_current_page(Some(page_number));
|
||||
}
|
||||
|
||||
page_number
|
||||
}
|
||||
8
src/browser/main/tab/page/content/mod.rs
Normal file
8
src/browser/main/tab/page/content/mod.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use gtk::Box;
|
||||
// use gtk::prelude::BoxExt; @TODO append
|
||||
|
||||
pub fn new() -> Box {
|
||||
Box::builder()
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.build()
|
||||
}
|
||||
16
src/browser/main/tab/page/mod.rs
Normal file
16
src/browser/main/tab/page/mod.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
mod content;
|
||||
mod navigation;
|
||||
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Box;
|
||||
|
||||
pub fn new() -> Box {
|
||||
let page = Box::builder()
|
||||
.orientation(gtk::Orientation::Vertical)
|
||||
.build();
|
||||
|
||||
page.append(&navigation::new());
|
||||
page.append(&content::new());
|
||||
|
||||
page
|
||||
}
|
||||
9
src/browser/main/tab/page/navigation/base/mod.rs
Normal file
9
src/browser/main/tab/page/navigation/base/mod.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use gtk::Button;
|
||||
|
||||
pub fn new() -> Button {
|
||||
Button::builder()
|
||||
.icon_name("go-home-symbolic")
|
||||
.tooltip_text("Base")
|
||||
.sensitive(false)
|
||||
.build()
|
||||
}
|
||||
9
src/browser/main/tab/page/navigation/bookmark/mod.rs
Normal file
9
src/browser/main/tab/page/navigation/bookmark/mod.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use gtk::Button;
|
||||
|
||||
pub fn new() -> Button {
|
||||
Button::builder()
|
||||
.icon_name("starred-symbolic")
|
||||
.tooltip_text("Toggle bookmark")
|
||||
.sensitive(false)
|
||||
.build()
|
||||
}
|
||||
9
src/browser/main/tab/page/navigation/history/back/mod.rs
Normal file
9
src/browser/main/tab/page/navigation/history/back/mod.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use gtk::Button;
|
||||
|
||||
pub fn new() -> Button {
|
||||
Button::builder()
|
||||
.icon_name("go-previous-symbolic")
|
||||
.tooltip_text("Back")
|
||||
.sensitive(false)
|
||||
.build()
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
use gtk::Button;
|
||||
|
||||
pub fn new() -> Button {
|
||||
Button::builder()
|
||||
.icon_name("go-next-symbolic")
|
||||
.tooltip_text("Forward")
|
||||
.sensitive(false)
|
||||
.build()
|
||||
}
|
||||
20
src/browser/main/tab/page/navigation/history/mod.rs
Normal file
20
src/browser/main/tab/page/navigation/history/mod.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
mod back;
|
||||
mod forward;
|
||||
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Box;
|
||||
|
||||
pub fn new() -> Box {
|
||||
let history = Box::builder()
|
||||
.orientation(gtk::Orientation::Horizontal)
|
||||
.css_classes([
|
||||
"linked", // merge childs
|
||||
])
|
||||
.build();
|
||||
|
||||
// Compose childs
|
||||
history.append(&back::new());
|
||||
history.append(&forward::new());
|
||||
|
||||
history
|
||||
}
|
||||
29
src/browser/main/tab/page/navigation/mod.rs
Normal file
29
src/browser/main/tab/page/navigation/mod.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
mod base;
|
||||
mod bookmark;
|
||||
mod history;
|
||||
mod reload;
|
||||
mod request;
|
||||
|
||||
use gtk::prelude::BoxExt;
|
||||
use gtk::Box;
|
||||
|
||||
pub fn new() -> Box {
|
||||
let navigation = Box::builder()
|
||||
// Tuneup
|
||||
.orientation(gtk::Orientation::Horizontal)
|
||||
.spacing(8)
|
||||
.margin_top(8)
|
||||
.margin_start(8)
|
||||
.margin_end(8)
|
||||
.margin_bottom(8)
|
||||
.build();
|
||||
|
||||
// Compose childs
|
||||
navigation.append(&base::new());
|
||||
navigation.append(&history::new());
|
||||
navigation.append(&reload::new());
|
||||
navigation.append(&request::new());
|
||||
navigation.append(&bookmark::new());
|
||||
|
||||
navigation
|
||||
}
|
||||
9
src/browser/main/tab/page/navigation/reload/mod.rs
Normal file
9
src/browser/main/tab/page/navigation/reload/mod.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use gtk::Button;
|
||||
|
||||
pub fn new() -> Button {
|
||||
return Button::builder()
|
||||
.icon_name("view-refresh-symbolic")
|
||||
.tooltip_text("Reload")
|
||||
.sensitive(false)
|
||||
.build();
|
||||
}
|
||||
9
src/browser/main/tab/page/navigation/request/mod.rs
Normal file
9
src/browser/main/tab/page/navigation/request/mod.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use gtk::Entry;
|
||||
|
||||
pub fn new() -> Entry {
|
||||
Entry::builder()
|
||||
.placeholder_text("URL or search term...")
|
||||
.hexpand(true)
|
||||
.progress_pulse_step(0.1)
|
||||
.build()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue