2023-11-22 20:38:16 +00:00
|
|
|
maybe_draw_overflow_button = function(x, y, w, r, final_button)
|
|
|
|
if Overflow_button then return x, y end
|
2023-12-02 04:15:46 +00:00
|
|
|
local after = x+w
|
2023-11-22 20:38:16 +00:00
|
|
|
if not final_button then
|
2024-01-15 10:45:55 +00:00
|
|
|
local w2 = Font:getWidth('>>')+10
|
2023-11-22 20:38:16 +00:00
|
|
|
-- only draw a button if there's going to be at least space for the overflow button afterwards
|
2023-12-02 04:15:46 +00:00
|
|
|
after = after+10+w2
|
2023-11-22 20:38:16 +00:00
|
|
|
end
|
|
|
|
if after > r then
|
|
|
|
x, y = overflow_button(x, y)
|
|
|
|
Overflow_button = Global_state.button_handlers[#Global_state.button_handlers]
|
|
|
|
return x, y
|
|
|
|
else
|
|
|
|
return x, y
|
|
|
|
end
|
2023-12-02 04:15:46 +00:00
|
|
|
end
|