Commit graph

31 commits

Author SHA1 Message Date
Gianguido Sorà
5243e8c258 feat: user interaction-enabled slider
This commit adds `modals::Modals::slider()` with the same interface as
`modals::Modals::start_progress()`, with the striking difference that
users can move the slider, and press the center keypad button to confirm
 the selection.

 Useful for objects like audio volume controls.
2022-11-14 19:36:25 +01:00
bunnie
11287938ab add bip39 facilities to the modals server 2022-07-06 04:52:52 +08:00
bunnie
77886fae4a adjust dead-weight size of qrtext down wards
the sizing was such that two pages of data had to be prepared
for even very short messages. This change fits the message back
into one page of data once again.
2022-07-05 13:07:04 +08:00
Sean Cross
f131a77d4e modals: define opcode numbers for opcodes
Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-26 16:44:40 +08:00
bunnie
fc8e5df2b1 Merge remote-tracking branch 'origin/dither2' into dp2-merge 2022-06-14 16:45:38 +08:00
nworbnhoj
069b54f86b rustfmt modals api 2022-06-04 16:54:22 +10:00
bunnie
da06d95acd add a deferred listener for keyboard events from a dynamic notification 2022-06-01 22:31:44 +08:00
bunnie
7d020182d4 integrate ditherpunk as a feature 2022-05-27 17:28:15 +08:00
nworbnhoj
7f66291a38 implement Image modal
Now you can:
let mut input = std::env::current_dir().unwrap();
input.push("../services/modals/src/tests/bunny.png");
let img = Img::<RGB<u8>>::load(&input).unwrap();
modals.show_image(img).expect("image failed");
2022-05-21 06:42:27 +10:00
nworbnhoj
dd1ce051d1 refine qrcode handling
- expand max text.len to 4096
- throw error on overrun
- simplify qrcode rendering (reduced memory & math)
- correct module size by 1px
2022-05-08 10:00:41 +10:00
bunnie
f8246b14f5 run rustfmt on the modals crate 2022-04-24 21:40:42 +08:00
bunnie
547783d195
Merge pull request #150 from nworbnhoj/qrcode
enable notification modal text + qrcode
2022-04-24 21:36:38 +08:00
bunnie
62d56fb70b
Merge pull request #149 from nworbnhoj/index
modal selected index support
2022-04-24 21:27:08 +08:00
nworbnhoj
0e561802ce enable notification modal text + qrcode
change the notification modal to accept the primary message and an
Option of independent text to display as a qrcode

pub fn show_notification(&self, notification: &str, qrtext:Option<&str>) -> Result<(), xous::Error> {}
2022-04-24 21:29:15 +10:00
nworbnhoj
e879ff4b17 modal selected index support
Support for:
- obtaining the index of the selected radiobutton & checkbox
- adding a Vec<&str> of items
2022-04-24 08:28:02 +10:00
bunnie
2c3143f790 Merge branch 'main' into multi-text-modals 2022-04-22 15:54:18 +08:00
bunnie
3f962b6bb0 make progress updates fail gracefully on server queue full
Progress updates can come at a right too high for the renderer
to keep up, so instead of deadlocking, we discard update messages
that are too frequent.
2022-04-08 18:55:56 +08:00
nworbnhoj
8c5c2228d2 Merge branch 'main' into qrcode 2022-04-08 16:22:19 +10:00
nworbnhoj
2a957e55cd add as_qrcode to Notification modal 2022-04-08 14:16:15 +10:00
Gianguido Sorà
8dd41a1ffa adapt interface to newer modals 2022-04-07 16:39:16 +02:00
Gianguido Sorà
8123393a7d Merge branch 'main' into feature/multi-text-modals 2022-04-07 16:39:03 +02:00
bunnie
c97a00ed1f refactor validator to not create a new single-use server 2022-04-07 04:38:38 +08:00
bunnie
f720f3175c refactor main loop to use deferred responses
I think things could be compactified even further, but this is a
first-step "merge the threads and break as few things as possible"
pass. Would like to get @gsora's multi-line boxes merged into this
new system before doing even more optimization.
2022-04-07 04:04:37 +08:00
Gianguido Sorà
ba347f6c79 add placeholders, current selection highlight 2022-04-05 16:18:43 +02:00
Gianguido Sorà
0b62a2657a feature: generalization of modals.get_text()
Added a get_text_multi() method on modals which builds, shows and returns text taken from a modal view with a given amount of fields.

Calling get_text() is equal to a call to get_text_multi() with fields = 1.
2022-03-31 19:24:53 +02:00
bunnie
6653d42114 cleanup UX context registry
it's now a much smaller nightmare to maintain the registry, as all
the items are concentrated into a single location
2022-01-23 14:31:21 +08:00
bunnie
a8d7c7e9e2 cleann up the oqc test 2022-01-12 02:01:33 +08:00
bunnie
725d943198 add interlocking so multiple threads don't interfere with each other 2021-12-17 01:55:36 +08:00
bunnie
0fb1bea428 add radio buttons and checkboxes to the modals meta-handler 2021-12-17 00:32:44 +08:00
bunnie
44453bcbde refactor checkboxes and radiobuttons to use dynamically allocated lists 2021-12-16 23:16:21 +08:00
bunnie
e48c472b32 helps to add the code for the new service 2021-12-15 13:46:43 +08:00