add found tag

This commit is contained in:
yggverse 2024-12-15 12:09:06 +02:00
parent b56b36cb41
commit 1ce46c680b
2 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,4 @@
mod found;
mod h1;
mod h2;
mod h3;
@ -5,6 +6,7 @@ mod list;
mod quote;
mod title;
use found::Found;
use h1::H1;
use h2::H2;
use h3::H3;
@ -23,6 +25,7 @@ pub struct Tag {
pub list: List,
pub quote: Quote,
pub title: Title,
pub found: Found,
}
impl Tag {
@ -35,6 +38,7 @@ impl Tag {
let list = List::new();
let quote = Quote::new();
let title = Title::new();
let found = Found::new();
// Init tag table
let text_tag_table = TextTagTable::new();
@ -45,6 +49,7 @@ impl Tag {
text_tag_table.add(&title.text_tag);
text_tag_table.add(&list.text_tag);
text_tag_table.add(&quote.text_tag);
text_tag_table.add(&found.text_tag);
Self {
text_tag_table,
@ -55,6 +60,7 @@ impl Tag {
list,
quote,
title,
found,
}
}
}

View File

@ -0,0 +1,19 @@
use gtk::{gdk::RGBA, TextTag, WrapMode};
pub struct Found {
pub text_tag: TextTag,
}
impl Found {
// Constructors
/// Create new `Self`
pub fn new() -> Self {
Self {
text_tag: TextTag::builder()
.background_rgba(&RGBA::new(0.502, 0.502, 0.502, 0.5)) // @TODO
.wrap_mode(WrapMode::Word)
.build(),
}
}
}