Commit graph

2,205 commits

Author SHA1 Message Date
offline-ant
4116b17a9c FOOTGUN FIX: panic on nil return from script_mod! in from_script_mod (#891)
When script_mod! is used with 'let app = startup() do ...' but the
block omits the final 'app' expression, the module returns nil. This
silently creates an App with an empty WidgetRef -- no window, no UI,
no error. The app runs indefinitely doing nothing.

Panic with an actionable message instead of silently succeeding.

Co-authored-by: ant <ant@offline.click>
2026-02-26 11:32:47 +01:00
Admin
7e575b9705 restore merge script 2026-02-26 10:09:28 +01:00
Admin
dc13e799c4 new merge script 2026-02-26 10:08:25 +01:00
Admin
956471c1a6 counter splash example 2026-02-26 10:08:25 +01:00
Admin
0d720b033a text layout
\
2026-02-26 10:08:22 +01:00
offline-ant
9991417f35 widgets: add Label visible live property support (#885)
Co-authored-by: ant <ant@offline.click>
2026-02-26 08:24:29 +01:00
Kevin Boos
bb31284475 Fix circle view (#887)
* Fix `CircleView` shader, support true circle shader behavior

Add CircleView examples w/ variety to `uizoo`

* splash example: fix popup notification behavior
2026-02-26 08:17:49 +01:00
admin
ddebd64601 api 2026-02-25 17:14:39 +01:00
Kevin Boos
7bd65ad570 FIx Icon, improve to support IconRotated, expose geom in draw_svg (#883)
* Fix draw_svg to support a rotated Icon. Add `IconRotated` widget.

Fix icon resource paths in `splash` example

* Expose geometry in draw_svg to make icon/svg rotation more efficient

simplifies the code too
2026-02-25 13:05:14 +01:00
offline-ant
825b824ef4 restore set_window_icon lost during rebase of #877 (#880)
The rebase squash into 6df7c870 used the early draft of window_icon.rs,
dropping the OnceLock-based global setter added in the fixup commit.

Restore from pre-rebase commit 83bf5d62:
- add static GLOBAL_ICON: OnceLock<WindowIcon>
- add pub fn set_window_icon(icon: WindowIcon)
- refactor default_window_icon() to check global override first
- re-export set_window_icon from platform lib.rs

Co-authored-by: ant <ant@offline.click>
2026-02-25 13:05:00 +01:00
Sabin Regmi
6757648426 Remove left margin from window caption label (#884)
* Remove left margin from window caption label

Delete the hardcoded Inset{left: 100} margin on the caption Label in widgets/src/window.rs so the label can be centered by the parent layout. This cleans up alignment and removes an unnecessary offset in the window header.

* Use window title in caption; format button click

Apply the configured window title to the window caption and make a small UI code cleanup.

- examples/splash: set window.title to "Splash Example" and reformat the tooltip button click check to a multiline expression for readability.
- widgets/src/window.rs: import label::* and update ensure_initialized to copy cx.windows[window_id].create_title into the caption_label when non-empty so the window chrome shows the configured title.
2026-02-25 13:04:46 +01:00
Admin
c8ab367b14 little glitches in script engine 2026-02-24 23:32:56 +01:00
Admin
1ea87b2c2d warnings 2026-02-24 21:43:35 +01:00
Admin
56501e372b cleanup warnings 2026-02-24 21:40:08 +01:00
Admin
f2ea64ce71 edmx 2026-02-24 21:40:08 +01:00
Admin
aae121f31d fix gc issues 2026-02-24 21:40:08 +01:00
Kevin Boos
c576ab496e Add missing callout tooltip file (#882) 2026-02-24 19:59:44 +01:00
Kevin Boos
8512c1d430 Fix Tooltip behavior and structure. Add CalloutTooltip widget (#881)
The CalloutTooltip is a fancier wrapper atop Tooltip that allows
the user to display a tooltip with a callout triangle that points
at a particular widget, making it clearer what the tooltip
corresponds to. It also supports a custom text color, background color,
positioning suggestion (top, right, left, bottom), full text wrapping,
and dynamically resize and re-orient itself to fit within the app screen.
2026-02-24 19:43:06 +01:00
offline-ant
416ff1779a add cross-platform GL render bridge for external GL consumers (#878)
New GlRenderBridge API lets external code (e.g. servo in havi) render
via GL into a makepad-displayable texture with zero-copy.

Platform backends:
- Linux/Android: wraps existing EGL context (EglRenderBridge)
- Windows: ANGLE EGL on D3D11 device via mozangle (AngleRenderBridge)
- macOS: standalone CGL 3.2 Core bridged to Metal via IOSurface (CglRenderBridge)

Cx methods: create_gl_render_bridge, create_gl_render_bridge_texture,
restore_gl_context -- all platform-dispatched via cfg.

Co-authored-by: ant <ant@offline.click>
2026-02-24 17:32:08 +01:00
offline-ant
90415145a7 fix(wayland): negate scroll axis values to match Makepad convention (#875)
Wayland wl_pointer::Axis values are defined as motion-event vectors:
positive vertical = downward on screen. This means positive values
represent content sliding down under the pointer, i.e. the viewport
moving UP.

Makepad's internal scroll convention is positive = viewport moves DOWN.
This matches X11 (button 4/up maps to negative, button 5/down maps to
positive) and macOS (which negates scrollingDeltaY for the same reason).
The web backend also follows this via browser deltaY semantics.

The Wayland backend was passing axis values through without negation,
producing reversed scroll on all Wayland sessions. Negate at the
accumulator stage, consistent with how winit handles the same mismatch
(explicit comment: "Wayland sign convention is the inverse of winit").

The ignored AxisRelativeDirection event is unrelated -- it is a hint
telling clients whether the compositor applied natural-scrolling
inversion to the axis values, intended for widgets like volume sliders
that should track physical finger direction. The axis values themselves
already have natural scrolling applied by the compositor.

Co-authored-by: ant <ant@offline.click>
2026-02-24 17:31:04 +01:00
offline-ant
6df7c870db Add cross-platform window icon support (#877)
Add WindowIcon and WindowIconBuffer types to platform/src/window.rs with
RGBA8 pixel buffer data. Embed a default 64x64 Makepad icon generated at
runtime (dark rounded rect with white M glyph).

Platform backends:

- Windows: CreateIcon from RGBA->BGRA data, set on WNDCLASSEXW.hIcon
- X11: XChangeProperty with _NET_WM_ICON atom (RGBA->ARGB u32 array)
- macOS: NSBitmapImageRep + NSImage, setApplicationIconImage on NSApp
- Wayland: vendor xdg-toplevel-icon-v1 protocol, regenerate bindings,
  bind wl_shm + xdg_toplevel_icon_manager_v1 globals, create shm buffer
  icon when compositor supports it, silent fallback to app_id otherwise.
  Use configurable create_app_id field (default "Makepad").

Codegen: extend tools/wayland_codegen to generate xdg toplevel_icon
bindings into libs/linux/wayland-protocols/src/xdg.rs.

Co-authored-by: ant <ant@offline.click>
2026-02-24 17:30:43 +01:00
Admin
4586f861d9 text cast in set_text 2026-02-24 17:12:54 +01:00
Admin
430ee3b426 fix android sdk install issues 2026-02-24 17:06:21 +01:00
Admin
797098cec5 fix linux 2026-02-24 16:49:11 +01:00
Admin
3c78ea6a35 add splash test/set text 2026-02-24 16:33:36 +01:00
Admin
1bf89646ef ssl sockets 2026-02-24 16:28:21 +01:00
Admin
80708e2504 add source to components 2026-02-24 14:40:08 +01:00
Admin
0aa3533210 network refactor 2026-02-24 14:04:37 +01:00
Admin
582af4b271 splice out a makepad-network crate 2026-02-23 23:21:31 +01:00
Admin
cc31241d4f dropshadows back 2026-02-23 21:09:52 +01:00
Admin
3500764e26 splat 2026-02-23 19:15:37 +01:00
Admin
251df9ebec fix dx11 memleak 2026-02-23 18:30:26 +01:00
Admin
9cb709f6a5 fix up uizoo 2026-02-23 18:00:19 +01:00
offline-ant
b41f9eef42 platform: unified StudioToApp dispatch and control channel (#874)
* platform: unified StudioToApp dispatch and control channel

Shared dispatch_studio_msg() in cx_shared.rs handles all common
StudioToApp variants (input, clipboard, screenshot, widget dump, kill).
Each stdin backend resolves window_id for mouse events, then delegates.

Control channel (web_socket.rs) enables StudioToApp dispatch in windowed
apps. Event loops poll it alongside their native event sources.

WindowGeomChange events are emitted on stdin geometry updates.

* fix RunView Y-flip on Linux: flip in shader instead of CPU readback

---------

Co-authored-by: ant <ant@offline.click>
2026-02-23 17:46:41 +01:00
offline-ant
2c55091c71 defer aux-channel accept until binary starts running (#873)
accept_host_endpoint() has a 10s timeout. Calling it at spawn time
fails for any build that takes longer to compile. Defer to when
"Running " appears in stderr, which is when the binary actually
starts and connects to the aux channel.

build_server: match+return instead of expect on spawn failure.

Co-authored-by: ant <ant@offline.click>
2026-02-23 17:46:07 +01:00
offline-ant
558eebb816 macOS IOSurface render texture support for havishell (#872)
Co-authored-by: ant <ant@offline.click>
2026-02-23 17:45:54 +01:00
offline-ant
dc588ebb99 fix Studio crash on child process failure (#871)
build_client: log instead of panic on closed channel.

Co-authored-by: ant <ant@offline.click>
2026-02-23 17:45:40 +01:00
offline-ant
e3eb1dab2a fix: map atan2 to atan in GLSL shader backend (#870)
Co-authored-by: ant <ant@offline.click>
2026-02-23 17:45:22 +01:00
offline-ant
7464d43d19 widgets: expose Label and View fields for external composition (#869)
Co-authored-by: ant <ant@offline.click>
2026-02-23 17:44:49 +01:00
offline-ant
5d551e087d wayland: edge-resize, scroll acceleration, seat v5 binding (#868)
Co-authored-by: ant <ant@offline.click>
2026-02-23 17:44:34 +01:00
Admin
582c675c38 fix windows 2026-02-23 17:22:39 +01:00
Admin
452aaa106f tunnel 2026-02-23 16:55:20 +01:00
Admin
b331819b9a message refactor
;
2026-02-23 16:46:48 +01:00
Admin
00fa5a71f7 message coalescing 2026-02-23 16:08:52 +01:00
Admin
36b3a7da68 studio<>app proto cleanup 2026-02-23 15:54:59 +01:00
offline-ant
6a92f1aeb1 Add HideWindowButtons/ShowWindowButtons platform op (#866)
Co-authored-by: ant <ant@offline.click>
2026-02-23 15:19:40 +01:00
Julián Montes de Oca
0774c184a3 Video Widget: Support on MacOS & iOS (#863)
* Add macOS video playback support using AVPlayer + CVMetalTextureCache

Extends the Video widget from Android-only to also support macOS with
hardware-accelerated, zero-copy video rendering through Metal. Uses
AVPlayer for decoding and CVMetalTextureCache to map decoded frames
directly to MTLTextures without CPU copies.

Key changes:
- New AppleVideoPlayer module (AVPlayer + CVPixelBuffer → MTLTexture pipeline)
- FFI bindings for CVMetalTextureCache, CMTime, and related Apple APIs
- Video frame polling integrated into macOS paint cycle
- TextureFormat::VideoRGB ungated from Android-only to all platforms
- Video widget made cross-platform (TextureHandleReady wait is Android-only)
- Fixed shader aspect ratio bug (&&→|| for non-positive dimension check)
- Added video demo to uizoo and scratchpad examples

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add iOS video playback support

* Enhance video playback functionality with seek support and current position tracking

Key changes:
- Added `seek_video_playback` operation to allow seeking to specific timestamps.
- Introduced `current_position_ms` field in `VideoTextureUpdatedEvent` for tracking playback position.
- Implemented seeking functionality across iOS, macOS, and Android platforms.
- Updated Video widget to support new controls and indicators for seeking.

* Improve error handling for unsupported texture pixel formats

* Make volume icon drawing  use fixed width

* Make play/pause drawing use fixed width

* Remove video from scratchpad

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:19:21 +01:00
admin
97093db376 readme 2026-02-23 08:06:39 +01:00
admin
e3edac9cf8 fix linux windows build 2026-02-23 07:53:05 +01:00
admin
1496c97a7e tweakray 2026-02-22 20:30:14 +01:00