yog-ui 0.42.0
“Yog UI framework — flexbox and WPF-style grid layout + GPU rendering via yog-gfx”
Backtick shell command-substitution syntaxBasename is uppercase README.md
SHA-2561dee269c2c1a318cd14b03440a120324441cb339e569509acb5562828ed05120
MaleculeH(Db₂)Md₂(InPa)
Evidence
32:67… `y`, `w`,
33//! `h`, `bg`, `on_click`, ...).
34
35use std::collections::HashMap;
36use std::sync::{Mutex, PoisonError};
37
38use crate::FlexDir;
39use crate::widget::{self, Widget};
40
41/// A property's type: how `.yui` writes it and how the designer edits it.
42#[derive(Debug, Clone, Copy, Par …
536:24… trip_prefix("0X"))?
537 .replace('_', "");
538 let n = u32::from_str_radix(&hex, 16).ok()?;
539 match hex.len() {
540 6 => Some(0xFF00_0000 | n),
⋯6 lines
558:58… rs `false` and an
559/// error message.
560pub mod designer {
561 use std::ffi::c_void;
562 use std::fmt::Write as _;
563 use std::panic::{AssertUnwindSafe, catch_unwind};
564
565 use yog_abi::{YogGfxApi, YogStr};
566 use yog_gfx::GfxContext;
567
568 use super::{COMMON_ATTRS, PropKind, Props, apply_style, components, find};
569 use crate::widget::{self, Widget};
570 use crate::{FlexDir, UiRoot, Units};
571
572 /// Version of this protocol; the designer host refuses others.
573 pub const ABI: u32 = …
763:42… nd `\n` escaped.
764 pub fn escape(v: &str) -> String {
765 v.replace('\\', "\\\\").replace('\n', "\\n")
766 }
767}
768
769#[cfg(test)]
770mod tests {
771 use super::*;
772
773 struct Badge;
774 impl Component for Badge {
775 const NAME: &'static str = "TestBadge"; …
785:36… )
786 .padding(1.0, 2.0, 1.0, 2.0)
787 }
788 }
789
790 #[test]
791 fn props_fall_back_to_defaults() {
792 let p = Props::new(Badge::PROPS, &[("label", "@@x"), ("n", " 2.5 ")]);
793 assert_eq!(p.text("label"), "@x");
794 assert_eq!(p.color("fill"), 0xFF3060C0);
795 assert_eq!(p.w …
No evidence locations were recorded for this file. Raw result