add search indicator

This commit is contained in:
Iris Lightshard 2023-03-25 13:23:55 -06:00
parent 24baa38b38
commit 1f41209028
Signed by: nilix
GPG key ID: 3B7FBC22144E6398
2 changed files with 30 additions and 3 deletions

View file

@ -41,6 +41,8 @@ The buttons on the bottom are as follows (with equivalent keybinds):
There is a resize handle in the bottom right - clicking and dragging it resizes the window.
At the bottom-left, a small indicator will appear if you have a search query active. Performing the refresh action or switching mailboxes will make it disappear.
### reading mail
Reading mail is currently done in a terminal that pipes the mail content into `less` and gives some keybind options:

View file

@ -55,10 +55,10 @@
|0000
@refresh [ &mboxes $1 &list $1 &fg $1 &btns $1 &textbox $1 ]
@refresh [ &mboxes $1 &list $1 &fg $1 &btns $1 &textbox $1 &etc $1 ]
@resizing [ $1 &x $2 &y $2 &dx $2 &dy $2 ]
@decoding [ $1 &msg_type $1 &counting $1 &count $2 &processed $2 ]
@textbox [ &mode $1 &len $1 &cursor $1 &msg $2 ]
@textbox [ &mode $1 &len $1 &cursor $1 &msg $2 &searching $1 ]
@mboxes [ &bytes $2 &data $2 &len $2 &offset $2 &elem_offset $1
&top $2 &height $1 &select_index $2 &select_len $2
&sb_len $1 &sb_pos $2 &sb_step $2 ]
@ -202,6 +202,9 @@ JMP2r
#01 .Console/write DEO
;selected_mbox strlen SWP .Console/write DEO .Console/write DEO
;selected_mbox send_str
#00 .textbox/searching STZ
#01 .refresh/etc STZ
JMP2r
@ -218,6 +221,8 @@ JMP2r
SEARCH_MAIL .Console/write DEO
;textbox_text strlen SWP .Console/write DEO .Console/write DEO
;textbox_text send_str
#01 .textbox/searching STZ
#01 .refresh/etc STZ
JMP2r
@ -529,6 +534,7 @@ JMP2r
#01 .refresh/list STZ
#01 .refresh/mboxes STZ
#01 .refresh/btns STZ
#01 .refresh/etc STZ
.Screen/height DEI2 TOP_SECTION BOTTOM_SECTION ADD2 MID_SEPARATOR ADD2 SUB2 #03 SFT2 NIP .list/height STZ
.Mouse/state DEI
@ -744,16 +750,33 @@ JMP2r
draw_bone
.textbox/msg LDZ2 #0008 .Screen/height DEI2 #0010 SUB2 #02 draw_str
&no_textbox
.refresh/etc LDZ #00 EQU ,&no_etc JCN
draw_search_indicator
draw_resize_handle
#00 .refresh/etc STZ
&no_etc
.refresh/fg LDZ #00 EQU ,&no_fg JCN
clear_fg
draw_resize_handle
draw_cursor
#00 .refresh/fg STZ
&no_fg
BRK
@draw_search_indicator ( -> )
.textbox/searching LDZ #00 EQU ,&nothing JCN
;search_indicator #0000 .Screen/height DEI2 #0008 SUB2 #01 draw_str
JMP2r
&nothing
#0000 .Screen/x DEO2
.Screen/height DEI2 #0008 SUB2 .Screen/y DEO2
;blank .Screen/addr DEO2
#01 .Screen/sprite DEO
JMP2r
@draw_bone ( -> )
#0008 .textbox/cursor LDZ #00 SWP #30 SFT2 ADD2 .Screen/x DEO2
@ -1047,6 +1070,8 @@ JMP2r
( -== data ==- )
@search_indicator "$ 00
@search_lbl "SEARCHING: 20 "type 20 "query 20 "and 20 "press 20 "{enter}; 20 "{esc} 20 "to 20 "go 20 "back 00
@refile_lbl "REFILING: 20 "type 20 "destination 20 "and 20 "press 20 "{enter}; 20 "{esc} 20 "to 20 "go 20 "back 00