process_list::View done

This commit is contained in:
Aleksander
2025-12-21 16:00:54 +01:00
parent 5462e84995
commit 848674c143
29 changed files with 519 additions and 50 deletions

View File

@@ -443,7 +443,7 @@ pub fn construct(ess: &mut ConstructEssentials, params: Params) -> anyhow::Resul
if let Some(sprite_path) = params.sprite_src {
let sprite = WidgetSprite::create(WidgetSpriteParams {
glyph_data: Some(CustomGlyphData::new(CustomGlyphContent::from_assets(
&mut globals,
&globals,
sprite_path,
)?)),
..Default::default()
@@ -457,7 +457,7 @@ pub fn construct(ess: &mut ConstructEssentials, params: Params) -> anyhow::Resul
width: length(20.0),
height: length(20.0),
},
margin: default_margin.clone(),
margin: default_margin,
..Default::default()
},
)?;

View File

@@ -32,7 +32,7 @@ pub fn parse_widget_sprite<'a>(
};
if !value.is_empty() {
glyph = match CustomGlyphContent::from_assets(&mut ctx.layout.state.globals, asset_path) {
glyph = match CustomGlyphContent::from_assets(&ctx.layout.state.globals, asset_path) {
Ok(glyph) => Some(glyph),
Err(e) => {
log::warn!("failed to load {value}: {e}");

View File

@@ -38,7 +38,7 @@ impl CustomGlyphContent {
}
#[allow(clippy::case_sensitive_file_extension_comparisons)]
pub fn from_assets(globals: &mut WguiGlobals, path: AssetPath) -> anyhow::Result<Self> {
pub fn from_assets(globals: &WguiGlobals, path: AssetPath) -> anyhow::Result<Self> {
let path_str = path.get_str();
let data = globals.get_asset(path)?;
if path_str.ends_with(".svg") || path_str.ends_with(".svgz") {