2023-11-26 07:03:20 +00:00
|
|
|
-- draw a button in the menu if possible
|
|
|
|
-- if not, stash it behind an overflow ('>>') button
|
2024-02-23 02:27:39 +00:00
|
|
|
overflowable_button = function(name, x, y, r, onpress1, final_button, tooltip_text)
|
2024-01-15 10:45:55 +00:00
|
|
|
local w = Font:getWidth(name)+10
|
2023-12-02 03:59:23 +00:00
|
|
|
local x2, y2 = maybe_draw_overflow_button(x, y, w, r, final_button)
|
2023-11-26 05:11:24 +00:00
|
|
|
if Overflow_button then
|
|
|
|
-- overflow
|
2023-12-05 06:09:47 +00:00
|
|
|
if Show_menu ~= 'overflow' then
|
2023-11-26 05:11:24 +00:00
|
|
|
return x, y
|
|
|
|
else
|
|
|
|
y = y2
|
|
|
|
end
|
|
|
|
end
|
2024-02-23 02:27:39 +00:00
|
|
|
styled_button(name, x,y, onpress1, tooltip_text)
|
2023-11-26 05:11:24 +00:00
|
|
|
if Overflow_button then
|
|
|
|
return x, y+Line_height
|
|
|
|
else
|
|
|
|
return x+w+10, y
|
|
|
|
end
|
2024-02-23 02:27:39 +00:00
|
|
|
end
|