@effindomv2/fui-rs 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "fui-rs"
3
- version = "0.1.11"
3
+ version = "0.1.12"
4
4
  edition = "2021"
5
5
  license = "AGPL-3.0-only OR LicenseRef-EffinDom-Commercial"
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effindomv2/fui-rs",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "private": false,
5
5
  "license": "AGPL-3.0-only OR LicenseRef-EffinDom-Commercial",
6
6
  "description": "EffinDom v2 Rust frontend framework SDK and host generators",
@@ -279,6 +279,10 @@ impl TextNode {
279
279
  self
280
280
  }
281
281
 
282
+ pub fn max_lines(&self, max_lines: i32) -> &Self {
283
+ self.text_limits(i32::MAX, max_lines)
284
+ }
285
+
282
286
  pub fn wrapping(&self, wrap: bool) -> &Self {
283
287
  self.props.borrow_mut().wrapping = Some(wrap);
284
288
  if self.has_built_handle() {
package/src/text.rs CHANGED
@@ -962,6 +962,21 @@ mod tests {
962
962
  .any(|call| matches!(call, Call::SetTextStyleRuns { run_count: 2, .. })));
963
963
  }
964
964
 
965
+ #[test]
966
+ fn rich_text_inherits_fui_as_max_lines_surface() {
967
+ ffi::test::reset();
968
+ let node = RichText::from_text("One line");
969
+ node.max_lines(1).build();
970
+ assert!(ffi::test::take_calls().iter().any(|call| matches!(
971
+ call,
972
+ Call::SetTextLimits {
973
+ max_chars,
974
+ max_lines,
975
+ ..
976
+ } if *max_chars == i32::MAX && *max_lines == 1
977
+ )));
978
+ }
979
+
965
980
  #[test]
966
981
  fn text_layout_waits_for_loaded_and_fonts_before_reporting_ready() {
967
982
  ffi::test::reset();