wider keys?

This commit is contained in:
zvecr 2022-05-11 01:53:03 +01:00
parent 68208278e0
commit cb7d103ba8

View file

@ -4,6 +4,7 @@ from array import array
from math import ceil from math import ceil
from pathlib import Path from pathlib import Path
import os import os
import shutil
from glob import glob from glob import glob
import qmk.path import qmk.path
@ -11,6 +12,7 @@ from qmk.c_parse import parse_config_h_file
from qmk.json_schema import json_load from qmk.json_schema import json_load
from qmk.makefile import parse_rules_mk_file from qmk.makefile import parse_rules_mk_file
KEY_WIDTH = 4 if shutil.get_terminal_size().columns < 200 else 6
BOX_DRAWING_CHARACTERS = { BOX_DRAWING_CHARACTERS = {
"unicode": { "unicode": {
"tl": "", "tl": "",
@ -205,9 +207,9 @@ def render_layouts(info_json, render_ascii):
def render_key_rect(textpad, x, y, w, h, label, style): def render_key_rect(textpad, x, y, w, h, label, style):
box_chars = BOX_DRAWING_CHARACTERS[style] box_chars = BOX_DRAWING_CHARACTERS[style]
x = ceil(x * 4) x = ceil(x * KEY_WIDTH)
y = ceil(y * 3) y = ceil(y * 3)
w = ceil(w * 4) w = ceil(w * KEY_WIDTH)
h = ceil(h * 3) h = ceil(h * 3)
label_len = w - 2 label_len = w - 2
@ -234,9 +236,9 @@ def render_key_rect(textpad, x, y, w, h, label, style):
def render_key_isoenter(textpad, x, y, w, h, label, style): def render_key_isoenter(textpad, x, y, w, h, label, style):
box_chars = BOX_DRAWING_CHARACTERS[style] box_chars = BOX_DRAWING_CHARACTERS[style]
x = ceil(x * 4) x = ceil(x * KEY_WIDTH)
y = ceil(y * 3) y = ceil(y * 3)
w = ceil(w * 4) w = ceil(w * KEY_WIDTH)
h = ceil(h * 3) h = ceil(h * 3)
label_len = w - 1 label_len = w - 1
@ -266,9 +268,9 @@ def render_key_isoenter(textpad, x, y, w, h, label, style):
def render_key_baenter(textpad, x, y, w, h, label, style): def render_key_baenter(textpad, x, y, w, h, label, style):
box_chars = BOX_DRAWING_CHARACTERS[style] box_chars = BOX_DRAWING_CHARACTERS[style]
x = ceil(x * 4) x = ceil(x * KEY_WIDTH)
y = ceil(y * 3) y = ceil(y * 3)
w = ceil(w * 4) w = ceil(w * KEY_WIDTH)
h = ceil(h * 3) h = ceil(h * 3)
label_len = w - 2 label_len = w - 2