Checkpoint
This commit is contained in:
parent
0307cb8a88
commit
9ec7569e09
10 changed files with 217 additions and 130 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::{
|
||||
elements::AnyRootElement,
|
||||
fonts::TextStyle,
|
||||
fonts::{TextStyle, TextStyleRefinement},
|
||||
geometry::{rect::RectF, Size},
|
||||
json::ToJson,
|
||||
keymap_matcher::{Binding, KeymapContext, Keystroke, MatchResult},
|
||||
|
@ -235,6 +235,10 @@ impl<'a> WindowContext<'a> {
|
|||
.push_back(Effect::RepaintWindow { window });
|
||||
}
|
||||
|
||||
pub fn rem_size(&self) -> f32 {
|
||||
16.
|
||||
}
|
||||
|
||||
pub fn layout_engine(&mut self) -> Option<&mut LayoutEngine> {
|
||||
self.window.layout_engines.last_mut()
|
||||
}
|
||||
|
@ -1284,8 +1288,14 @@ impl<'a> WindowContext<'a> {
|
|||
.unwrap_or(TextStyle::default(&self.font_cache))
|
||||
}
|
||||
|
||||
pub fn push_text_style(&mut self, style: TextStyle) {
|
||||
pub fn push_text_style(&mut self, refinement: &TextStyleRefinement) -> Result<()> {
|
||||
let mut style = self.text_style();
|
||||
style.refine(refinement, self.font_cache())?;
|
||||
|
||||
dbg!(&style);
|
||||
|
||||
self.window.text_style_stack.push(style);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn pop_text_style(&mut self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue