launcher: Add "Quit Launcher" menu item

This commit is contained in:
Ry 2022-10-14 21:34:51 -07:00
parent ce094891ce
commit 2997fb7c85
2 changed files with 46 additions and 35 deletions

View File

@ -45,6 +45,11 @@ event_loop:
call yield_task
jmp event_loop
quit_launcher:
call disable_menu_bar
call end_current_task
jmp hang
allocate_error:
mov r0, allocate_error_str
mov r1, 16

View File

@ -49,11 +49,16 @@ system_menu_click_event:
; r2 contains the clicked root menu
; r3 contains the clicked menu item
; about
cmp r3, 0
ifz jmp about_dialog
; shut down
; quit launcher
cmp r3, 1
ifz jmp quit_launcher
; shut down
cmp r3, 2
ifz icl
ifz halt
@ -68,9 +73,10 @@ menu_items_system_name:
menu_items_launcher_name:
data.8 8 data.str "Launcher" data.8 0x00 ; text length, text, null-terminator
menu_items_system_list:
data.8 2 ; number of items
data.8 11 ; menu width (usually longest item + 2)
data.8 3 ; number of items
data.8 15 ; menu width (usually longest item + 2)
data.8 5 data.str "About" data.8 0x00 ; text length, text, null-terminator
data.8 13 data.str "Quit Launcher" data.8 0x00 ; text length, text, null-terminator
data.8 9 data.str "Shut Down" data.8 0x00 ; text length, text, null-terminator
menu_items_launcher_list: ; reserve enough room for up to 28 items
data.8 1 ; number of items