Commit graph

66 commits

Author SHA1 Message Date
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
2070236695 minor refinements requested on PR 2022-04-24 20:09:43 +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
dd462aebb2 remove trailing/open white spaces 2022-04-22 15:54:43 +08:00
bunnie
2c3143f790 Merge branch 'main' into multi-text-modals 2022-04-22 15:54:18 +08:00
bunnie
bac6c25bfe conversion toward standard testing method 2022-04-22 15:10:51 +08:00
Gianguido Sorà
d06c6dcb32 modals: refuse to build modal if no fields have been provided 2022-04-13 16:59:17 +02:00
Gianguido Sorà
0c17bb6e34 modals: get rid of fields_amt value in alert modal builder, can be inferred 2022-04-13 16:57:36 +02:00
Gianguido Sorà
89c768625d modals: add builder-based interface to present alerts with text fields inside 2022-04-13 15:49:31 +02: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
bunnie
3ef2dae2f0 revert test config and make chinese text also render qr code 2022-04-08 16:05:42 +08:00
bunnie
b4dad54315 fix missing unlock() statement at end of modals 2022-04-08 15:58:59 +08:00
bunnie
fb4ce334c4 missed an instance in a demo app 2022-04-08 15:27:40 +08:00
bunnie
cd8c762c55 patch up QR code PR, change method signature as discussed
now any modal notification can also render as a QR code
2022-04-08 15:19:56 +08:00
bunnie
679fde33a7
Merge pull request #137 from nworbnhoj/qrcode
add as_qrcode to Notification modal
2022-04-08 14:28:26 +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à
ec9fdb0e42 make text entry work
pro tip: make sure your types are synchronized between Buffer calls!
2022-04-07 17:05:19 +02: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
28de1b27a6 add some documentation to modals 2022-04-07 14:24:10 +08: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
bunnie
360e50a8bb refactor locking to use deferred responses 2022-04-07 02:19:37 +08:00
Gianguido Sorà
5c975fdee4 make single-field modals accept a placeholder 2022-04-05 16:28:58 +02: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
Gianguido Sorà
83e61f5f1b feat: add wiring for multiple TextEntryPayloads drawing 2022-03-31 17:54:22 +02:00
bunnie
29dab322ed add some comments on the modals tests. 2022-03-30 03:40:11 +08:00
bunnie
bd78ba94f1 refactor time setting modals into a separate thread
modals don't work when triggered in the status thread in hosted
mode (but they do, somehow, on real hardware). I think this
is an actual locking problem that would exhibit itself if
we had a true multiprocessor system, but since real hardware
is a single processor it doesn't show.
2022-03-28 15:25:43 +08:00
bunnie
6fefd6cdf5 small tweak that makes hosted mode run a little more smoothly 2022-03-28 04:31:37 +08:00
bunnie
7b45241f2a cleanup a warning when not in tts mode 2022-03-11 18:39:10 +08:00
bunnie
9f6e444e3f back out testing structures 2022-03-10 23:45:49 +08:00
bunnie
33c25b0804 add TTS translations strings for describing modal meta-actions 2022-03-10 23:44:56 +08:00
bunnie
e8b13fcb44 integrate TTS into more dialog boxes and modals
also tighten up the `blocking` method for TTS for prompts that
absolutely should not be truncated or overriden.
2022-03-10 23:40:35 +08:00
bunnie
80a835ba83 fix up warnings and latest cargo.toml 2022-03-10 15:33:14 +08:00
bunnie
b4a34bd9ec add busy-wait queuing for alerts in case multiple alerts pop up
this case happens when e.g. you're asking for a password but
then the connection manager throws an error.
2022-02-05 02:03:56 +08:00
bunnie
08421999ad part-way through a refactor of trust levels to prevent alerts from popping over password boxes 2022-02-04 23:59:20 +08:00
bunnie
b35f2a1d3e catch and handle fat-finger UX events better
they used to panic, now they just print a warning
2022-02-04 18:22:17 +08:00
bunnie
827888ccbb fix up the REFCOUNT on connections
Was doing disjoint loads and stores on an Atomic, really, should
be using the fetch_add, fetch_sub variants to be proper.

Didn't seem to impact anything but maybe there's a future version
of me that high fives me for doing this.
2022-01-31 23:13:10 +08: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
747891eaad clean up some minor details on UX formatting 2022-01-22 01:51:02 +08:00
bunnie
2642e6c075 various UX fixes that take advantage of the new font rendering engine 2022-01-22 00:10:31 +08:00
bunnie
0677753680 it's not a flaming mess anymore, but still a lot more tuning to do 2022-01-21 02:35:46 +08:00
bunnie
356d95a266 yet another refactor of the word wrapping
Really clear up the roles and structures of word wrapping.

Significantly, we have now figured out that the word wrapper
should be the word wrapper, and that the text bounds should
be computed by a text bounds computation.

Conflating flexible text bounds with word wrapping makes
the math really hard.

So, the word wrapper always works with a bounding area starting
at 0,0, and will wrap until it hits a Point designated as its
absolute max bounds.

The returned typeset block is referenced to 0,0, and then it
is shifted to the correct location by the rendering function.

This externalizes the computation of the final location plus
the rendering bounds to the outer functions that need to care
about this, thus simplifying the word wrapper significantly.
2022-01-20 18:30:13 +08:00
bunnie
18130cddae fix suspend/resume regression
had to pin down the correct order of events to avoid lockups on suspend
2022-01-17 22:46:18 +08:00
bunnie
2c711036a9 add a submenu for PDDB operations 2022-01-17 01:59:38 +08:00