start of the visual skeleton

akkartik
Nov 15, 2023, 3:05 PM
5RUFNRJOK3PXQKJTPDEN5K5PI67MGB25QUA44WOCCH2O5KHXT45QC

Dependencies

  • [2] ICS45BIL editor widget now takes a bottom margin
  • [3] ZM7NOBRM new fork: carousel shell
  • [*] R5QXEHUI somebody stop me

Change contents

  • file addition: 0028-draw_output_border (----------)
    [5.2]
    draw_output_border = function()
    -- hack: computing based on editor before output exists
    local x1 = Editor_state.left-5-Line_number_padding
    local x2 = Editor_state.right+5
    local y1 = Editor_state.bottom+5+10
    -- upper border
    love.graphics.line(x1,y1, x2,y1)
    love.graphics.line(x1,y1, x1,y1+10)
    love.graphics.line(x2,y1, x2,y1+10)
    end
  • file addition: 0027-Menu_background (----------)
    [5.2]
    Menu_background = {r=0.2, g=0.2, b=0.2}
  • file addition: 0026-Menu_bottom (----------)
    [5.2]
    Menu_bottom = 0
  • file addition: 0025-Menu_height (----------)
    [5.2]
    Menu_height = 0
  • file addition: 0024-Menu_left (----------)
    [5.2]
    Menu_left = 0
  • file addition: 0023-Menu_top (----------)
    [5.2]
    Menu_top = 0
  • file addition: 0021-draw_menu (----------)
    [5.2]
    draw_menu = function()
    App.color(Menu_background)
    love.graphics.rectangle('fill', 0,0, App.screen.width, Menu_bottom)
    button(Editor_state, 'run', {x=Menu_left+5, y=Menu_top+5, w=App.width('Run')+10, h=Line_height, bg={r=0.5, g=0.8, b=0.5},
    icon = function(p)
    App.color{r=0,g=0,b=0}
    love.graphics.print('Run', p.x+5,p.y+2)
    end,
    onpress1 = function()
    print('run')
    end,
    })
    end
  • file addition: 0020-draw_editor_border (----------)
    [5.2]
    draw_editor_border = function()
    local x1 = Editor_state.left-5-Line_number_padding
    local y1 = Editor_state.top-5
    local x2 = Editor_state.right+5
    local y2 = Editor_state.bottom+5
    -- upper border
    love.graphics.line(x1,y1, x2,y1)
    love.graphics.line(x1,y1, x1,y1+10)
    love.graphics.line(x2,y1, x2,y1+10)
    -- lower border
    love.graphics.line(x1,y2, x2,y2)
    love.graphics.line(x1,y2, x1,y2-10)
    love.graphics.line(x2,y2, x2,y2-10)
    end
  • edit in 0016-on.mouse_press at line 2
    [3.2409]
    [3.2409]
    if mouse_press_consumed_by_any_button_handler(Editor_state, x,y, mouse_button) then
    return
    end
  • replacement in 0012-on.draw at line 2
    [3.2921][3.2921:3008]()
    love.graphics.rectangle('line', 100-5-Line_number_padding,100-5, 400+10, 200+10, 5,5)
    [3.2921]
    [3.3008]
    Editor_state.button_handlers = {}
    draw_editor_border()
    -- love.graphics.rectangle('line', 100-5-Line_number_padding,100-5, 300+Line_number_padding+10, 200+10, 5,5)
  • edit in 0012-on.draw at line 6
    [3.3033]
    [3.3033]
    draw_output_border()
    draw_menu()
  • replacement in 0011-on.initialize at line 5
    [3.3276][2.692:800]()
    Editor_state = edit.initialize_state(100, 300, 100, 400, love.graphics.getFont():getHeight(), Line_height)
    [3.3276]
    [3.3379]
    Menu_left, Menu_top = love.window.getSafeArea()
    Menu_height = 5 + Line_height + 5
    Menu_bottom = Menu_top + Menu_height
    Editor_state = edit.initialize_state(
    --[[top]] Menu_bottom + 20, --[[bottom]] App.screen.height/2-5,
    --[[left]] 100, --[[right]] 400,
    love.graphics.getFont():getHeight(), Line_height)
  • replacement in 0011-on.initialize at line 13
    [3.3410][2.801:805]()
    end
    [3.3410]
    end