consistent names in a few more places

This commit is contained in:
Kartik K. Agaram 2022-12-23 19:26:05 -08:00
parent 2b3e09ca0f
commit e0448d7d7f
6 changed files with 16 additions and 16 deletions

View File

@ -218,7 +218,7 @@ function Drawing.in_drawing(drawing, line_cache, x,y, left,right)
return y >= line_cache.starty and y < line_cache.starty + Drawing.pixels(drawing.h, width) and x >= left and x < right
end
function Drawing.mouse_pressed(State, drawing_index, x,y, mouse_button)
function Drawing.mouse_press(State, drawing_index, x,y, mouse_button)
local drawing = State.lines[drawing_index]
local line_cache = State.line_cache[drawing_index]
local cx = Drawing.coord(x-State.left, State.width)

View File

@ -195,7 +195,7 @@ function edit.quit(State)
end
end
function edit.mouse_pressed(State, x,y, mouse_button)
function edit.mouse_press(State, x,y, mouse_button)
if State.search_term then return end
--? print('press', State.selection1.line, State.selection1.pos)
if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
@ -231,7 +231,7 @@ function edit.mouse_pressed(State, x,y, mouse_button)
State.lines.current_drawing_index = line_index
State.lines.current_drawing = line
Drawing.before = snapshot(State, line_index)
Drawing.mouse_pressed(State, line_index, x,y, mouse_button)
Drawing.mouse_press(State, line_index, x,y, mouse_button)
break
end
end
@ -508,7 +508,7 @@ end
function edit.run_after_mouse_click(State, x,y, mouse_button)
App.fake_mouse_press(x,y, mouse_button)
edit.mouse_pressed(State, x,y, mouse_button)
edit.mouse_press(State, x,y, mouse_button)
App.fake_mouse_release(x,y, mouse_button)
edit.mouse_release(State, x,y, mouse_button)
App.screen.contents = {}
@ -518,7 +518,7 @@ end
function edit.run_after_mouse_press(State, x,y, mouse_button)
App.fake_mouse_press(x,y, mouse_button)
edit.mouse_pressed(State, x,y, mouse_button)
edit.mouse_press(State, x,y, mouse_button)
App.screen.contents = {}
edit.update(State, 0)
edit.draw(State)

View File

@ -194,7 +194,7 @@ end
function log_browser.quit(State)
end
function log_browser.mouse_pressed(State, x,y, mouse_button)
function log_browser.mouse_press(State, x,y, mouse_button)
local line_index = log_browser.line_index(State, x,y)
if line_index == nil then
-- below lower margin

View File

@ -227,9 +227,9 @@ end
function App.mousepressed(x,y, mouse_button)
--? print('mouse press', x,y)
if Current_app == 'run' then
if run.mouse_pressed then run.mouse_pressed(x,y, mouse_button) end
if run.mouse_pressed then run.mouse_press(x,y, mouse_button) end
elseif Current_app == 'source' then
if source.mouse_pressed then source.mouse_pressed(x,y, mouse_button) end
if source.mouse_pressed then source.mouse_press(x,y, mouse_button) end
else
assert(false, 'unknown app "'..Current_app..'"')
end

View File

@ -285,14 +285,14 @@ function source.settings()
}
end
function source.mouse_pressed(x,y, mouse_button)
function source.mouse_press(x,y, mouse_button)
Cursor_time = 0 -- ensure cursor is visible immediately after it moves
--? print('mouse click', x, y)
--? print(Editor_state.left, Editor_state.right)
--? print(Log_browser_state.left, Log_browser_state.right)
if Show_file_navigator and y < Menu_status_bar_height + File_navigation.num_lines * Editor_state.line_height then
-- send click to buttons
edit.mouse_pressed(Editor_state, x,y, mouse_button)
edit.mouse_press(Editor_state, x,y, mouse_button)
return
end
if x < Editor_state.right + Margin_right then
@ -301,14 +301,14 @@ function source.mouse_pressed(x,y, mouse_button)
Focus = 'edit'
return
end
edit.mouse_pressed(Editor_state, x,y, mouse_button)
edit.mouse_press(Editor_state, x,y, mouse_button)
elseif Show_log_browser_side and Log_browser_state.left <= x and x < Log_browser_state.right then
--? print('click on log_browser side')
if Focus ~= 'log_browser' then
Focus = 'log_browser'
return
end
log_browser.mouse_pressed(Log_browser_state, x,y, mouse_button)
log_browser.mouse_press(Log_browser_state, x,y, mouse_button)
for _,line_cache in ipairs(Editor_state.line_cache) do line_cache.starty = nil end -- just in case we scroll
end
end

View File

@ -208,7 +208,7 @@ function edit.quit(State)
end
end
function edit.mouse_pressed(State, x,y, mouse_button)
function edit.mouse_press(State, x,y, mouse_button)
if State.search_term then return end
--? print('press')
if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then
@ -243,7 +243,7 @@ function edit.mouse_pressed(State, x,y, mouse_button)
State.lines.current_drawing_index = line_index
State.lines.current_drawing = line
Drawing.before = snapshot(State, line_index)
Drawing.mouse_pressed(State, line_index, x,y, mouse_button)
Drawing.mouse_press(State, line_index, x,y, mouse_button)
break
end
end
@ -561,7 +561,7 @@ end
function edit.run_after_mouse_click(State, x,y, mouse_button)
App.fake_mouse_press(x,y, mouse_button)
edit.mouse_pressed(State, x,y, mouse_button)
edit.mouse_press(State, x,y, mouse_button)
App.fake_mouse_release(x,y, mouse_button)
edit.mouse_release(State, x,y, mouse_button)
App.screen.contents = {}
@ -571,7 +571,7 @@ end
function edit.run_after_mouse_press(State, x,y, mouse_button)
App.fake_mouse_press(x,y, mouse_button)
edit.mouse_pressed(State, x,y, mouse_button)
edit.mouse_press(State, x,y, mouse_button)
App.screen.contents = {}
edit.update(State, 0)
edit.draw(State)