Minor tweak

This commit is contained in:
Jean-Patrick Guerrero 2022-08-01 04:10:16 +02:00
parent a3fea93a09
commit 20b8110375
3 changed files with 4 additions and 3 deletions

View File

@ -80,7 +80,7 @@ end
local function utf8_len(str)
local c = 0
for _ in str:gmatch"([%z\1-\127\194-\244][\128-\191]*)" do -- Arguably working duct-tape code
for _ in str:gmatch"[%z\1-\127\194-\244][\128-\191]*" do -- Arguably working duct-tape code
c++
end

View File

@ -1334,7 +1334,6 @@ local function get_items_fs(fs, data, player, full_height)
else
fs"style_type[label;font=italic;font_size=18]"
label(data.inv_width + 0.9, 0.49, clr("#aaa", ES"Search..."))
fs(fmt("style[enable_search:hovered;bgimg=%s]", PNG.search_outline))
button(data.inv_width + 0.8, 0.12, 4, 0.8, "enable_search", "")
end
@ -1347,7 +1346,7 @@ local function get_items_fs(fs, data, player, full_height)
if true_str(data.filter) then
image_button(data.inv_width + 4.3, 0.4, 0.2, 0.2, "", "cancel", "")
fs(fmt("tooltip[cancel;%s]", ES"Clear"))
image(data.inv_width + 0.8, 0.14, 4, 0.8, PNG.search_outline)
image(data.inv_width + 0.8, 0.13, 4, 0.8, PNG.search_outline)
end
data.pagemax = max(1, ceil(#items / ipp))

View File

@ -83,6 +83,7 @@ local styles = string.format([[
style[nofav;sound=i3_cannot]
style[pagenum,no_item,no_rcp;font=bold;font_size=18]
style[search;fgimg=%s;content_offset=0]
style[enable_search:hovered;bgimg=%s]
style[exit;fgimg=%s;fgimg_hovered=%s;content_offset=0]
style[cancel;fgimg=%s;fgimg_hovered=%s;content_offset=0]
style[prev_page,prev_recipe,prev_usage,prev_sort,prev_skin;fgimg=%s;fgimg_hovered=%s]
@ -100,6 +101,7 @@ local styles = string.format([[
]],
PNG.slot,
PNG.search_hover,
PNG.search_outline,
PNG.exit, PNG.exit_hover,
PNG.cancel, PNG.cancel_hover,
PNG.prev, PNG.prev_hover,