Add server url button to main menu (#15536)

Co-authored-by: Zughy <63455151+Zughy@users.noreply.github.com>
This commit is contained in:
siliconsniffer 2024-12-20 15:04:26 +01:00 committed by GitHub
parent a6293b9861
commit 7bf0b1fc7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

@ -63,6 +63,7 @@ Zughy:
textures/base/pack/settings_btn.png
textures/base/pack/settings_info.png
textures/base/pack/settings_reset.png
textures/base/pack/server_url.png
textures/base/pack/server_view_clients.png
appgurueu:

@ -179,6 +179,13 @@ local function get_formspec(tabview, name, tabdata)
"server_view_clients.png") .. ";btn_view_clients;]"
end
if selected_server.url then
retval = retval .. "tooltip[btn_server_url;" .. fgettext("Open server website") .. "]"
retval = retval .. "style[btn_server_url;padding=6]"
retval = retval .. "image_button[" .. (can_view_clients_list and "4" or "4.5") .. ",1.3;0.5,0.5;" ..
core.formspec_escape(defaulttexturedir .. "server_url.png") .. ";btn_server_url;]"
end
if is_selected_fav() then
retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove favorite") .. "]"
retval = retval .. "style[btn_delete_favorite;padding=6]"
@ -367,6 +374,11 @@ local function main_button_handler(tabview, fields, name, tabdata)
return true
end
if fields.btn_server_url then
core.open_url_dialog(find_selected_server().url)
return true
end
if fields.btn_view_clients then
local dlg = create_clientslist_dialog(find_selected_server())
dlg:set_parent(tabview)

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B