mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
ui improvements to games list icons and login page
This commit is contained in:
@@ -29,8 +29,11 @@ class W3DHub
|
|||||||
game_button = stack(width: 1.0, border_thickness_left: 4, border_color_left: selected ? 0xff_00acff : 0x00_000000, hover: { background: 0xff_444444 }) do
|
game_button = stack(width: 1.0, border_thickness_left: 4, border_color_left: selected ? 0xff_00acff : 0x00_000000, hover: { background: 0xff_444444 }) do
|
||||||
background game.background_color if selected
|
background game.background_color if selected
|
||||||
|
|
||||||
|
flow(width: 1.0, height: 48) do
|
||||||
|
stack(width: 0.3)
|
||||||
image game.icon, height: 48
|
image game.icon, height: 48
|
||||||
inscription game.name
|
end
|
||||||
|
inscription game.name, width: 1.0, text_align: :center
|
||||||
end
|
end
|
||||||
|
|
||||||
def game_button.hit_element?(x, y)
|
def game_button.hit_element?(x, y)
|
||||||
@@ -106,7 +109,6 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# FIXME: Do actual gui update on main thread
|
|
||||||
def fetch_game_news(game)
|
def fetch_game_news(game)
|
||||||
feed_uri = Excon.get(
|
feed_uri = Excon.get(
|
||||||
game.news_feed,
|
game.news_feed,
|
||||||
|
|||||||
@@ -3,24 +3,40 @@ class W3DHub
|
|||||||
class Login < Page
|
class Login < Page
|
||||||
def setup
|
def setup
|
||||||
body.clear do
|
body.clear do
|
||||||
stack(width: 1.0, height: 1.0, padding: 32) do
|
flow(width: 1.0, height: 1.0, padding: 32) do
|
||||||
background 0xff_252535
|
background 0xff_252535
|
||||||
|
|
||||||
para "Login using your W3D Hub forum account"
|
stack(width: 0.28)
|
||||||
|
|
||||||
|
stack(width: 0.48) do
|
||||||
|
flow(width: 1.0) do
|
||||||
|
stack(width: 0.4)
|
||||||
|
image "#{GAME_ROOT_PATH}/media/icons/w3dhub.png", width: 0.20
|
||||||
|
end
|
||||||
|
para "Login using your W3D Hub forum account", width: 1.0, text_align: :center
|
||||||
|
|
||||||
flow(width: 1.0) do
|
flow(width: 1.0) do
|
||||||
tagline "Username", width: 0.25, text_align: :right, focus: true
|
tagline "Username", width: 0.25, text_align: :right
|
||||||
edit_line ""
|
@username = edit_line "", width: 0.75, focus: true
|
||||||
end
|
end
|
||||||
|
|
||||||
flow(width: 1.0) do
|
flow(width: 1.0) do
|
||||||
tagline "Password", width: 0.25, text_align: :right
|
tagline "Password", width: 0.25, text_align: :right
|
||||||
edit_line "", type: :password
|
@password = edit_line "", width: 0.75, type: :password
|
||||||
end
|
end
|
||||||
|
|
||||||
flow(width: 1.0) do
|
flow(width: 1.0) do
|
||||||
tagline "", width: 0.25
|
tagline "", width: 0.25
|
||||||
button "Log In"
|
button "Log In" do |btn|
|
||||||
|
@username.enabled = false
|
||||||
|
@password.enabled = false
|
||||||
|
btn.enabled = false
|
||||||
|
|
||||||
|
# Todo lock whole UI until response or timeout
|
||||||
|
|
||||||
|
# Do network stuff
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user