Numerous tweaks to layouts to make them format nicer for a resizable window

This commit is contained in:
2022-04-04 09:55:06 -05:00
parent d057dc96ec
commit 095edbbe36
7 changed files with 142 additions and 97 deletions

View File

@@ -27,78 +27,87 @@ class W3DHub
theme(W3DHub::THEME)
stack(width: 1.0, height: 1.0, border_thickness: 1, border_color: 0xff_aaaaaa) do
background 0xff_252525
@interface_container = flow(width: 1.0, height: 1.0) do
# TODO: Override this background color to be a darkened version of the selected games
# or a default color
background 0xff_212121..0xff_111111
@header_container = flow(width: 1.0, height: 100, padding: 4) do
image "#{GAME_ROOT_PATH}/media/icons/app.png", width: 108
flow(fill: true, height: 1.0)
stack(fill: true, height: 1.0) do
# background 0xff_885500
stack(width: 1.0, max_width: MAX_PAGE_WIDTH, height: 1.0, border_thickness: 1, border_color: 0xff_aaaaaa) do
background 0xff_252525
@app_info_container = flow(width: 1.0, height: 0.65) do
# background 0xff_8855ff
@header_container = flow(width: 1.0, height: 100, padding: 4) do
image "#{GAME_ROOT_PATH}/media/icons/app.png", width: 108
stack(fill: true, height: 1.0) do
title "<b>#{I18n.t(:"app_name")}</b>", height: 0.5
flow(width: 1.0, height: 0.5) do
@application_taskbar_container = stack(width: 1.0, height: 1.0, margin_left: 16, margin_right: 16) do
flow(width: 1.0, height: 0.65) do
@application_taskbar_label = inscription "", width: 0.60, text_wrap: :none
@application_taskbar_status_label = inscription "", width: 0.40, text_align: :right, text_wrap: :none
stack(fill: true, height: 1.0) do
# background 0xff_885500
@app_info_container = flow(width: 1.0, height: 0.65) do
# background 0xff_8855ff
stack(fill: true, height: 1.0) do
title "<b>#{I18n.t(:"app_name")}</b>", height: 0.5
flow(width: 1.0, height: 0.5) do
@application_taskbar_container = stack(width: 1.0, height: 1.0, margin_left: 16, margin_right: 16) do
flow(width: 1.0, height: 0.65) do
@application_taskbar_label = inscription "", width: 0.60, text_wrap: :none
@application_taskbar_status_label = inscription "", width: 0.40, text_align: :right, text_wrap: :none
end
@application_taskbar_progressbar = progress fraction: 0.0, height: 2, width: 1.0
end
@application_taskbar_progressbar = progress fraction: 0.0, height: 2, width: 1.0
end
end
end
@account_container = flow(width: 256, height: 1.0) do
stack(width: 0.7, height: 1.0) do
background 0xff_222222
tagline "<b>#{I18n.t(:"interface.not_logged_in")}</b>", text_wrap: :none
@account_container = flow(width: 256, height: 1.0) do
stack(width: 1.0, height: 1.0) do
tagline "<b>#{I18n.t(:"interface.not_logged_in")}</b>", text_wrap: :none
flow(width: 1.0) do
link(I18n.t(:"interface.log_in"), text_size: 16, width: 0.5) { page(W3DHub::Pages::Login) }
link I18n.t(:"interface.register"), text_size: 16, width: 0.49 do
Launchy.open("https://secure.w3dhub.com/forum/index.php?app=core&module=global&section=register")
flow(width: 1.0) do
link(I18n.t(:"interface.log_in"), text_size: 16, width: 0.5) { page(W3DHub::Pages::Login) }
link I18n.t(:"interface.register"), text_size: 16, width: 0.49 do
Launchy.open("https://secure.w3dhub.com/forum/index.php?app=core&module=global&section=register")
end
end
end
end
end
end
@navigation_container = flow(width: 1.0, height: 0.35) do
# background 0xff_666666
flow(width: 1.0, height: 1.0) do
flow(fill: true, height: 1.0) # Hacky centering
link I18n.t(:"interface.games") do
page(W3DHub::Pages::Games)
end
@navigation_container = flow(width: 1.0, height: 0.35) do
# background 0xff_666666
flow(width: 1.0, height: 1.0) do
flow(fill: true, height: 1.0) # Hacky centering
link I18n.t(:"interface.games") do
page(W3DHub::Pages::Games)
end
link I18n.t(:"interface.server_browser"), margin_left: 18 do
page(W3DHub::Pages::ServerBrowser)
end
link I18n.t(:"interface.server_browser"), margin_left: 18 do
page(W3DHub::Pages::ServerBrowser)
end
link I18n.t(:"interface.community"), margin_left: 18 do
page(W3DHub::Pages::Community)
end
link I18n.t(:"interface.community"), margin_left: 18 do
page(W3DHub::Pages::Community)
end
link I18n.t(:"interface.downloads"), margin_left: 18 do
page(W3DHub::Pages::DownloadManager)
end
link I18n.t(:"interface.downloads"), margin_left: 18 do
page(W3DHub::Pages::DownloadManager)
end
link I18n.t(:"interface.settings"), margin_left: 18 do
page(W3DHub::Pages::Settings)
link I18n.t(:"interface.settings"), margin_left: 18 do
page(W3DHub::Pages::Settings)
end
flow(fill: true, height: 1.0) # Hacky centering
end
flow(fill: true, height: 1.0) # Hacky centering
end
end
end
@content_container = flow(width: 1.0, fill: true) do
end
end
@content_container = flow(width: 1.0, fill: true) do
end
flow(fill: true, height: 1.0)
end
if Store.account