From 0d4500e41df353f47e9214fe372502fcd47554ca Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 21 Nov 2023 23:11:14 -0800 Subject: [PATCH] Mike's suggested button layout * No more 'clone', now that I realize we can share definitions between panes. * New 'stop' button. --- 0021-draw_menu | 10 ++++++++-- 0051-run_button | 4 ++-- 0106-stop_button | 12 ++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 0106-stop_button diff --git a/0021-draw_menu b/0021-draw_menu index 246c8ef..6647601 100644 --- a/0021-draw_menu +++ b/0021-draw_menu @@ -8,6 +8,10 @@ draw_menu = function() x = x+5 + App.width(tostring(Current_pane_index)) + 10 -- main buttons x = run_button(x) + x = stop_button(x) + App.color{r=0.5, g=0.5, b=0.5} + love.graphics.print('code', x, Menu_top+5) + x = x+App.width('code')+10 if Show_code then x = hide_code_button(x) else @@ -15,9 +19,11 @@ draw_menu = function() end x = copy_button(x) x = paste_button(x) - x = new_pane_button(x) - x = duplicate_pane_button(x) x = clear_pane_button(x) + App.color{r=0.5, g=0.5, b=0.5} + love.graphics.print('screen', x, Menu_top+5) + x = x+App.width('screen')+10 + x = new_pane_button(x) x = delete_pane_button(x) -- settings button on right local w = App.width('settings') diff --git a/0051-run_button b/0051-run_button index 46191b9..54e0121 100644 --- a/0051-run_button +++ b/0051-run_button @@ -1,10 +1,10 @@ run_button = function(x) - local w = App.width('Run')+10 + local w = App.width('run')+10 button(Global_state, 'run', {x=x, y=Menu_top+5, w=w, h=Line_height, bg={r=0.6, g=0.8, b=0.6}, icon = function(p) App.color(Normal_color) love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2) - love.graphics.print('Run', p.x+5,p.y+2) + love.graphics.print('run', p.x+5,p.y+2) end, onpress1 = function() -- ## run: initialize diff --git a/0106-stop_button b/0106-stop_button new file mode 100644 index 0000000..15ed013 --- /dev/null +++ b/0106-stop_button @@ -0,0 +1,12 @@ +stop_button = function(x) + local w = App.width('stop')+10 + button(Global_state, 'stop', {x=x, y=Menu_top+5, w=w, h=Line_height, bg={r=0.6, g=0.8, b=0.6}, + icon = function(p) + App.color(Normal_color) + love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2) + love.graphics.print('stop', p.x+5,p.y+2) + end, + onpress1 = clear_handlers, + }) + return x+w+10 +end \ No newline at end of file