Skip to content

Commit

Permalink
ContentDB redesign: Redesign package list dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Oct 5, 2024
1 parent 78aab8c commit 1037ee2
Show file tree
Hide file tree
Showing 9 changed files with 236 additions and 111 deletions.
3 changes: 0 additions & 3 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,10 @@ srifqi:
textures/base/pack/minimap_btn.png

Zughy:
textures/base/pack/cdb_add.png
textures/base/pack/cdb_downloading.png
textures/base/pack/cdb_queued.png
textures/base/pack/cdb_update.png
textures/base/pack/cdb_update_cropped.png
textures/base/pack/cdb_viewonline.png
textures/base/pack/settings_btn.png
textures/base/pack/settings_info.png
textures/base/pack/settings_reset.png
Expand All @@ -79,7 +77,6 @@ kilbith:
textures/base/pack/progress_bar_bg.png

SmallJoker:
textures/base/pack/cdb_clear.png
textures/base/pack/server_favorite_delete.png (based on server_favorite.png)

DS:
Expand Down
24 changes: 24 additions & 0 deletions builtin/mainmenu/content/contentdb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -641,3 +641,27 @@ function contentdb.get_full_package_info(package, callback)
callback(nil)
end
end


function contentdb.get_formspec_padding()
-- Padding is increased on Android to account for notches
-- TODO: use Android API to determine size of cut outs
return { x = PLATFORM == "Android" and 1 or 0.5, y = PLATFORM == "Android" and 0.25 or 0.5 }
end


function contentdb.get_formspec_size()
local window = core.get_window_info()
local size = { x = window.max_formspec_size.x, y = window.max_formspec_size.y }

-- Minimum formspec size
local min_x = 15.5
local min_y = 10
if size.x < min_x or size.y < min_y then
local scale = math.max(min_x / size.x, min_y / size.y)
size.x = size.x * scale
size.y = size.y * scale
end

return size
end
Loading

0 comments on commit 1037ee2

Please sign in to comment.