FM5LDKGT3WB343RD2HV7NTE4CGTMC77BTQNAQ5OSDPXD2PEWKWBAC
PCEXCSOW5QISRSCMUIYJCYBFEG7WSJJ6OPSMTWKH455UV76KMUQAC
RU4HIK436ZRQJEPZXFS4FQTYVRL7BK5NWKYFGHFHZQOEOBF7M5SQC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
JOPVPUSAMMU6RFVDQR4NJC4GNNUFB7GPKVH7OS5FKCYS5QZ53VLQC
ECBDENZ4ZEIYS3FJQNTIW2NITDIQLYUFPIPA7KV4Z5TYVI5EECPAC
AYX33NBCPCBFWEZI5KZXHP3Y2Q62GYVT4WHYJUYRIPYV67KPSYZAC
X43ZIKR3WHHUHTIBN76H25FLACL7SMKXXHFX7GDD552UF3V2UDPAC
UI3IP45FD2XZ3HFSZSPH5HBD5DT6CHHUR77FTKIIN3M43OQ3Y6EQC
ATQO62TFDZ7J4RCOSB3K2QCCB5R6PNYQIIGNXTLZMEFG5UG5PUJQC
JKENJ2UGUCIHH27LSUZLVZIYOTUR3JDWUG453OFYTRL3V3IRQGTAC
36Z442IVPXHZ7D2QI26YLN3TDDEMDRQ2GKBYQAD6NUHQZVCCY4VAC
DUHVCYW52C5MIWBG3GBDFRALHZNHIMGZCMUCNUNY6SXDUZGEMJ6QC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
QF3HGULONECPRBR4K4IEA5TQQLCIPQWADAKXNSPFQFBPOEK5A4LQC
W5H5YI6SQD2OZYEX4E3RX7WKBHH4FKKJAD4TQVPQK64LGXZGOTJAC
function test_show_log_browser_side_splits_window_width()
-- initialize screen dimensions and indicate that it is maximized
App.screen.init{width=300, height=300}
Editor_state.right = App.screen.width - Margin_right
Editor_state.width = Editor_state.right-Editor_state.left
Text.redraw_all(Editor_state)
end
Editor_state.width = Editor_state.right-Editor_state.left
Text.redraw_all(Editor_state)
Log_browser_state.left = App.screen.width/2 + Margin_left
Log_browser_state.right = App.screen.width - Margin_right
if Settings == nil then Settings = {} end
if Settings.source == nil then Settings.source = {} end
Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()
File_navigation.cursors[Editor_state.filename] = {cursor1=Editor_state.cursor1, screen_top1=Editor_state.screen_top1}
-- Initialize window width/height and make window resizable.
--
-- I get tempted to have opinions about window dimensions here, but they're
-- non-portable:
-- - maximizing doesn't work on mobile and messes things up
-- - maximizing keeps the title bar on screen in Linux, but off screen on
-- Windows. And there's no way to get the height of the title bar.
-- It seems more robust to just follow LÖVE's default window size until
-- someone overrides it.
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
App.screen.flags.resizable = true
if os == 'Linux' then
-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.
App.screen.move(settings.x, settings.y-37, settings.displayindex)
else
App.screen.move(settings.x, settings.y, settings.displayindex)
end
function source.set_window_position_from_settings(settings)
local os = love.system.getOS()
-- set up desired window dimensions and make window resizable
_, _, App.screen.flags = App.screen.size()
App.screen.flags.resizable = true
App.screen.width, App.screen.height = settings.width, settings.height
App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
source.set_window_position_from_settings(settings)
Show_log_browser_side = settings.show_log_browser_side
local right = App.screen.width - Margin_right
if Show_log_browser_side then
right = App.screen.width/2 - Margin_right
end
Editor_state = edit.initialize_state(Margin_top, Margin_left, right, settings.font_height, math.floor(settings.font_height*1.3))
Editor_state.filename = settings.filename
if Settings == nil then Settings = {} end
Settings.x, Settings.y, Settings.displayindex = App.screen.position()
return {
-- Initialize window width/height and make window resizable.
--
-- I get tempted to have opinions about window dimensions here, but they're
-- non-portable:
-- - maximizing doesn't work on mobile and messes things up
-- - maximizing keeps the title bar on screen in Linux, but off screen on
-- Windows. And there's no way to get the height of the title bar.
-- It seems more robust to just follow LÖVE's default window size until
-- someone overrides it.
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
function run.set_window_position_from_settings(settings)
local os = love.system.getOS()
if os == 'Linux' then
-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.
App.screen.move(settings.x, settings.y-37, settings.displayindex)
else
App.screen.move(settings.x, settings.y, settings.displayindex)
end
end
function run.initialize_default_settings()
local font_height = 20
love.graphics.setFont(love.graphics.newFont(font_height))
run.set_window_position_from_settings(Settings)
Editor_state = edit.initialize_state(Margin_top, Margin_left, App.screen.width-Margin_right, Settings.font_height, math.floor(Settings.font_height*1.3))
Editor_state.filename = Settings.filename
Editor_state.screen_top1 = Settings.screen_top
Editor_state.cursor1 = Settings.cursor
end
-- set up desired window dimensions and make window resizable
_, _, App.screen.flags = App.screen.size()
App.screen.flags.resizable = true
-- determine default dimensions and flags
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
-- set up desired window dimensions
-- set up desired window dimensions and make window resizable
_, _, App.screen.flags = App.screen.size()
function set_window_position_from_settings(settings)
local os = love.system.getOS()
if os == 'Linux' then
-- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.
App.screen.move(settings.x, settings.y-37, settings.displayindex)
else
App.screen.move(settings.x, settings.y, settings.displayindex)
end
end
local os = love.system.getOS()
if os == 'Android' or os == 'iOS' then
-- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
-- no point second-guessing window dimensions on mobile
App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
return
end
-- maximize window
App.screen.resize(0, 0) -- maximize
-- Initialize window width/height and make window resizable.
--
-- I get tempted to have opinions about window dimensions here, but they're
-- non-portable:
-- - maximizing doesn't work on mobile and messes things up
-- - maximizing keeps the title bar on screen in Linux, but off screen on
-- Windows. And there's no way to get the height of the title bar.
-- It seems more robust to just follow LÖVE's default window size until
-- someone overrides it.