diff --git a/Cargo.lock b/Cargo.lock index 89c2a4693..0d1a8a522 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,7 @@ version = 4 [[package]] name = "ab_glyph_rasterizer" version = "0.1.8" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "accessory" @@ -610,7 +610,7 @@ dependencies = [ [[package]] name = "bitflags" version = "2.10.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "bitmaps" @@ -728,7 +728,7 @@ checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytemuck" version = "1.25.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "byteorder" @@ -739,7 +739,7 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "byteorder" version = "1.5.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "bytes" @@ -1936,9 +1936,9 @@ dependencies = [ [[package]] name = "fxhash" version = "0.2.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ - "byteorder 1.5.0 (git+https://github.com/makepad/makepad?branch=dev)", + "byteorder 1.5.0 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", ] [[package]] @@ -2175,9 +2175,9 @@ checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" [[package]] name = "hilog-sys" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51434915c43a27465a1806e65273b52293feb27cfd28ee1996c5c2b37eecfffe" +checksum = "96b1d492766a538e49020f97af3e91e0acb718b3b008ed4ab6d39374f42b3e83" [[package]] name = "hkdf" @@ -2953,7 +2953,7 @@ dependencies = [ [[package]] name = "makepad-apple-sys" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-objc-sys", ] @@ -2961,12 +2961,12 @@ dependencies = [ [[package]] name = "makepad-byteorder-lite" version = "0.1.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-code-editor" version = "2.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-widgets", ] @@ -2974,7 +2974,7 @@ dependencies = [ [[package]] name = "makepad-derive-wasm-bridge" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-micro-proc-macro", ] @@ -2982,7 +2982,7 @@ dependencies = [ [[package]] name = "makepad-derive-widget" version = "2.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-live-id", "makepad-micro-proc-macro", @@ -2991,7 +2991,7 @@ dependencies = [ [[package]] name = "makepad-draw" version = "2.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "ab_glyph_rasterizer", "fxhash", @@ -3005,15 +3005,15 @@ dependencies = [ "rustybuzz", "sdfer", "serde", - "unicode-bidi 0.3.18 (git+https://github.com/makepad/makepad?branch=dev)", + "unicode-bidi 0.3.18 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", "unicode-linebreak", - "unicode-segmentation 1.12.0 (git+https://github.com/makepad/makepad?branch=dev)", + "unicode-segmentation 1.12.0 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", ] [[package]] name = "makepad-error-log" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-micro-serde", ] @@ -3021,22 +3021,22 @@ dependencies = [ [[package]] name = "makepad-filesystem-watcher" version = "0.1.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-futures" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-futures-legacy" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-html" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-live-id", ] @@ -3050,7 +3050,7 @@ checksum = "9775cbec5fa0647500c3e5de7c850280a88335d1d2d770e5aa2332b801ba7064" [[package]] name = "makepad-latex-math" version = "0.1.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "ttf-parser", ] @@ -3058,7 +3058,7 @@ dependencies = [ [[package]] name = "makepad-live-id" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-live-id-macros", "serde", @@ -3067,7 +3067,7 @@ dependencies = [ [[package]] name = "makepad-live-id-macros" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-micro-proc-macro", ] @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "makepad-live-reload-core" version = "0.1.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-filesystem-watcher", ] @@ -3083,7 +3083,7 @@ dependencies = [ [[package]] name = "makepad-math" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-micro-serde", ] @@ -3091,12 +3091,12 @@ dependencies = [ [[package]] name = "makepad-micro-proc-macro" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-micro-serde" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-live-id", "makepad-micro-serde-derive", @@ -3105,7 +3105,7 @@ dependencies = [ [[package]] name = "makepad-micro-serde-derive" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-micro-proc-macro", ] @@ -3113,7 +3113,7 @@ dependencies = [ [[package]] name = "makepad-network" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-apple-sys", "makepad-error-log", @@ -3127,15 +3127,15 @@ dependencies = [ [[package]] name = "makepad-objc-sys" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-platform" version = "2.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "ash", - "bitflags 2.10.0 (git+https://github.com/makepad/makepad?branch=dev)", + "bitflags 2.10.0 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", "hilog-sys", "makepad-android-state", "makepad-apple-sys", @@ -3155,7 +3155,7 @@ dependencies = [ "napi-derive-ohos", "napi-ohos", "ohos-sys", - "smallvec 1.15.1 (git+https://github.com/makepad/makepad?branch=dev)", + "smallvec 1.15.1 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", "wayland-client", "wayland-egl", "wayland-protocols", @@ -3167,12 +3167,12 @@ dependencies = [ [[package]] name = "makepad-regex" version = "0.1.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-script" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-error-log", "makepad-html", @@ -3180,13 +3180,13 @@ dependencies = [ "makepad-math", "makepad-regex", "makepad-script-derive", - "smallvec 1.15.1 (git+https://github.com/makepad/makepad?branch=dev)", + "smallvec 1.15.1 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", ] [[package]] name = "makepad-script-derive" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-micro-proc-macro", ] @@ -3194,7 +3194,7 @@ dependencies = [ [[package]] name = "makepad-script-std" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-network", "makepad-script", @@ -3203,14 +3203,14 @@ dependencies = [ [[package]] name = "makepad-shared-bytes" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-studio-protocol" version = "0.1.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ - "bitflags 2.10.0 (git+https://github.com/makepad/makepad?branch=dev)", + "bitflags 2.10.0 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", "makepad-error-log", "makepad-live-id", "makepad-micro-serde", @@ -3220,7 +3220,7 @@ dependencies = [ [[package]] name = "makepad-svg" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-html", "makepad-live-id", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "makepad-wasm-bridge" version = "1.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-derive-wasm-bridge", "makepad-live-id", @@ -3238,7 +3238,7 @@ dependencies = [ [[package]] name = "makepad-webp" version = "0.2.4" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-byteorder-lite", ] @@ -3246,7 +3246,7 @@ dependencies = [ [[package]] name = "makepad-widgets" version = "2.0.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-derive-widget", "makepad-draw", @@ -3255,18 +3255,18 @@ dependencies = [ "pulldown-cmark 0.12.2", "serde", "ttf-parser", - "unicode-segmentation 1.12.0 (git+https://github.com/makepad/makepad?branch=dev)", + "unicode-segmentation 1.12.0 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", ] [[package]] name = "makepad-zune-core" version = "0.5.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "makepad-zune-inflate" version = "0.2.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "simd-adler32", ] @@ -3274,7 +3274,7 @@ dependencies = [ [[package]] name = "makepad-zune-jpeg" version = "0.5.12" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-zune-core", ] @@ -3282,7 +3282,7 @@ dependencies = [ [[package]] name = "makepad-zune-png" version = "0.5.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "makepad-zune-core", "makepad-zune-inflate", @@ -3678,7 +3678,7 @@ checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "memchr" version = "2.7.6" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "mime" @@ -4410,10 +4410,10 @@ dependencies = [ [[package]] name = "pulldown-cmark" version = "0.12.2" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ - "bitflags 2.10.0 (git+https://github.com/makepad/makepad?branch=dev)", - "memchr 2.7.6 (git+https://github.com/makepad/makepad?branch=dev)", + "bitflags 2.10.0 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", + "memchr 2.7.6 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", "unicase 2.9.0", ] @@ -5172,12 +5172,12 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "rustybuzz" version = "0.18.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ - "bitflags 2.10.0 (git+https://github.com/makepad/makepad?branch=dev)", + "bitflags 2.10.0 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", "bytemuck", "makepad-error-log", - "smallvec 1.15.1 (git+https://github.com/makepad/makepad?branch=dev)", + "smallvec 1.15.1 (git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets)", "ttf-parser", "unicode-bidi-mirroring", "unicode-ccc", @@ -5272,7 +5272,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sdfer" version = "0.2.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "sealed" @@ -5571,7 +5571,7 @@ dependencies = [ [[package]] name = "simd-adler32" version = "0.3.8" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "siphasher" @@ -5597,7 +5597,7 @@ dependencies = [ [[package]] name = "smallvec" version = "1.15.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "socket2" @@ -6363,7 +6363,7 @@ dependencies = [ [[package]] name = "ttf-parser" version = "0.24.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "tungstenite" @@ -6424,7 +6424,7 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicase" version = "2.9.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "unicode-bidi" @@ -6435,17 +6435,17 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-bidi" version = "0.3.18" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "unicode-bidi-mirroring" version = "0.3.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "unicode-ccc" version = "0.3.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "unicode-ident" @@ -6456,7 +6456,7 @@ checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-linebreak" version = "0.1.5" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "unicode-normalization" @@ -6476,12 +6476,12 @@ checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] name = "unicode-properties" version = "0.1.4" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "unicode-script" version = "0.5.8" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "unicode-segmentation" @@ -6492,7 +6492,7 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-segmentation" version = "1.12.0" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "unicode-width" @@ -6772,7 +6772,7 @@ dependencies = [ [[package]] name = "wayland-backend" version = "0.3.12" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "downcast-rs", "libc", @@ -6784,7 +6784,7 @@ dependencies = [ [[package]] name = "wayland-client" version = "0.31.12" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "bitflags 2.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc", @@ -6794,7 +6794,7 @@ dependencies = [ [[package]] name = "wayland-egl" version = "0.32.9" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "wayland-backend", "wayland-sys", @@ -6803,7 +6803,7 @@ dependencies = [ [[package]] name = "wayland-protocols" version = "0.32.10" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "bitflags 2.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-backend", @@ -6813,7 +6813,7 @@ dependencies = [ [[package]] name = "wayland-sys" version = "0.31.8" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "log", "pkg-config", @@ -6912,7 +6912,7 @@ dependencies = [ [[package]] name = "windows" version = "0.62.2" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "windows-collections 0.3.2", "windows-core 0.62.2", @@ -6931,7 +6931,7 @@ dependencies = [ [[package]] name = "windows-collections" version = "0.3.2" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "windows-core 0.62.2", ] @@ -6964,7 +6964,7 @@ dependencies = [ [[package]] name = "windows-core" version = "0.62.2" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "windows-link 0.2.1", "windows-result 0.4.1", @@ -6985,7 +6985,7 @@ dependencies = [ [[package]] name = "windows-future" version = "0.3.2" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "windows-core 0.62.2", ] @@ -7049,7 +7049,7 @@ checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" [[package]] name = "windows-link" version = "0.2.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" [[package]] name = "windows-numerics" @@ -7093,7 +7093,7 @@ dependencies = [ [[package]] name = "windows-result" version = "0.4.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "windows-link 0.2.1", ] @@ -7110,7 +7110,7 @@ dependencies = [ [[package]] name = "windows-strings" version = "0.5.1" -source = "git+https://github.com/makepad/makepad?branch=dev#66075ff67f3912fc94eb473ee37042a63cc66d60" +source = "git+https://github.com/kevinaboos/makepad?branch=device_bounds_safe_area_insets#2a00b94d973bb342c61b25e24e9e2e2fe741e4ff" dependencies = [ "windows-link 0.2.1", ] diff --git a/Cargo.toml b/Cargo.toml index daf7ba9e2..645db4be1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,8 @@ version = "0.0.1-pre-alpha-4" metadata.makepad-auto-version = "zqpv-Yj-K7WNVK2I8h5Okhho46Q=" [dependencies] -makepad-widgets = { git = "https://github.com/makepad/makepad", branch = "dev", features = ["serde"] } -makepad-code-editor = { git = "https://github.com/makepad/makepad", branch = "dev" } +makepad-widgets = { git = "https://github.com/kevinaboos/makepad", branch = "device_bounds_safe_area_insets", features = ["serde"] } +makepad-code-editor = { git = "https://github.com/kevinaboos/makepad", branch = "device_bounds_safe_area_insets" } ## Including this crate automatically configures all `robius-*` crates to work with Makepad. diff --git a/src/app.rs b/src/app.rs index b5df23ff8..19857013c 100644 --- a/src/app.rs +++ b/src/app.rs @@ -54,7 +54,12 @@ script_mod! { body +: { - padding: 0, + padding: Inset{ + top: (mod.widgets.SAFE_INSET_PAD_TOP), + bottom: (mod.widgets.SAFE_INSET_PAD_BOTTOM), + left: (mod.widgets.SAFE_INSET_PAD_LEFT), + right: (mod.widgets.SAFE_INSET_PAD_RIGHT), + } View { width: Fill, height: Fill, @@ -216,13 +221,28 @@ impl MatchEvent for App { error!("Failed to load window state: {}", e); } - // Hide the caption bar on macOS and Linux, which use native window chrome. + // On Linux, hide the caption bar because it uses native window chrome. // On Windows (with custom chrome), the caption bar is needed. - if matches!(cx.os_type(), OsType::Macos | OsType::LinuxWindow(_) | OsType::LinuxDirect) { - let mut window = self.ui.window(cx, ids!(main_window)); - script_apply_eval!(cx, window, { - show_caption_bar: false - }); + // On macOS, we currently show the caption bar to make spacing easy, but it's not technically needed. + // If we remove it on macOS, we'd need to add a bit of padding in its place. + match cx.os_type() { + OsType::LinuxWindow(_) | OsType::LinuxDirect => { + let mut window = self.ui.window(cx, ids!(main_window)); + script_apply_eval!(cx, window, { + show_caption_bar: false + }); + } + OsType::Macos => { + // Newer macOS versions have a larger traffic light button layout, + // so we make the title bar larger to make the buttons vertically centered. + // TODO: upstream this into Makepad by querying the actual size of + // the traffic light buttons on macOS and setting the caption bar height accordingly. + let mut caption_bar = self.ui.view(cx, ids!(main_window.caption_bar)); + script_apply_eval!(cx, caption_bar, { + height: 34.0 + }); + } + _ => {} } self.update_login_visibility(cx); @@ -305,7 +325,8 @@ impl MatchEvent for App { self.update_login_visibility(cx); self.ui.redraw(cx); } - continue; + // Do NOT continue here — let the action propagate to the LoginScreen widget, + // which will open the login_status_modal to show the failure message. } // Handle an action requesting to open the new message context menu. diff --git a/src/home/add_room.rs b/src/home/add_room.rs index 981369897..904b4b142 100644 --- a/src/home/add_room.rs +++ b/src/home/add_room.rs @@ -12,7 +12,6 @@ script_mod! { use mod.widgets.* - // The main view that allows the user to add (join) or explore new rooms/spaces. mod.widgets.AddRoomScreen = #(AddRoomScreen::register_widget(vm)) { ..mod.widgets.ScrollYView @@ -22,11 +21,6 @@ script_mod! { padding: Inset{top: 5, left: 15, right: 15, bottom: 0}, title := TitleLabel { - flow: Flow.Right{wrap: true}, - draw_text +: { - text_style: TITLE_TEXT {font_size: 13}, - color: #000 - } text: "Add/Explore Rooms and Spaces" draw_text +: { text_style: theme.font_regular {font_size: 18}, diff --git a/src/home/home_screen.rs b/src/home/home_screen.rs index 5fcd8c297..230b907b2 100644 --- a/src/home/home_screen.rs +++ b/src/home/home_screen.rs @@ -20,7 +20,7 @@ script_mod! { // Defines the total height of the StackNavigationView's header. // This has to be set in multiple places because of how StackNavigation // uses an Overlay view internally. - mod.widgets.STACK_VIEW_HEADER_HEIGHT = 75 + mod.widgets.STACK_VIEW_HEADER_HEIGHT = 45 // A reusable base for StackNavigationView children in the mobile layout. // Each specific content view (room, invite, space lobby) extends this @@ -29,6 +29,11 @@ script_mod! { width: Fill, height: Fill draw_bg.color: (COLOR_PRIMARY) header +: { + height: (mod.widgets.STACK_VIEW_HEADER_HEIGHT), + padding: 0 + align: Align{y: 0.5} + + // Below is a shader to draw a shadow under the bottom half of the header clip_x: false, clip_y: false, show_bg: true, @@ -45,8 +50,8 @@ script_mod! { border_color_2: instance(vec4(-1)) shadow_color: instance(#0005) - shadow_radius: uniform(9.0) - shadow_offset: uniform(vec2(1.0, 0.0)) + shadow_radius: uniform(12.0) + shadow_offset: uniform(vec2(0.0, 0.0)) rect_size2: varying(vec2(0)) rect_size3: varying(vec2(0)) @@ -95,7 +100,11 @@ script_mod! { let m = self.shadow_radius let o = self.shadow_offset + self.rect_shift let v = GaussShadow.rounded_box_shadow(vec2(m) + o self.rect_size2+o self.pos * (self.rect_size3+vec2(m)) self.shadow_radius*0.5 self.border_radius*2.0) - sdf.clear(self.shadow_color*v) + // Only draw shadow on the bottom half of the view + let pixel_y = self.pos.y * self.rect_size3.y + let mid_y = self.sdf_rect_pos.y + self.sdf_rect_size.y * 0.5 + let bottom_mask = smoothstep(mid_y - m * 0.3 mid_y + m * 0.3 pixel_y) + sdf.clear(self.shadow_color * v * bottom_mask) } sdf.fill_keep(fill_color) @@ -107,11 +116,9 @@ script_mod! { } } - padding: Inset{top: 30, bottom: 0} - height: (mod.widgets.STACK_VIEW_HEADER_HEIGHT), - content +: { height: (mod.widgets.STACK_VIEW_HEADER_HEIGHT) + align: Align{y: 0.5} button_container +: { padding: 0, margin: 0 @@ -126,7 +133,7 @@ script_mod! { } } title_container +: { - padding: Inset{top: 8} + // padding: Inset{top: 8} title +: { draw_text +: { color: (ROOM_NAME_TEXT_COLOR) @@ -269,99 +276,97 @@ script_mod! { draw_bg.color: (COLOR_PRIMARY) view_stack := StackNavigation { - root_view +: { - flow: Down - width: Fill, height: Fill + root_view +: { + flow: Down + width: Fill, height: Fill - // At the top of the root view, we use the PageFlip widget to show either - // the main list of rooms or the settings screen. - home_screen_page_flip := PageFlip { - width: Fill, height: Fill + // At the top of the root view, we use the PageFlip widget to show either + // the main list of rooms or the settings screen. + home_screen_page_flip := PageFlip { + width: Fill, height: Fill - lazy_init: true, - active_page: @home_page + lazy_init: true, + active_page: @home_page - home_page := View { - width: Fill, height: Fill - // Note: while the other page views have top padding, we do NOT add that here - // because it is added in the `RoomsSideBar`'s `RoundedShadowView` itself. - flow: Down + home_page := View { + width: Fill, height: Fill + // Note: while the other page views have top padding, we do NOT add that here + // because it is added in the `RoomsSideBar`'s `RoundedShadowView` itself. + flow: Down - mod.widgets.RoomsSideBar {} - } + mod.widgets.RoomsSideBar {} + } - settings_page := View { - width: Fill, height: Fill - padding: Inset{top: 20} + settings_page := View { + width: Fill, height: Fill - CachedWidget { - settings_screen := mod.widgets.SettingsScreen {} - } + CachedWidget { + settings_screen := mod.widgets.SettingsScreen {} } + } - add_room_page := View { - width: Fill, height: Fill - padding: Inset{top: 20} + add_room_page := View { + width: Fill, height: Fill - CachedWidget { - add_room_screen := mod.widgets.AddRoomScreen {} - } + CachedWidget { + add_room_screen := mod.widgets.AddRoomScreen {} } } + } - // Show the SpacesBar right above the navigation tab bar. - // We wrap it in the SpacesBarWrapper in order to animate it in or out, - // and wrap *that* in a CachedWidget in order to maintain its shown/hidden state - // across AdaptiveView transitions between Mobile view mode and Desktop view mode. - // - // ... Then we wrap *that* in a ... - CachedWidget { - spaces_bar_wrapper := mod.widgets.SpacesBarWrapper {} - } + // Show the SpacesBar right above the navigation tab bar. + // We wrap it in the SpacesBarWrapper in order to animate it in or out, + // and wrap *that* in a CachedWidget in order to maintain its shown/hidden state + // across AdaptiveView transitions between Mobile view mode and Desktop view mode. + // + // ... Then we wrap *that* in a ... + CachedWidget { + spaces_bar_wrapper := mod.widgets.SpacesBarWrapper {} + } - // At the bottom of the root view, show the navigation tab bar horizontally. - CachedWidget { - navigation_tab_bar := mod.widgets.NavigationTabBar {} - } + // At the bottom of the root view, show the navigation tab bar horizontally. + CachedWidget { + navigation_tab_bar := mod.widgets.NavigationTabBar {} } + } - // Room views: multiple instances to support deep stacking - // (e.g., room -> thread -> room -> thread -> ...). - // Each stack depth gets its own dedicated view widget, - // avoiding complex state save/restore when views are reused. - room_view_0 := mod.widgets.RobrixContentView { body +: { room_screen_0 := mod.widgets.RoomScreen {} } } - room_view_1 := mod.widgets.RobrixContentView { body +: { room_screen_1 := mod.widgets.RoomScreen {} } } - room_view_2 := mod.widgets.RobrixContentView { body +: { room_screen_2 := mod.widgets.RoomScreen {} } } - room_view_3 := mod.widgets.RobrixContentView { body +: { room_screen_3 := mod.widgets.RoomScreen {} } } - room_view_4 := mod.widgets.RobrixContentView { body +: { room_screen_4 := mod.widgets.RoomScreen {} } } - room_view_5 := mod.widgets.RobrixContentView { body +: { room_screen_5 := mod.widgets.RoomScreen {} } } - room_view_6 := mod.widgets.RobrixContentView { body +: { room_screen_6 := mod.widgets.RoomScreen {} } } - room_view_7 := mod.widgets.RobrixContentView { body +: { room_screen_7 := mod.widgets.RoomScreen {} } } - room_view_8 := mod.widgets.RobrixContentView { body +: { room_screen_8 := mod.widgets.RoomScreen {} } } - room_view_9 := mod.widgets.RobrixContentView { body +: { room_screen_9 := mod.widgets.RoomScreen {} } } - room_view_10 := mod.widgets.RobrixContentView { body +: { room_screen_10 := mod.widgets.RoomScreen {} } } - room_view_11 := mod.widgets.RobrixContentView { body +: { room_screen_11 := mod.widgets.RoomScreen {} } } - room_view_12 := mod.widgets.RobrixContentView { body +: { room_screen_12 := mod.widgets.RoomScreen {} } } - room_view_13 := mod.widgets.RobrixContentView { body +: { room_screen_13 := mod.widgets.RoomScreen {} } } - room_view_14 := mod.widgets.RobrixContentView { body +: { room_screen_14 := mod.widgets.RoomScreen {} } } - room_view_15 := mod.widgets.RobrixContentView { body +: { room_screen_15 := mod.widgets.RoomScreen {} } } - - invite_view := mod.widgets.RobrixContentView { - body +: { - invite_screen := mod.widgets.InviteScreen {} - } + // Room views: multiple instances to support deep stacking + // (e.g., room -> thread -> room -> thread -> ...). + // Each stack depth gets its own dedicated view widget, + // avoiding complex state save/restore when views are reused. + room_view_0 := mod.widgets.RobrixContentView { body +: { room_screen_0 := mod.widgets.RoomScreen {} } } + room_view_1 := mod.widgets.RobrixContentView { body +: { room_screen_1 := mod.widgets.RoomScreen {} } } + room_view_2 := mod.widgets.RobrixContentView { body +: { room_screen_2 := mod.widgets.RoomScreen {} } } + room_view_3 := mod.widgets.RobrixContentView { body +: { room_screen_3 := mod.widgets.RoomScreen {} } } + room_view_4 := mod.widgets.RobrixContentView { body +: { room_screen_4 := mod.widgets.RoomScreen {} } } + room_view_5 := mod.widgets.RobrixContentView { body +: { room_screen_5 := mod.widgets.RoomScreen {} } } + room_view_6 := mod.widgets.RobrixContentView { body +: { room_screen_6 := mod.widgets.RoomScreen {} } } + room_view_7 := mod.widgets.RobrixContentView { body +: { room_screen_7 := mod.widgets.RoomScreen {} } } + room_view_8 := mod.widgets.RobrixContentView { body +: { room_screen_8 := mod.widgets.RoomScreen {} } } + room_view_9 := mod.widgets.RobrixContentView { body +: { room_screen_9 := mod.widgets.RoomScreen {} } } + room_view_10 := mod.widgets.RobrixContentView { body +: { room_screen_10 := mod.widgets.RoomScreen {} } } + room_view_11 := mod.widgets.RobrixContentView { body +: { room_screen_11 := mod.widgets.RoomScreen {} } } + room_view_12 := mod.widgets.RobrixContentView { body +: { room_screen_12 := mod.widgets.RoomScreen {} } } + room_view_13 := mod.widgets.RobrixContentView { body +: { room_screen_13 := mod.widgets.RoomScreen {} } } + room_view_14 := mod.widgets.RobrixContentView { body +: { room_screen_14 := mod.widgets.RoomScreen {} } } + room_view_15 := mod.widgets.RobrixContentView { body +: { room_screen_15 := mod.widgets.RoomScreen {} } } + + invite_view := mod.widgets.RobrixContentView { + body +: { + invite_screen := mod.widgets.InviteScreen {} } + } - space_lobby_view := mod.widgets.RobrixContentView { - body +: { - space_lobby_screen := mod.widgets.SpaceLobbyScreen {} - } + space_lobby_view := mod.widgets.RobrixContentView { + body +: { + space_lobby_screen := mod.widgets.SpaceLobbyScreen {} } } } } } } +} /// A simple wrapper around the SpacesBar that allows us to animate showing or hiding it. diff --git a/src/home/navigation_tab_bar.rs b/src/home/navigation_tab_bar.rs index 95cec1317..a600dd1ec 100644 --- a/src/home/navigation_tab_bar.rs +++ b/src/home/navigation_tab_bar.rs @@ -161,7 +161,7 @@ script_mod! { Desktop := RoundedView { flow: Down, align: Align{x: 0.5} - padding: Inset{top: 40., bottom: 8} + padding: Inset{top: 8., bottom: 8} width: (NAVIGATION_TAB_BAR_SIZE), height: Fill diff --git a/src/home/rooms_list_header.rs b/src/home/rooms_list_header.rs index eac4372a4..a9eb398d3 100644 --- a/src/home/rooms_list_header.rs +++ b/src/home/rooms_list_header.rs @@ -64,7 +64,7 @@ script_mod! { svg: (ICON_CLOUD_OFFLINE), color: (COLOR_FG_DANGER_RED), } - icon_walk: Walk{width: 35, height: Fit, margin: Inset{left: -5, bottom: 4}} + icon_walk: Walk{width: 25, height: Fit, margin: Inset{left: 1, bottom: 1}} } } @@ -118,10 +118,20 @@ impl Widget for RoomsListHeader { enqueue_popup_notification( "Cannot reach the Matrix homeserver. Please check your connection.", PopupKind::Error, - None, + Some(4.0), ); // Since there is no timeout for fetching media, send an action to ImageViewer when syncing is offline. cx.action(ImageViewerAction::Show(LoadState::Error(ImageViewerError::Offline))); + } else if matches!(self.sync_state, State::Offline) { + // Transitioning away from Offline: reset to the default + // loading state so the sync indicator can take over again. + self.view.view(cx, ids!(loading_spinner)).set_visible(cx, true); + self.view.view(cx, ids!(synced_icon)).set_visible(cx, false); + self.view.view(cx, ids!(offline_icon)).set_visible(cx, false); + + // Now that we're no longer offline, we also need to tell the + // ProfileIcon to refresh itself and fetch our own user's profile again. + SignalToUI::set_ui_signal(); } self.sync_state = new_state.clone(); self.redraw(cx); diff --git a/src/home/rooms_sidebar.rs b/src/home/rooms_sidebar.rs index c50ca5695..8842f6eab 100644 --- a/src/home/rooms_sidebar.rs +++ b/src/home/rooms_sidebar.rs @@ -47,12 +47,53 @@ script_mod! { border_radius: 4.0 border_size: 0.0 shadow_color: #0005 - shadow_radius: 15.0 - shadow_offset: vec2(1.0, 0.0) + shadow_radius: 12.0 + shadow_offset: vec2(0.0, 0.0) + + pixel: fn() { + let sdf = Sdf2d.viewport(self.pos * self.rect_size3) + + let mut fill_color = self.color + if self.color_2.x > -0.5 { + let dither = Math.random_2d(self.pos.xy) * 0.04 * self.color_dither + let dir = if self.gradient_fill_horizontal > 0.5 self.pos.x else self.pos.y + fill_color = mix(self.color self.color_2 dir + dither) + } + + let mut stroke_color = self.border_color + if self.border_color_2.x > -0.5 { + let dither = Math.random_2d(self.pos.xy) * 0.04 * self.color_dither + let dir = if self.gradient_border_horizontal > 0.5 self.pos.x else self.pos.y + stroke_color = mix(self.border_color self.border_color_2 dir + dither) + } + + sdf.box( + self.sdf_rect_pos.x + self.sdf_rect_pos.y + self.sdf_rect_size.x + self.sdf_rect_size.y + max(1.0 self.border_radius) + ) + if sdf.shape > -1.0 { + let m = self.shadow_radius + let o = self.shadow_offset + self.rect_shift + let v = GaussShadow.rounded_box_shadow(vec2(m) + o self.rect_size2+o self.pos * (self.rect_size3+vec2(m)) self.shadow_radius*0.5 self.border_radius*2.0) + // Only draw shadow on the bottom half of the view + let pixel_y = self.pos.y * self.rect_size3.y + let mid_y = self.sdf_rect_pos.y + self.sdf_rect_size.y * 0.5 + let bottom_mask = smoothstep(mid_y - m * 0.3 mid_y + m * 0.3 pixel_y) + sdf.clear(self.shadow_color * v * bottom_mask) + } + + sdf.fill_keep(fill_color) + + if self.border_size > 0.0 { + sdf.stroke(stroke_color self.border_size) + } + return sdf.result + } } - View { height: 23 } - CachedWidget { rooms_list_header := RoomsListHeader {} } diff --git a/src/settings/settings_screen.rs b/src/settings/settings_screen.rs index a255b7034..737f9faea 100644 --- a/src/settings/settings_screen.rs +++ b/src/settings/settings_screen.rs @@ -19,14 +19,14 @@ script_mod! { // The settings header shows a title, with a close button to the right. settings_header := View { flow: Right, - align: Align{x: 1.0, y: 0.5}, width: Fill, height: Fit - margin: Inset{left: 5, right: 5} + margin: Inset{top: 5, left: 5, right: 5} spacing: 10, settings_header_title := TitleLabel { - margin: Inset{top: 4} // line up with the close button - text: "All Settings" + padding: 0, + margin: Inset{ left: 1, top: 11 }, + text: "Add/Explore Rooms" draw_text +: { text_style: theme.font_regular {font_size: 18}, } @@ -36,9 +36,8 @@ script_mod! { close_button := RobrixNeutralIconButton { width: Fit, height: Fit, - align: Align{x: 1.0, y: 0.0}, spacing: 0, - margin: Inset{top: 4.5} // vertically align with the title + margin: 0, padding: 15, draw_icon.svg: (ICON_CLOSE) icon_walk: Walk{width: 14, height: 14} @@ -48,7 +47,7 @@ script_mod! { // Make sure the dividing line is aligned with the close_button LineH { padding: 10, margin: Inset{top: 10, right: 2} } - ScrollXYView { + ScrollYView { width: Fill, height: Fill flow: Down diff --git a/src/shared/helpers.rs b/src/shared/helpers.rs index 4962b73be..4aad56974 100644 --- a/src/shared/helpers.rs +++ b/src/shared/helpers.rs @@ -6,10 +6,9 @@ script_mod! { mod.widgets.TitleLabel = Label { - - width: Fill, height: Fit margin: Inset{top: 5}, + align: Align{x: 0.0, y: 0.5} flow: Flow.Right{wrap: true}, draw_text +: { text_style: TITLE_TEXT {font_size: 15}, @@ -18,9 +17,9 @@ script_mod! { } mod.widgets.SubsectionLabel = Label { - width: Fill, height: Fit margin: Inset{top: 5}, + align: Align{x: 0.0, y: 0.5} flow: Right, draw_text +: { color: (COLOR_TEXT), diff --git a/src/sliding_sync.rs b/src/sliding_sync.rs index 1744639a8..1baec2987 100644 --- a/src/sliding_sync.rs +++ b/src/sliding_sync.rs @@ -27,7 +27,7 @@ use tokio::{ sync::{broadcast, mpsc::{Sender, UnboundedReceiver, UnboundedSender}, watch, Notify}, task::JoinHandle, time::error::Elapsed, }; use url::Url; -use std::{borrow::Cow, cmp::{max, min}, future::Future, hash::{BuildHasherDefault, DefaultHasher}, iter::Peekable, ops::{Deref, DerefMut, Not}, path:: Path, sync::{Arc, LazyLock, Mutex}, time::Duration}; +use std::{borrow::Cow, cmp::{max, min}, future::Future, hash::{BuildHasherDefault, DefaultHasher}, iter::Peekable, ops::{Deref, DerefMut, Not}, path:: Path, sync::{Arc, LazyLock, Mutex, atomic::{AtomicBool, Ordering}}, time::Duration}; use std::io; use hashbrown::{HashMap, HashSet}; use crate::{ @@ -2129,6 +2129,12 @@ pub fn current_user_id() -> Option { /// The singleton sync service. static SYNC_SERVICE: Mutex>> = Mutex::new(None); +/// Set to `true` when the access token has been rejected by the homeserver, +/// signaling the main task to tear down the current session and wait for re-login. +static TOKEN_EXPIRED: AtomicBool = AtomicBool::new(false); +/// Notifies the main monitoring loop to wake up and check `TOKEN_EXPIRED`. +static TOKEN_EXPIRED_NOTIFY: LazyLock = LazyLock::new(Notify::new); + /// Get a reference to the current sync service, if available. pub fn get_sync_service() -> Option> { @@ -2338,7 +2344,7 @@ async fn start_matrix_client_login_and_sync(rt: Handle) { // which causes the loop to wait for the user to submit a new manual login request. let mut initial_client_opt = new_login_opt; - let (client, sync_service, logged_in_user_id) = 'login_loop: loop { + 'login_loop: loop { let (client, _sync_token) = match initial_client_opt.take() { Some(login) => login, None => { @@ -2423,112 +2429,133 @@ async fn start_matrix_client_login_and_sync(rt: Handle) { } }; - break 'login_loop (client, sync_service, logged_in_user_id); - }; - - // Signal login success now that SyncService::build() has already succeeded (inside - // 'login_loop), which is the only step that can fail with an invalid/expired token. - // Doing this before sync_service.start() lets the UI transition to the home screen - // without waiting for the sync loop to begin. - Cx::post_action(LoginAction::LoginSuccess); + // Signal login success now that SyncService::build() has already succeeded, + // which is the only step that can fail with an invalid/expired token. + // Doing this before sync_service.start() lets the UI transition to the home screen + // without waiting for the sync loop to begin. + TOKEN_EXPIRED.store(false, Ordering::Release); + Cx::post_action(LoginAction::LoginSuccess); - // Attempt to load the previously-saved app state. - handle_load_app_state(logged_in_user_id.to_owned()); - handle_sync_indicator_subscriber(&sync_service); - handle_sync_service_state_subscriber(sync_service.state()); - sync_service.start().await; + // Attempt to load the previously-saved app state. + handle_load_app_state(logged_in_user_id.to_owned()); + handle_sync_indicator_subscriber(&sync_service); + handle_sync_service_state_subscriber(sync_service.state()); + sync_service.start().await; - let room_list_service = sync_service.room_list_service(); + let room_list_service = sync_service.room_list_service(); - if let Some(_existing) = SYNC_SERVICE.lock().unwrap().replace(Arc::new(sync_service)) { - error!("BUG: unexpectedly replaced an existing sync service when initializing the matrix client."); - } + if let Some(_existing) = SYNC_SERVICE.lock().unwrap().replace(Arc::new(sync_service)) { + error!("BUG: unexpectedly replaced an existing sync service when initializing the matrix client."); + } - let mut room_list_service_task = rt.spawn(room_list_service_loop(room_list_service)); - let mut space_service_task = rt.spawn(space_service_loop(client)); + let mut room_list_service_task = rt.spawn(room_list_service_loop(room_list_service)); + let mut space_service_task = rt.spawn(space_service_loop(client)); - // Now, this task becomes an infinite loop that monitors the state of the - // three core matrix-related background tasks that we just spawned above. - #[allow(clippy::never_loop)] // unsure if needed, just following tokio's examples. - loop { - tokio::select! { - result = &mut matrix_worker_task_handle => { - match result { - Ok(Ok(())) => { - // Check if this is due to logout - if is_logout_in_progress() { - log!("matrix worker task ended due to logout"); - } else { - error!("BUG: matrix worker task ended unexpectedly!"); + // Now, this task becomes an infinite loop that monitors the state of the + // three core matrix-related background tasks that we just spawned above. + // If the access token expires (TOKEN_EXPIRED is set), this loop will break + // and we'll clean up and `continue 'login_loop` to wait for re-login. + #[allow(clippy::never_loop)] // unsure if needed, just following tokio's examples. + loop { + tokio::select! { + // Wake up immediately when the access token has been rejected, + // so we can tear down this session and wait for re-login. + _ = TOKEN_EXPIRED_NOTIFY.notified() => { + break; + } + result = &mut matrix_worker_task_handle => { + match result { + Ok(Ok(())) => { + // Check if this is due to logout + if is_logout_in_progress() { + log!("matrix worker task ended due to logout"); + } else { + error!("BUG: matrix worker task ended unexpectedly!"); + } + } + Ok(Err(e)) => { + // Check if this is due to logout + if is_logout_in_progress() { + log!("matrix worker task ended with error due to logout: {e:?}"); + } else { + error!("Error: matrix worker task ended:\n\t{e:?}"); + rooms_list::enqueue_rooms_list_update(RoomsListUpdate::Status { + status: e.to_string(), + }); + enqueue_popup_notification( + format!("Rooms list update error: {e}"), + PopupKind::Error, + None, + ); + } + }, + Err(e) => { + error!("BUG: failed to join matrix worker task: {e:?}"); } } - Ok(Err(e)) => { - // Check if this is due to logout - if is_logout_in_progress() { - log!("matrix worker task ended with error due to logout: {e:?}"); - } else { - error!("Error: matrix worker task ended:\n\t{e:?}"); + break; + } + result = &mut room_list_service_task => { + match result { + Ok(Ok(())) => { + error!("BUG: room list service loop task ended unexpectedly!"); + } + Ok(Err(e)) => { + error!("Error: room list service loop task ended:\n\t{e:?}"); rooms_list::enqueue_rooms_list_update(RoomsListUpdate::Status { status: e.to_string(), }); enqueue_popup_notification( - format!("Rooms list update error: {e}"), + format!("Room list service error: {e}"), PopupKind::Error, None, ); + }, + Err(e) => { + error!("BUG: failed to join room list service loop task: {e:?}"); } - }, - Err(e) => { - error!("BUG: failed to join matrix worker task: {e:?}"); - } - } - break; - } - result = &mut room_list_service_task => { - match result { - Ok(Ok(())) => { - error!("BUG: room list service loop task ended unexpectedly!"); - } - Ok(Err(e)) => { - error!("Error: room list service loop task ended:\n\t{e:?}"); - rooms_list::enqueue_rooms_list_update(RoomsListUpdate::Status { - status: e.to_string(), - }); - enqueue_popup_notification( - format!("Room list service error: {e}"), - PopupKind::Error, - None, - ); - }, - Err(e) => { - error!("BUG: failed to join room list service loop task: {e:?}"); } + break; } - break; - } - result = &mut space_service_task => { - match result { - Ok(Ok(())) => { - error!("BUG: space service loop task ended unexpectedly!"); - } - Ok(Err(e)) => { - error!("Error: space service loop task ended:\n\t{e:?}"); - rooms_list::enqueue_rooms_list_update(RoomsListUpdate::Status { - status: e.to_string(), - }); - enqueue_popup_notification( - format!("Space service error: {e}"), - PopupKind::Error, - None, - ); - }, - Err(e) => { - error!("BUG: failed to join space service loop task: {e:?}"); + result = &mut space_service_task => { + match result { + Ok(Ok(())) => { + error!("BUG: space service loop task ended unexpectedly!"); + } + Ok(Err(e)) => { + error!("Error: space service loop task ended:\n\t{e:?}"); + rooms_list::enqueue_rooms_list_update(RoomsListUpdate::Status { + status: e.to_string(), + }); + enqueue_popup_notification( + format!("Space service error: {e}"), + PopupKind::Error, + None, + ); + }, + Err(e) => { + error!("BUG: failed to join space service loop task: {e:?}"); + } } + break; } - break; } } + + // If the monitoring loop broke because the access token expired, + // clean up the current session state and loop back to wait for re-login. + if TOKEN_EXPIRED.load(Ordering::Acquire) { + log!("Token expired; cleaning up session state and waiting for re-login."); + // Abort the background tasks that depend on the now-invalid session. + room_list_service_task.abort(); + space_service_task.abort(); + // Clear the stored client and sync service so re-login starts fresh. + let _ = CLIENT.lock().unwrap().take(); + let _ = SYNC_SERVICE.lock().unwrap().take(); + continue 'login_loop; + } + // For non-token-related breaks (logout, fatal errors), exit the function. + return; } } @@ -3247,7 +3274,12 @@ fn handle_session_changes(client: Client) { "Your login token is no longer valid.\n\nPlease log in again." }; error!("Session token is no longer valid (soft_logout: {soft_logout}). Prompting re-login."); + TOKEN_EXPIRED.store(true, Ordering::Release); + TOKEN_EXPIRED_NOTIFY.notify_one(); Cx::post_action(LoginAction::LoginFailure(msg.to_string())); + // Only prompt once — the SDK will keep emitting UnknownToken + // for every rejected request, but one re-login prompt suffices. + break; } Ok(SessionChange::TokensRefreshed) => {} Err(broadcast::error::RecvError::Lagged(n)) => { @@ -3271,7 +3303,18 @@ fn handle_sync_service_state_subscriber(mut subscriber: Subscriber { + log!("Ignoring sync service state update after token expiration."); + break; + } other => Cx::post_action(RoomsListHeaderAction::StateUpdate(other)), } }