From 2ecbe8d83b95f14384d885ffd52e6c97fe0a7649 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sun, 22 Dec 2024 13:58:48 +0100 Subject: [PATCH] console.lua: inherit --osd-color in the cursor Following up 19537a4996, also respect the user-specified color in the cursor. But the cursor is drawn as a border, so we actually need to use --osd-color as the border color. --- player/lua/console.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/player/lua/console.lua b/player/lua/console.lua index 1d061333b9..e51f306d3e 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -561,11 +561,12 @@ local function update() -- of the drawing. So the cursor doesn't affect layout too much, make it as -- thin as possible and make it appear to be 1px wide by giving it 0.5px -- horizontal borders. + local color, alpha = mpv_color_to_ass(mp.get_property('osd-color')) local cheight = opts.font_size * 8 local cglyph = '{\\rDefault' .. (mp.get_property_native('focused') == false - and '\\alpha&HFF&' or '\\1a&H44&\\3a&H44&') .. - '\\1c&Heeeeee&\\3c&Heeeeee&' .. + and '\\alpha&HFF&' or '\\1a&H44&\\3a&H' .. alpha .. '&') .. + '\\1c&Heeeeee&\\3c&H' .. color .. '&' .. '\\xbord0.5\\ybord0\\xshad0\\yshad1\\p4\\pbo24}' .. 'm 0 0 l 1 0 l 1 ' .. cheight .. ' l 0 ' .. cheight .. '{\\p0}'