mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
export entire TextView widget reference to the Search component
This commit is contained in:
parent
e0cb5d7a0f
commit
8b65df99f4
8 changed files with 52 additions and 43 deletions
32
src/app/browser/window/tab/item/page/search/subject/tag.rs
Normal file
32
src/app/browser/window/tab/item/page/search/subject/tag.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
mod current;
|
||||
mod found;
|
||||
|
||||
use gtk::{TextTag, TextTagTable};
|
||||
|
||||
pub struct Tag {
|
||||
pub current: TextTag,
|
||||
pub found: TextTag,
|
||||
}
|
||||
|
||||
impl Tag {
|
||||
// Constructors
|
||||
|
||||
/// Create new `Self`
|
||||
pub fn new(table: TextTagTable) -> Self {
|
||||
// Init components
|
||||
let current = current::new();
|
||||
let found = found::new();
|
||||
|
||||
// Init tag table
|
||||
// keep order as `current` should overwrite `found` tag style
|
||||
// https://docs.gtk.org/gtk4/method.TextTag.set_priority.html
|
||||
for &tag in &[¤t, &found] {
|
||||
if !table.add(tag) {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
// Init `Self`
|
||||
Self { current, found }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
use gtk::{gdk::RGBA, TextTag};
|
||||
|
||||
pub fn new() -> TextTag {
|
||||
TextTag::builder()
|
||||
.background_rgba(&RGBA::new(0.0, 0.4, 0.9, 1.0)) // @TODO use accent colors after adw 1.6 update
|
||||
.foreground_rgba(&RGBA::new(1.0, 1.0, 1.0, 1.0))
|
||||
.build()
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
use gtk::{gdk::RGBA, TextTag};
|
||||
|
||||
pub fn new() -> TextTag {
|
||||
TextTag::builder()
|
||||
.background_rgba(&RGBA::new(0.5, 0.5, 0.5, 0.5)) // @TODO use accent colors after adw 1.6 update
|
||||
.build()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue