mirror of
https://github.com/danbulant/cushy
synced 2026-06-12 02:50:25 +00:00
Bug fixes
This commit is contained in:
parent
15480ba68b
commit
b63e4d66d2
4 changed files with 17 additions and 3 deletions
|
|
@ -17,8 +17,8 @@ use kludgine::{Color, Kludgine};
|
|||
use crate::context::sealed::WindowHandle;
|
||||
use crate::graphics::Graphics;
|
||||
use crate::styles::components::{
|
||||
CornerRadius, FontFamily, FontStyle, FontWeight, HighlightColor, LayoutOrder, TextSize,
|
||||
WidgetBackground,
|
||||
CornerRadius, FontFamily, FontStyle, FontWeight, HighlightColor, LayoutOrder, LineHeight,
|
||||
TextSize, WidgetBackground,
|
||||
};
|
||||
use crate::styles::{ComponentDefinition, Styles, Theme, ThemePair};
|
||||
use crate::utils::IgnorePoison;
|
||||
|
|
@ -618,6 +618,7 @@ impl<'context, 'window, 'clip, 'gfx, 'pass> GraphicsContext<'context, 'window, '
|
|||
self.gfx
|
||||
.set_available_font_family(&self.widget.get(&FontFamily));
|
||||
self.gfx.set_font_size(self.widget.get(&TextSize));
|
||||
self.gfx.set_line_height(self.widget.get(&LineHeight));
|
||||
self.gfx.set_font_style(self.widget.get(&FontStyle));
|
||||
self.gfx.set_font_weight(self.widget.get(&FontWeight));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1099,6 +1099,18 @@ impl IntoValue<Edges<Dimension>> for Lp {
|
|||
}
|
||||
}
|
||||
|
||||
impl IntoValue<Dimension> for Px {
|
||||
fn into_value(self) -> Value<Dimension> {
|
||||
Dimension::from(self).into_value()
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoValue<Dimension> for Lp {
|
||||
fn into_value(self) -> Value<Dimension> {
|
||||
Dimension::from(self).into_value()
|
||||
}
|
||||
}
|
||||
|
||||
/// A set of light and dark [`Theme`]s.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ThemePair {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ impl Label {
|
|||
|| ((*prepared_width < width || prepared.size.width <= width)
|
||||
&& prepared.line_height == prepared.size.height)) => {}
|
||||
_ => {
|
||||
context.apply_current_font_settings();
|
||||
let measured = self.text.map(|text| {
|
||||
context
|
||||
.gfx
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ impl Widget for Scroll {
|
|||
MouseScrollDelta::LineDelta(x, y) => Point::new(x, y) * self.line_height.into_float(),
|
||||
MouseScrollDelta::PixelDelta(px) => Point::new(px.x.cast(), px.y.cast()),
|
||||
};
|
||||
|
||||
context.invalidate_when_changed(&self.scroll);
|
||||
let mut scroll = self.scroll.lock();
|
||||
let old_scroll = *scroll;
|
||||
let new_scroll = Self::constrained_scroll(*scroll + amount.cast(), self.max_scroll.get());
|
||||
|
|
|
|||
Loading…
Reference in a new issue