From cd4270d8bcfb0a4f9d99d8188c51b112350af1f8 Mon Sep 17 00:00:00 2001 From: Kevin Boos <1139460+kevinaboos@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:21:21 -0700 Subject: [PATCH] Update to makepad version that preserves whitespace in HTML (#68) --- Cargo.lock | 60 ++++++++++++++++----------------- src/shared/html_or_plaintext.rs | 6 ++-- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e13e571a..e5dcdb67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1651,7 +1651,7 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jni-sys" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" [[package]] name = "js-sys" @@ -1833,7 +1833,7 @@ dependencies = [ [[package]] name = "makepad-derive-live" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-live-id", "makepad-micro-proc-macro", @@ -1842,7 +1842,7 @@ dependencies = [ [[package]] name = "makepad-derive-wasm-bridge" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-micro-proc-macro", ] @@ -1850,7 +1850,7 @@ dependencies = [ [[package]] name = "makepad-derive-widget" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-live-id", "makepad-micro-proc-macro", @@ -1859,7 +1859,7 @@ dependencies = [ [[package]] name = "makepad-draw" version = "0.6.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "ab_glyph_rasterizer", "makepad-html", @@ -1873,17 +1873,17 @@ dependencies = [ [[package]] name = "makepad-futures" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" [[package]] name = "makepad-futures-legacy" version = "0.7.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" [[package]] name = "makepad-html" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-live-id", ] @@ -1891,12 +1891,12 @@ dependencies = [ [[package]] name = "makepad-http" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" [[package]] name = "makepad-live-compiler" version = "0.5.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-derive-live", "makepad-live-tokenizer", @@ -1906,7 +1906,7 @@ dependencies = [ [[package]] name = "makepad-live-id" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-live-id-macros", ] @@ -1914,7 +1914,7 @@ dependencies = [ [[package]] name = "makepad-live-id-macros" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-micro-proc-macro", ] @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "makepad-live-tokenizer" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-live-id", "makepad-math", @@ -1932,7 +1932,7 @@ dependencies = [ [[package]] name = "makepad-markdown" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-live-id", ] @@ -1940,17 +1940,17 @@ dependencies = [ [[package]] name = "makepad-math" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" [[package]] name = "makepad-micro-proc-macro" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" [[package]] name = "makepad-micro-serde" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-micro-serde-derive", ] @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "makepad-micro-serde-derive" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-micro-proc-macro", ] @@ -1966,12 +1966,12 @@ dependencies = [ [[package]] name = "makepad-objc-sys" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" [[package]] name = "makepad-platform" version = "0.6.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "jni-sys", "makepad-futures", @@ -1987,7 +1987,7 @@ dependencies = [ [[package]] name = "makepad-shader-compiler" version = "0.5.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-live-compiler", ] @@ -1995,7 +1995,7 @@ dependencies = [ [[package]] name = "makepad-vector" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "ttf-parser", ] @@ -2003,7 +2003,7 @@ dependencies = [ [[package]] name = "makepad-wasm-bridge" version = "0.4.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-derive-wasm-bridge", "makepad-live-id", @@ -2012,7 +2012,7 @@ dependencies = [ [[package]] name = "makepad-widgets" version = "0.6.0" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-derive-widget", "makepad-draw", @@ -2025,7 +2025,7 @@ dependencies = [ [[package]] name = "makepad-windows" version = "0.51.1" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "windows-core 0.51.1 (git+https://github.com/makepad/makepad?branch=rik)", "windows-targets", @@ -2034,7 +2034,7 @@ dependencies = [ [[package]] name = "makepad-zune-core" version = "0.2.14" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "bitflags 2.4.1", ] @@ -2042,7 +2042,7 @@ dependencies = [ [[package]] name = "makepad-zune-inflate" version = "0.2.54" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "simd-adler32", ] @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "makepad-zune-jpeg" version = "0.3.17" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-zune-core", ] @@ -2058,7 +2058,7 @@ dependencies = [ [[package]] name = "makepad-zune-png" version = "0.2.1" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "makepad-zune-core", "makepad-zune-inflate", @@ -4777,7 +4777,7 @@ dependencies = [ [[package]] name = "windows-core" version = "0.51.1" -source = "git+https://github.com/makepad/makepad?branch=rik#ab3a96628bff906ee67ace672f5df95ea2d78476" +source = "git+https://github.com/makepad/makepad?branch=rik#1552b853182c940eac19b76026537658bbdd4d5b" dependencies = [ "windows-targets", ] diff --git a/src/shared/html_or_plaintext.rs b/src/shared/html_or_plaintext.rs index da60149a..aa27e130 100644 --- a/src/shared/html_or_plaintext.rs +++ b/src/shared/html_or_plaintext.rs @@ -37,6 +37,7 @@ live_design! { padding: 0.0, line_spacing: (HTML_LINE_SPACING), width: Fill, height: Fit, // see comment in `HtmlOrPlaintext` + keep_whitespace: true, font_size: (MESSAGE_FONT_SIZE), draw_normal: { color: (MESSAGE_TEXT_COLOR), text_style: { height_factor: (HTML_TEXT_HEIGHT_FACTOR), line_spacing: (HTML_LINE_SPACING) } } draw_italic: { color: (MESSAGE_TEXT_COLOR), text_style: { height_factor: (HTML_TEXT_HEIGHT_FACTOR), line_spacing: (HTML_LINE_SPACING) } } @@ -155,8 +156,9 @@ impl LiveHook for MatrixHtmlSpan { if let Some(fg_color) = self.fg_color { self.ll.apply_over(cx, live!{ draw_text: { color: (fg_color) } }); }; - if let Some(bg_color) = self.bg_color { - self.ll.apply_over(cx, live!{ draw_bg: { color: (bg_color) } }); + if let Some(_bg_color) = self.bg_color { + log!("TODO: Html span/font background color is not yet implemented.") + // self.apply_over(cx, live!{ draw_bg: { color: (bg_color) } }); }; // TODO: need to handle labelĀ events to handle the spoiler, so we can toggle it upon click.