mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 08:35:28 +00:00
update preformatted tag style
This commit is contained in:
parent
fb7e00758b
commit
666aa5caf8
1 changed files with 9 additions and 5 deletions
|
|
@ -7,6 +7,8 @@ use gtk::{
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
const REGEX_PRE: &str = r"`(?P<text>[^`]+)`";
|
const REGEX_PRE: &str = r"`(?P<text>[^`]+)`";
|
||||||
|
const TAG_FONT: &str = "monospace"; // @TODO
|
||||||
|
const TAG_SCALE: f64 = 0.9;
|
||||||
|
|
||||||
pub struct Pre(TextTag);
|
pub struct Pre(TextTag);
|
||||||
|
|
||||||
|
|
@ -14,15 +16,17 @@ impl Pre {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self(if adw::StyleManager::default().is_dark() {
|
Self(if adw::StyleManager::default().is_dark() {
|
||||||
TextTag::builder()
|
TextTag::builder()
|
||||||
.background_rgba(&RGBA::new(0.0, 0.0, 0.0, 1.))
|
.background_rgba(&RGBA::new(255., 255., 255., 0.05))
|
||||||
.foreground("#ccc")
|
.family(TAG_FONT)
|
||||||
.family("monospace") // @TODO
|
.foreground("#e8e8e8")
|
||||||
|
.scale(TAG_SCALE)
|
||||||
.wrap_mode(Word)
|
.wrap_mode(Word)
|
||||||
.build()
|
.build()
|
||||||
} else {
|
} else {
|
||||||
TextTag::builder()
|
TextTag::builder()
|
||||||
.background_rgba(&RGBA::new(0.0, 0.0, 0.0, 0.06))
|
.background_rgba(&RGBA::new(0., 0., 0., 0.06))
|
||||||
.family("monospace") // @TODO
|
.family(TAG_FONT)
|
||||||
|
.scale(TAG_SCALE)
|
||||||
.wrap_mode(Word)
|
.wrap_mode(Word)
|
||||||
.build()
|
.build()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue