18:17:14 +Mai | ed: volume bar is bad design

18:17:26  &ed | what's wrong with it
18:17:38 +Mai | that you don't know it's the volume bar before you try it
18:17:46  &ed | oh
18:17:48  &ed | yeah i guess
18:17:54 +Mai | especially when it's at 100
18:18:00  &ed | how do i fix it tho
18:19:50 +Mai | you could add an icon that's also a mute button (to not make it a useless icon)
18:22:38  &ed | i'll make the volume text always visible and include a speaker icon before it
18:23:53 +Mai | that is better at least
This commit is contained in:
ed 2024-12-19 18:49:51 +00:00
parent 552897abbc
commit 7f044372fa

View file

@ -3064,6 +3064,7 @@ var vbar = (function () {
can = r.can.can;
ctx = r.can.ctx;
ctx.font = '.7em sans-serif';
ctx.fontVariantCaps = 'small-caps';
w = r.can.w;
h = r.can.h;
r.draw();
@ -3089,18 +3090,18 @@ var vbar = (function () {
ctx.fillStyle = grad2; ctx.fillRect(0, 0, w, h);
ctx.fillStyle = grad1; ctx.fillRect(0, 0, w * mp.vol, h);
if (Date.now() - lastv > 1000)
return;
var vt = 'volume ' + Math.floor(mp.vol * 100),
tw = ctx.measureText(vt).width,
x = w * mp.vol - tw - 8,
li = dy;
var vt = Math.floor(mp.vol * 100),
tw = ctx.measureText(vt).width;
var li = dy;
if (mp.vol < 0.05)
if (mp.vol < 0.5) {
x += tw + 16;
li = !li;
}
ctx.fillStyle = li ? '#fff' : '#210';
ctx.fillText(vt, Math.max(4, w * mp.vol - tw - 8), h / 3 * 2);
ctx.fillText(vt, x, h / 3 * 2);
clearTimeout(untext);
untext = setTimeout(r.draw, 1000);