Commit graph

475 commits

Author SHA1 Message Date
Admin
e0e73f9ea6 xr otw 2026-03-23 22:26:41 +01:00
Admin
2b677c6da0 compiles 2026-03-23 12:56:39 +01:00
Admin
dea06dd282 cleanup 2026-03-23 10:12:37 +01:00
Admin
e888e946ab android borked 2026-03-22 17:28:18 +01:00
Admin
84ec5394ba fix xr lib 2026-03-21 15:24:19 +01:00
Admin
2f3260f214 demo 2026-03-21 11:39:27 +01:00
Sabin Regmi
a0351cf90e
Some small web nits from my crazy experiement (#972)
* Schedule loader removal after presented frame

Introduce loader_after_presented_frame_id and add schedule/cancel helpers to remove the canvas loader after a presented animation frame. Cancel any pending requestAnimationFrame when the loader is removed or conditions change, and update update_startup_loader to use the new scheduling logic (remove loader only after seen animation frame and quiet frames threshold). This prevents premature removal and visual glitches while preserving the existing fallback timer.

* small fonts should be used when --profile=small

* dont include large fonts on small profile + fix compress serving

* Refactor window initialization and caption sync

Extract sync_caption_bar_state and sync_caption_title from ensure_initialized and call them before the initialized early-return so caption bar state and title are kept in sync even when the widget is re-applied. ensure_initialized still performs the original one-time setup (pass, depth texture, demo frame), but runtime chrome (VR button and caption visibility/title) is now updated up-front to avoid stale UI state.

* fix --bindgen

* Set imports.env in wasm import patches

Add additional string replacements to ensure imports.env = env is injected into generated JS for different formatting variants of the __wbg_get_imports(...) call. This makes the patch robust to variations like missing const or spacing so the env object is always attached to the wasm imports.

* Revert "Set imports.env in wasm import patches"

This reverts commit 37933234d36b4ee867690cf167474638e81febf7.

* Revert "fix --bindgen"

This reverts commit cb236b202b92a46eda3cb1ee4c678bdf6507081a.

* Reapply "fix --bindgen"

This reverts commit 27df4175bd1889222b928ffb68213aa865d1c839.

* Reapply "Set imports.env in wasm import patches"

This reverts commit 23695b4fa646d8f1b7a31a3fc27eb92f5bce0cf8.

* fix xr compilation error
2026-03-21 11:23:16 +01:00
Admin
2cff94d01b fix android screencap to studio 2026-03-20 09:03:50 +01:00
Kevin Boos
be1229492d
Restore optional serde derives that were removed in Makepad 2.0 (#973) 2026-03-19 20:07:45 +01:00
Kevin Boos
7e51266f5b
Ensure that the Html <br> tag obeys current line spacing settings (#971)
Without this, Html blocks that have both `<br>` and `\n` newlines
(or even just soft line wraps) look quite janky, with poor vertical spacing.
2026-03-19 20:07:28 +01:00
Kevin Boos
7134504e82
Fixed several issue in text drawing, layout, and text flow. (#970)
These are needed to support better formatting of Html code
that mixes multiple different styles together, e.g., inline code
next to normal code, or inline code within a blockquote or a heading.

Full summary of changes:

**File:** `draw/src/shader/draw_text.rs`

Added `#[live(0.0)] pub top_drop: f32` to `TextStyle`. This is a vertical offset expressed as a fraction of font size — positive values shift text downward. It's useful for aligning baselines when mixing fonts with different vertical metrics (e.g., a code font rendered inline with regular text).

**File:** `draw/src/shader/draw_text.rs`

When `temp_y_shift != 0`, the extra shift pixels are now added to `allocate_height()` and the emitted walk rect. This prevents containers (blockquotes, etc.) from clipping the descenders (g, p, q, y) of vertically-shifted text.

**File:** `widgets/src/text_flow.rs`

After selecting the appropriate text style (normal/bold/italic/fixed), `draw_text.temp_y_shift` is now set from that style's `top_drop` value. This allows each style variant to specify its own vertical offset, since `TextFlow` uses a single shared `DrawText` instance for all text rendering.

**File:** `draw/src/turtle.rs`

New public method to mutate `layout.padding.left` after a turtle has been created.

**File:** `widgets/src/text_flow.rs`

After drawing the bullet/number marker, the actual cursor position is now measured and `set_padding_left()` is called so that wrapped continuation lines align with the text after the marker, rather than being over-indented by the estimated `font_based_padding` (which was `2.5 * font_size`).

Additionally, the hardcoded `draw_text(cx, " ")` spacer after the marker was replaced with `walk_margin(cx, self.list_item_marker_pad)` for precise pixel-based control.

**File:** `widgets/src/text_flow.rs`

Added `#[live(5.0)] list_item_marker_pad: f64` — a configurable spacing (in pixels) between the list item marker (bullet/number) and the content text that follows it.
2026-03-19 20:07:13 +01:00
Admin
5a4bef21d6 cleanup 2026-03-19 10:16:38 +01:00
Admin
4c7b806524 helmet with real envmap 2026-03-18 01:29:59 +01:00
Admin
1a0f01ce89 vulkan debugging 2026-03-17 23:59:07 +01:00
Admin
987f21bea4 cef 2026-03-17 19:00:28 +01:00
Admin
3803e091de vulkan video textures 2026-03-17 19:00:28 +01:00
Kevin Boos
a9fe1a8090
Proper widget tree fix (#956)
* Fix macos platform build failures related to PR#946

* Properly fix the new breadth-first widget tree lookup
2026-03-16 19:27:32 +01:00
Admin
64b1a7c74b vulkan back 2026-03-15 13:20:49 +01:00
Admin
8ee34e0e84 otw 2026-03-15 09:52:45 +01:00
Sabin Regmi
5a6eacd7ef
ft floating panel on macos (#945) 2026-03-14 12:12:35 +01:00
offline-ant
fe5cd60087
platform: rework custom MSE playback sessions (#946)
Co-authored-by: ant <ant@offline.click>
2026-03-14 12:12:21 +01:00
Kevin Boos
1feaac5494
Fix HtmlLink attribute init to handle any attr order (#948) 2026-03-14 12:11:42 +01:00
Kevin Boos
2ebeb20262
fix tooltip by force-drawing the draw list upon show/hide (#950)
Without this, the tooltip will not necessarily be shown upon its
first call to `show()`, especially if the CalloutTooltip wrapper
is driving it.
2026-03-14 12:11:32 +01:00
Kevin Boos
f337fcd9be
Support image rotation in degrees (#952)
This was previously a feature but was lost in the 2.0 migration
2026-03-14 12:11:01 +01:00
wyenox
67d6ed2906
Fix and optimize widget search to return the shallowest match in the tree (#949) 2026-03-14 07:49:32 +01:00
Admin
bca911513d xr otw 2026-03-12 15:51:30 +01:00
Sabin Regmi
3242b11afc
Windows Blur, System Composition (#940)
* Initial plan

* feat(platform): add window visuals API and M1 backdrop wiring

Co-authored-by: wheregmis <26774729+wheregmis@users.noreply.github.com>

* feat(uizoo): add M2 GlassPanel widget and demo tab

Co-authored-by: wheregmis <26774729+wheregmis@users.noreply.github.com>

* blue example

* Apply backdrop intensity and transparency

macOS: apply visuals.backdrop_intensity to the NSVisualEffectView alpha (clamped) so backdrop intensity affects the effect view.

Windows: honor visuals.backdrop_intensity by computing an alpha-packed accent color, toggle WS_EX_LAYERED for transparent windows, call SetLayeredWindowAttributes and DwmExtendFrameIntoClientArea when needed, and set the AccentPolicy accordingly (enable blur for transparent or non-none backdrops, set gradient_color based on intensity, and set accent_flags depending on DWM attribute result).

Tests: update expected backdrop_intensity in a unit test from 4.0/1.0 to 0.25 and assert a platform op is emitted. These changes ensure backdrop intensity and transparency settings are respected across platforms.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wheregmis <26774729+wheregmis@users.noreply.github.com>
2026-03-12 14:57:09 +01:00
Admin
cde02e2e48 fix 2026-03-11 18:15:12 +01:00
Admin
feb1ecd55f dock fix 2026-03-11 10:19:58 +01:00
Admin
a6eb9906a0 hiccup 2026-03-11 10:19:58 +01:00
Kevin Boos
c344dcd4fb
Support hiding a dock tabs bar (#937) 2026-03-10 08:00:44 +01:00
Admin
e23a8b3f26 fix uid 2026-03-09 16:42:43 +01:00
Admin
e79e374375 live reloading 2026-03-08 17:25:27 +01:00
offline-ant
7c7d91b8ad
platform: video/camera subsystem with media plugin architecture (#929)
Video playback: extended API with volume, playback rate, seek ranges,
buffered ranges, can_play_type, audio-only mode. Unified player wrapping
native backend (AVPlayer/GStreamer/MediaFoundation) with software fallback.
YUV shader pipeline (BT.601/709/2020, NV12 biplanar, rotation).

Camera: V4L2 backend (Linux), expanded NDK Camera2 (Android), AVCapture
stream refactor (iOS/macOS) with shared session architecture. NV12
zero-copy paths on iOS (CVMetalTextureCache) and Android (AImage planes).
Camera preview modes (texture/native/auto).

Video encoding: H264 hardware encode on Apple (VideoToolbox) and Android
(MediaCodec). Camera-to-encoder pipeline with pixel buffer passthrough.

Media plugin system: externalized codec implementation via MediaPlugin
trait. MsePlayer, VideoFrameDecoder, MediaVideoEncoder, SoftwareVideoPlayer
interfaces. Runtime codec capability query and merge.

Includes camera example app.

Co-authored-by: ant <ant@offline.click>
2026-03-08 13:10:58 +01:00
offline-ant
814fe4d9cd
platform: native mobile selection handles (#930)
* platform: popup window API with X11/Wayland support

- Add popup window type for context menus and dropdowns
- Wayland: xdg_popup with grab for compositor-driven dismiss
- X11: override-redirect windows with pointer grab
- Explicit-close semantics: app must handle PopupDismissed
- Fix Wayland crash on repeated context menu open/close
- Emit WindowClosed before PopupDismissed in PopupDone

* platform: native mobile selection handles

iOS: custom UIView selection handles with UIPanGestureRecognizer (all versions),
UITextSelectionDisplayInteraction for native highlights (iOS 16+),
MakepadSelectionRect for UITextInput protocol.

Android: custom SelectionHandleView with GradientDrawable oval, touch drag
listeners, JNI bridge for handle drag events.

Widgets: TextFlow clipboard action integration (show on touch up with selection,
hide on touch down/focus lost, TextCut handler), PortalList select-all and
clipboard actions, selection bounding rect computation for popup positioning.

Includes text_selection example app.

---------

Co-authored-by: ant <ant@offline.click>
2026-03-08 12:15:31 +01:00
offline-ant
04dea089bd
platform: small fixes and quality improvements (#928)
- Android log levels: map log! macro levels to Android log priorities
  (ERROR=6, WARN=5, INFO=4). Some devices suppress DEBUG by default.
- cargo-makepad android: show help text instead of panicking on missing
  or invalid subcommand.
- Android build: discover .class files dynamically instead of hardcoding
  ~25 individual paths. Add Java 8 source/target flags.
- Remove deprecated AsyncTask import from MakepadNetwork.java.
- Studio stdout: add newline after JSON messages for JSON-lines parsing.
- Studio stdout: skip profiler timing in stdout mode to avoid overhead.
- Script thread: fix panic on empty call stack in call_has_me/call_has_try.
- Cursor: reset to Default on FingerHoverOut in TextFlow and TextInput.

Co-authored-by: ant <ant@offline.click>
2026-03-08 11:24:18 +01:00
Admin
ec505b27f0 script api for slide panel 2026-03-08 10:57:03 +01:00
Admin
923a554e49 fixing 2026-03-08 09:20:34 +01:00
Admin
b64a83fa15 oops. uids 2026-03-08 08:42:49 +01:00
Admin
e61e3bfbce Harden widget tree refresh and require explicit widget uids 2026-03-07 11:23:22 +01:00
Kevin Boos
15d39cca74
TextInput: actually use color_empty_hover/focus in draw_text shader (#927) 2026-03-07 09:46:44 +01:00
Sabin Regmi
713628a89f
Load script resources per-handle (avoid global loads) (#923)
Replace broad cx.load_all_script_resources() calls with a targeted cx.load_script_resource(handle) to only request the specific resource needed. Refactor script resource loading (platform/src/script/res.rs) by extracting load_script_resource_impl(handle, crate_manifests) and exposing load_script_resource(handle); keep load_all_script_resources() by iterating per-handle. Improve wasm handling: resolve web_url per-resource, set explicit error states when missing, and fire async HTTP requests safely. Remove an early call to load_all_script_resources() from web startup. Additional changes: serve precompressed .br files in the local wasm dev server (with COOP/COEP headers when threaded), add wasm-specific font/theme script entries for widgets, and update various callers (draw shaders, widgets, math_view, gltf/view_splat, image) to use the per-handle loader. These changes reduce unnecessary global loads and limit network/file operations to only required resources.
2026-03-06 16:01:07 +01:00
admin
8b515338a2 fix splitter fingerdown 2026-03-04 15:13:21 +01:00
admin
4bc5cec4cb tweakra 2026-03-04 15:00:52 +01:00
Admin
8d65fdb31f fix path 2026-03-04 11:38:29 +01:00
Admin
650767daa8 fix path 2026-03-04 11:36:01 +01:00
Admin
47f906c340 widget tree refactor 2026-03-04 10:16:33 +01:00
Admin
7adc274be7 widget tree refactor 2026-03-04 09:52:17 +01:00
Admin
05238ee39d widget tree change 2026-03-03 21:22:58 +01:00
Admin
c0125ba11d widget tree fixup 2026-03-03 20:19:06 +01:00