jfkeys: parameterize width to better fit on fx-CP display

This commit is contained in:
Lephenixnoir 2024-09-04 08:56:04 +02:00
parent 7f2131d6a0
commit e12a58c1f0
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

View file

@ -117,8 +117,11 @@ static void jfkeys_poly_render(void *f0, int base_x, int y)
if(!text || (*text != '.' && *text != '/' && *text != '@'
&& *text != '#')) continue;
int x = base_x + 4 + 65 * position;
int w = 63;
int fw = jwidget_full_width(f);
int margin = (fw >= 250 ? 4 : 2);
int spacing = 2;
int w = (fw - 2 * margin - 5 * spacing) / 6;
int x = base_x + margin + (w + spacing) * position;
int color = (text[0] == '#') ? f->text_special_color : f->text_color;
if(text[0] == '.') {