amenui
en·中 github ↗ v0.0.1
01文档 02组件 03实验室 04作品
en·中github ↗
×

文档 / 组件 / 展示 / 图片 文档 / 组件 / 展示 /

图片

04.11
本页内容 ▾
  1. 安装
  2. 用法
  3. 接口
  4. 键盘与无障碍

按原比例显示一张图片。

图片松开时变成记号;指针在图上移动时,图会在指针附近松开。

由 amenui 绘制打开 ↗

安装

组件以源码分发。把它和它依赖的文件拷进你的项目,再按需要改:

sh
cargo run --release --bin amenui -- add image --to ../my-app

拷贝的文件: src/widgets/image.rs, src/widgets/mod.rs

用法

rust
use amenui::widgets::{image};

fn view() -> El<Msg> {
    image("im1", amenui::pictures::SKY, 0.6, 0, Some("天空"))
}

接口

函数image
参数key, id (picture id), ratio (height / width), slot (Markr set for its marks), caption.
文件src/widgets/image.rs
依赖base
对波前的响应loosen (decoration)
重组keyed labels recompose when their text changes

键盘与无障碍

状态rest; loosens into its marks under fronts and the lens.
键盘与消息none.

在网页上,每个控件都在页面里有一个带角色和名字的镜像元素,读屏软件和浏览器自己的焦点都看得到它(DESIGN.md §1.14)。