From 1d2023325da1906039afd52db6cb394df4cb4fbc Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 15 Nov 2020 03:26:17 +0100 Subject: [PATCH] Replace hypertext by buttons --- init.lua | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index 207bbba..b9780c4 100644 --- a/init.lua +++ b/init.lua @@ -116,7 +116,7 @@ local styles = fmt([[ style[filter;border=false] style_type[label,field;font_size=+0] style_type[image_button;border=false] - style_type[button;border=false;font=bold;font_size=+2] + style_type[button;border=false;font=bold;font_size=+2;content_offset=0] style_type[item_image_button;border=false;bgimg_hovered=%s;bgimg_pressed=%s] style[search;fgimg=%s;fgimg_hovered=%s] style[clear;fgimg=%s;fgimg_hovered=%s] @@ -1179,7 +1179,7 @@ local function get_title_fs(query_item, favs, fs, spacing) fs[#fs + 1] = fmt(FMT.label, 8.75, spacing - 0.1, nice_strip(ESC(get_desc(query_item)), 45)) fs[#fs + 1] = "style_type[label;font=mono;font_size=+0]" fs[#fs + 1] = fmt(FMT.label, 8.75, spacing + 0.3, clr("#7bf", nice_strip(query_item, 35))) - fs[#fs + 1] = "style_type[label;font=normal;font_size=]" + fs[#fs + 1] = "style_type[label;font=normal]" fs[#fs + 1] = fmt(FMT.hypertext, 13.8, spacing - 0.15, 1.1, 1.3, @@ -1247,10 +1247,7 @@ local function get_panels(data, fs) if recipe_or_usage and not rn then local lbl = is_recipe and ES"No recipes" or ES"No usages" - - fs[#fs + 1] = fmt(FMT.hypertext, - 8.29, YOFFSET + spacing + 0.3, 6.8, 1, - fmt("
", lbl)) + fs[#fs + 1] = fmt(FMT.button, 8, YOFFSET + spacing + 0.1, 6.8, 1, "", lbl) elseif panel.name == "title" then get_title_fs(data.query_item, data.favs, fs, spacing) @@ -1313,8 +1310,6 @@ local function make_fs(data) data.pagemax = max(1, ceil(#data.items / IPP)) - fs[#fs + 1] = "style[pagenum;content_offset=0]" - fs[#fs + 1] = fmt(FMT.button, 5.97, -0.06, 1.36, 0.85, "pagenum", fmt("%s / %u", clr("#ff0", data.pagenum), data.pagemax)) @@ -1330,9 +1325,7 @@ local function make_fs(data) lbl = ES"Collect items to reveal more recipes" end - fs[#fs + 1] = fmt(FMT.hypertext, - 0.05, 3, 8.29, 1, - fmt("
", lbl)) + fs[#fs + 1] = fmt(FMT.button, -0.25, 3, 8.3, 1, "", lbl) end local first_item = (data.pagenum - 1) * IPP