diff options
| author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-11-06 09:52:26 +0100 |
|---|---|---|
| committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-11-06 09:52:26 +0100 |
| commit | d5967c1b91b14b3b4e5b0d9663e8a4d2a5e80533 (patch) | |
| tree | 4ac34f1e81b73b24139ac0eafa2db72f524f2a42 /crates/wipfel/src/widgets.rs | |
| parent | dbc0fd52a8497c5002e8311eb1728050a4e97c7a (diff) | |
wasm front end becomes the main gipfel; add desktop installers
- rename crates/wipfel -> crates/gipfel (crate, wasm artifact, dist,
scripts, page titles); slogan back to "Photogrammetry for Mountain
Images"; crates/wipfel-tauri -> crates/gipfel-desktop
- new features in the wasm app: Save image (gipfel JPEG comment, same
format as before, via browser download) and lens distortion profiles
stored in localStorage in FLTK prefs format with camera auto-match
on image load; profile name field, save/load and dropdown
- gipfel-core: read GPSImgDirection from EXIF (magnetic -> true) as
azimuth fallback; expose parse_prefs/serialize_prefs for the wasm
build; ?file=/?az=/?pitch=/?roll=/?focal=/?vis= URL parameters
- Tauri v2 wrapper crate building .deb, AppImage and (cross-compiled)
Windows NSIS installers; safe stage-and-swap build-release.sh
- README: web-centric Installation, concise Build section for the
official targets (Web, Windows, Linux); drop native/Android mentions
- release site moved dist/wipfel -> dist/gipfel
Diffstat (limited to 'crates/wipfel/src/widgets.rs')
| -rw-r--r-- | crates/wipfel/src/widgets.rs | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/crates/wipfel/src/widgets.rs b/crates/wipfel/src/widgets.rs deleted file mode 100644 index 93e2cdc..0000000 --- a/crates/wipfel/src/widgets.rs +++ /dev/null @@ -1,106 +0,0 @@ -//! Small form controls: full-width slider with value readout above -//! (mirrors the desktop `slider_item` layout) and a numeric input row. - -use web_sys::{HtmlInputElement, InputEvent}; -use yew::prelude::*; - -#[derive(Properties, PartialEq)] -pub struct SliderProps { - pub label: AttrValue, - /// formatted value shown right of the label - pub display: AttrValue, - pub value: f64, - pub min: f64, - pub max: f64, - pub step: f64, - pub onchange: Callback<f64>, -} - -#[function_component(SliderItem)] -pub fn slider_item(p: &SliderProps) -> Html { - // live update while dragging (oninput), not only on release - let oninput = { - let onchange = p.onchange.clone(); - Callback::from(move |e: InputEvent| { - let input: HtmlInputElement = e.target_unchecked_into(); - if let Ok(v) = input.value().parse::<f64>() { - onchange.emit(v); - } - }) - }; - html! { - <div class="slider"> - <div class="sliderhead"> - <span>{ p.label.as_ref().to_string() }</span> - <span class="val">{ p.display.as_ref().to_string() }</span> - </div> - <input - type="range" - min={p.min.to_string()} - max={p.max.to_string()} - step={p.step.to_string()} - value={p.value.to_string()} - {oninput} - /> - </div> - } -} - -/// single-line text row (e.g. paste a GPS string) -#[derive(Properties, PartialEq)] -pub struct TextProps { - pub label: AttrValue, - pub placeholder: AttrValue, - pub onchange: Callback<String>, -} - -#[function_component(TextItem)] -pub fn text_item(p: &TextProps) -> Html { - let onchange = { - let onchange = p.onchange.clone(); - Callback::from(move |e: Event| { - let input: HtmlInputElement = e.target_unchecked_into(); - onchange.emit(input.value()); - }) - }; - html! { - <label class="numrow"> - <span>{ p.label.as_ref().to_string() }</span> - <input - type="text" - placeholder={p.placeholder.as_ref().to_string()} - {onchange} - /> - </label> - } -} - -#[derive(Properties, PartialEq)] -pub struct NumProps { - pub label: AttrValue, - pub value: f64, - pub step: f64, - #[prop_or(2)] - pub decimals: usize, - pub onchange: Callback<f64>, -} - -#[function_component(NumItem)] -pub fn num_item(p: &NumProps) -> Html { - let onchange = { - let onchange = p.onchange.clone(); - Callback::from(move |e: Event| { - let input: HtmlInputElement = e.target_unchecked_into(); - if let Ok(v) = input.value().parse::<f64>() { - onchange.emit(v); - } - }) - }; - let display = format!("{:.*}", p.decimals, p.value); - html! { - <label class="numrow"> - <span>{ p.label.as_ref().to_string() }</span> - <input type="number" step={p.step.to_string()} value={display} {onchange} /> - </label> - } -} |
