mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35: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
28
src/app/browser/window/tab/item/page/search/subject.rs
Normal file
28
src/app/browser/window/tab/item/page/search/subject.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
mod tag;
|
||||
|
||||
use tag::Tag;
|
||||
|
||||
use gtk::{
|
||||
prelude::{TextBufferExt, TextViewExt},
|
||||
TextView,
|
||||
};
|
||||
|
||||
pub struct Subject {
|
||||
pub text_view: TextView,
|
||||
pub tag: Tag,
|
||||
}
|
||||
|
||||
impl Subject {
|
||||
// Constructors
|
||||
|
||||
/// Create new `Self`
|
||||
pub fn new(text_view: TextView) -> Self {
|
||||
// Init components
|
||||
// * create new tag objects required for new buffer,
|
||||
// instead of re-use existing refs (maybe the bug)
|
||||
let tag = Tag::new(text_view.buffer().tag_table());
|
||||
|
||||
// Init `Self`
|
||||
Self { text_view, tag }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue