makepad/examples/splash_live/streams/calculator/02_keys.splash
Admin ec2bb0f985 apps: Camera, splash-live, Translator, Amp, Code, Route offline
New Camera app whose shots show up in Photos, and the splash_live example
(streamed live coding of Splash UI and shaders). Translator: speech and
photos run where the models run (hub or on-device), microphone opened only
on record. Amp: cubic volume, meters after volume, visualizer on the phone,
output open only while playing. Code: run errors marked in the editor,
start_app/list_apps through the WM. Route works offline from its cache.
apps/video plays through the platform's player.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 07:24:22 +02:00

51 lines
1.6 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// A calculator, written in Splash
let Key = ButtonFlat{
width: Fill height: 88
}
let FnKey = Key{
}
let OpKey = Key{
}
let EqKey = Key{
}
View{width: Fill height: Fit align: Align{x: 0.5}
calc := RoundedView{width: 560 height: Fit flow: Down spacing: 16 padding: 28
show_bg: true new_batch: true
draw_bg.color: #x14161b
display := View{width: Fill height: 190 flow: Down spacing: 6 align: Align{x: 1.0 y: 1.0}
expr := Label{text: ""}
value := Label{text: "0"}
}
keys := View{width: Fill height: Fit flow: Down spacing: 14
View{width: Fill height: Fit flow: Right spacing: 14
FnKey{text: "C"}
FnKey{text: "±"}
FnKey{text: "%"}
OpKey{text: "÷"}
}
View{width: Fill height: Fit flow: Right spacing: 14
Key{text: "7"}
Key{text: "8"}
Key{text: "9"}
OpKey{text: "×"}
}
View{width: Fill height: Fit flow: Right spacing: 14
Key{text: "4"}
Key{text: "5"}
Key{text: "6"}
OpKey{text: "−"}
}
View{width: Fill height: Fit flow: Right spacing: 14
Key{text: "1"}
Key{text: "2"}
Key{text: "3"}
OpKey{text: "+"}
}
View{width: Fill height: Fit flow: Right spacing: 14
Key{text: "0"}
Key{text: "00"}
EqKey{text: "="}
}
}
}
}