makepad-widgets becomes a front crate over widgets/core and widgets/families (each family a crate of its own, linked by features, so an app compiles only the families it uses); widgets/feedback is the Send feedback panel. The dev PRs (#1241-#1264) are ported to the new layout, as in the merge of dev into work. Covers work ebf442a94..2b1a41df4 for draw widgets xr code_editor: - widgets, storybook: the widget catalogue app, some eighty new widgets, a theme store with mixable style sheets, and the rule that a press belongs to - wm, widgets: the style tween starts with all eight weights, and the new style sheet takes the last number instead of macOS's - platform: the Android desk swipes at 120 Hz — offscreen render passes and framebuffers cached, SVG meshes kept, font families that complete - Button: activate from the keyboard when focused (#1241) - app_main!: only ship the fonts an app declares (#1247) - platform, widgets, wm: every Vulkan pass renders through a negative-height viewport again, so a Wayland or X11 window stands upright, and no capture - widgets: the supersampled resolve and the map's shadow mask sample their textures as stored, like every other render texture - widgets, platform: the last twelve warnings go - cef, video, platform: what Stage's browser needs from the shared layers - apps: what the CI box found - ScrollBar: add `show_handle` for a view that scrolls without a grabbable bar (#1254) - widgets: children a lookup discovers reach the dump, the snapshot and the flood searches - tests: the workspace suite, run as a whole for the first time, passes outside the example UI tests - examples: the UI tests pass, for the reasons they failed - libs: no warnings in the workspace check on any row - tests: the last three failures of the CI box's night - Linux: fix window chrome button hovers and how maximized/fullscreen windows work (#1255) - Tooltip: position anchored tooltips in the same draw (#1256) - tests: the three binaries over ten seconds in release come under it - widgets: let the host install script mods into every Splash isolate - widgets: a pooled test context forgets the last case's Escape claim - widgets: the pooled test context's resets replace the globals - RadioButton: fix its touch hover state and click-off behavior (#1258) - HtmlLink: fix its hover and pressed states (#1257) - RadioButton: take key focus on the click, not on the press (#1259) - feat(text): CoreText outline fallback for hvgl-only fonts (macOS) - draw text: the CoreText outline fallback is only ever resolved for a face whose outlines live solely in hvgl, and font-family diagnostics are the `f - platform, widgets, wm: a touch that is taken away is cancelled, never released - wm on Android: every app is its own process - widgets: touch lists scroll with Android's physics - task, cargo-makepad, widgets, audio: the task manager chooses its columns, graphs every process' network and disk traffic and installs itself as a D - widgets, draw: skeuomorphic surfaces light each other through an optional relief buffer - widgets, platform: a texture can light the relief buffer, menus take colour chips, and a style reload recompiles changed shader functions - widgets: relief surfaces can travel like mechanical keys, and dark surfaces take less neighbour light - platform, widgets, audio_route, ai: window crossfades and whole-frame presents, caption controls that click, themed menus, a stereo-pair audio tap, - platform, widgets, ai: a restyle recompiles nothing it already has, shows only complete frames, and a window can own its caption - widgets: relief surfaces can swing their light toward a point - widgets, builder: the big widget families are features, all on by default, and the Builder takes none of them - ai: Claude Desktop drives any app with the F10 panel - Constrain Splash external I/O to the host service bridge (#1243) - PortalList: stop following the end when scrolling to an earlier item (#1261) - draw: glass of a view that stopped drawing leaves the screen - widgets: the Widget lookup methods and with_script_vm_id are compiled once, not once per widget type - widgets: the library moves to makepad-widgets-core in widgets/core, and makepad-widgets becomes its front crate - widgets: the Window, widget tree and panel theme reach the tweaker, voice, AI slot and dock through hooks, not through their modules - widgets: every widget family is a crate of its own under widgets/families, and makepad-widgets links, re-exports and registers the ones its features - aichat, widgets: the chat reads the design feedback through the tweaker's hook, so linking the chat no longer needs the tweaker - apps, examples, libs: each crate builds only the widget families it uses, and the design overlay is each app's own default feature - widgets: the build scripts rerun on their own edits only, and makepad-widgets no longer reads MAKEPAD - feedback: Send feedback, a caption icon and a small panel that shows exactly what is sent - feedback: the panel's wording reads right and draws in any font - feedback: takes makepad-widgets without its default families - widgets: the empty parts of an app's caption bar drag the window again - ScrollBar: fade out when idle, like macOS overlay scrollers (#1264) - platform, draw: web builds start again - widgets: the keyboard reaches boxes and modals - widgets: a hover tooltip never sits under the mouse cursor - feedback: Send clipboard, and the dialog works from the keyboard Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
93 lines
3.8 KiB
Text
93 lines
3.8 KiB
Text
use mod.prelude.widgets_internal.*
|
|
mod.widgets.Button.padding = mod.turtle.Inset{left: 8.0 right: 8.0 top: 4.0 bottom: 4.0}
|
|
mod.widgets.Button.draw_bg.border_radius = 0.0
|
|
mod.widgets.Button.draw_bg.border_size = 2.0
|
|
mod.widgets.Button.draw_bg.color_2 = #d4d0c8
|
|
mod.widgets.TextInput.draw_bg.border_radius = 0.0
|
|
mod.widgets.Window.pass.clear_color = #d4d0c8
|
|
|
|
// Raised gray command buttons, with a depressed face while held.
|
|
mod.widgets.Button.draw_bg.pixel = fn() {
|
|
let p=self.pos*self.rect_size
|
|
let size=self.rect_size
|
|
let sunken=self.down>0.5
|
|
let fill=#d4d0c8
|
|
|
|
let tl=min(p.x,p.y)
|
|
let br=min(size.x-p.x,size.y-p.y)
|
|
let d=min(tl,br)
|
|
let upper=tl<br
|
|
let raised_light=if d<1.0 {#ffffff}else{#d4d0c8}
|
|
let raised_dark=if d<1.0 {#404040}else{#808080}
|
|
let light=if sunken {#ffffff}else{raised_light}
|
|
let dark=if sunken {if d<1.0 {#808080}else{#404040}}else{raised_dark}
|
|
let edge=if upper {if sunken {dark}else{light}}else{if sunken {light}else{dark}}
|
|
let color=if d<2.0 {edge}else{fill}
|
|
let focus_p=p-vec2(4.0)
|
|
let focus_q=size-p-vec2(4.0)
|
|
let fd=min(min(focus_p.x,focus_p.y),min(focus_q.x,focus_q.y))
|
|
let dot=fract((floor(p.x)+floor(p.y))*0.5)<0.5
|
|
let face=if self.focus>0.5 && fd>=0.0 && fd<1.0 && dot {#000000}else{color}
|
|
// The wait spinner is drawn by the face, so a style that replaces the
|
|
// face wholesale drops it and a button left waiting looks idle. The
|
|
// hover and disabled mixes are deliberately NOT restored: neither style
|
|
// lit a button under the pointer, and the label carries the disabled
|
|
// state on its own, from draw_text, which no style replaces.
|
|
if self.loading>0.0 {
|
|
let sdf=Sdf2d.viewport(p)
|
|
sdf.clear(face)
|
|
let c=size*0.5
|
|
let r=max(min(size.x,size.y)*0.5-self.loading_inset,1.0)
|
|
let a0=self.anim_time*2.0*PI
|
|
sdf.arc_round_caps(c.x,c.y,r,a0,a0+1.5*PI,self.loading_stroke)
|
|
sdf.fill(vec4(self.loading_color.rgb,self.loading_color.a*self.loading))
|
|
return sdf.result
|
|
}
|
|
return face
|
|
}
|
|
// Sunken white edit fields, independent of the light theme's gradient material.
|
|
mod.widgets.TextInput.draw_bg.pixel = fn() {
|
|
let p=self.pos*self.rect_size
|
|
let size=self.rect_size
|
|
let sunken=true
|
|
let fill=if self.disabled>0.5 {#d4d0c8}else{#ffffff}
|
|
|
|
let tl=min(p.x,p.y)
|
|
let br=min(size.x-p.x,size.y-p.y)
|
|
let d=min(tl,br)
|
|
let upper=tl<br
|
|
let raised_light=if d<1.0 {#ffffff}else{#d4d0c8}
|
|
let raised_dark=if d<1.0 {#404040}else{#808080}
|
|
let light=if sunken {#ffffff}else{raised_light}
|
|
let dark=if sunken {if d<1.0 {#808080}else{#404040}}else{raised_dark}
|
|
let edge=if upper {if sunken {dark}else{light}}else{if sunken {light}else{dark}}
|
|
let color=if d<2.0 {edge}else{fill}
|
|
return color
|
|
}
|
|
|
|
// A white combo field and a separate raised arrow button.
|
|
mod.widgets.DropDown.draw_bg.pixel = fn() {
|
|
let p=self.pos*self.rect_size
|
|
let size=self.rect_size
|
|
let tl=min(p.x,p.y)
|
|
let br=min(size.x-p.x,size.y-p.y)
|
|
let edge=if tl<br {if tl<1.0 {#808080}else{#404040}}else{#ffffff}
|
|
let field=if min(tl,br)<2.0 {edge}else{if self.disabled>0.5 {#d4d0c8}else{#ffffff}}
|
|
let q=p-vec2(size.x-18.0,2.0)
|
|
let bs=vec2(16.0,size.y-4.0)
|
|
if q.x>=0.0 && q.y>=0.0 && q.x<bs.x && q.y<bs.y {
|
|
let a=min(q.x,q.y)
|
|
let b=min(bs.x-q.x,bs.y-q.y)
|
|
let pressed=self.down>0.5 || self.active>0.5
|
|
let face=if min(a,b)<1.0 {if (a<b)!=pressed {#ffffff}else{#808080}}else{#d4d0c8}
|
|
let ay=q.y-(bs.y*0.5-1.0)
|
|
let arrow=ay>=0.0 && ay<=3.0 && abs(q.x-bs.x*0.5)<=3.0-ay
|
|
return if arrow {if self.disabled>0.5 {#808080}else{#000000}}else{face}
|
|
}
|
|
return field
|
|
}
|
|
true
|
|
|
|
// Square two-line panel frames; the app keeps the same resident widgets.
|
|
mod.widgets.PanelView.draw_bg.bevel = 1.0
|
|
mod.widgets.PanelView.draw_bg.border_radius = 0.0
|