pad out overflow buttons to prevent fat fingering
Dependencies
- [2]
AZMYKWMHresolve conflicts - [3]
I2YECDRFdecouple menu font from output buffer - [4]
Q3EQI5LIsome keyboard shortcuts on non-mobile devices - [5]
SIJ5I4NZextract a helper for buttons - [6]
W4EQ6IW4simplify state management for menus - [7]
JV27LDDKsliders for font size and color settings - [8]
W3RRTO4Pextract a second helper for buttons - [9]
5RUFNRJOstart of the visual skeleton - [*]
R5QXEHUIsomebody stop me - [*]
5MEJ7XNHlay out buttons based on device dimensions - [*]
PRE6XPRNresponsively increase/decrease font height
Change contents
- file addition: 0186-find_overflow_button[11.2]
find_overflow_button = function()if Overflow_button == nil then return endfor i,button in ipairs(Global_state.button_handlers) doif button == Overflow_button thenlocal max_width = 0for j=i+1, #Global_state.button_handlers dolocal b = Global_state.button_handlers[j]max_width = math.max(max_width, b.w)endreturn i, max_widthendendend - file addition: 0185-redraw_overflow_buttons[11.2]
redraw_overflow_buttons = function(y)if Show_menu ~= 'overflow' then return endlocal bottom = y + 10App.color(Menu_background)local overflow_button_index, overflow_width = find_overflow_button()if overflow_button_index == nil thenerror('overflow button not found')endlove.graphics.rectangle('fill', Overflow_button.x-5, Menu_bottom, overflow_width+10, bottom - Menu_bottom)for j=overflow_button_index+1, #Global_state.button_handlers dolocal b = Global_state.button_handlers[j]b.icon(b)endend - replacement in 0118-overflowable_button at line 11
y = y2y = y2 + 10 - edit in 0021-draw_menu at line 46[12.4930][13.1344]
-- done computing all menu buttons; now redraw them with a background under themredraw_overflow_buttons(y) - replacement in 0021-draw_menu at line 58
end[3.5795]end