From cb7d103ba8ac5ecfefb907ee71d13cd305bd1e07 Mon Sep 17 00:00:00 2001 From: zvecr Date: Wed, 11 May 2022 01:53:03 +0100 Subject: [PATCH] wider keys? --- lib/python/qmk/keyboard.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/python/qmk/keyboard.py b/lib/python/qmk/keyboard.py index e69f63aebe..9a3cd4e29f 100644 --- a/lib/python/qmk/keyboard.py +++ b/lib/python/qmk/keyboard.py @@ -4,6 +4,7 @@ from array import array from math import ceil from pathlib import Path import os +import shutil from glob import glob 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.makefile import parse_rules_mk_file +KEY_WIDTH = 4 if shutil.get_terminal_size().columns < 200 else 6 BOX_DRAWING_CHARACTERS = { "unicode": { "tl": "┌", @@ -205,9 +207,9 @@ def render_layouts(info_json, render_ascii): def render_key_rect(textpad, x, y, w, h, label, style): box_chars = BOX_DRAWING_CHARACTERS[style] - x = ceil(x * 4) + x = ceil(x * KEY_WIDTH) y = ceil(y * 3) - w = ceil(w * 4) + w = ceil(w * KEY_WIDTH) h = ceil(h * 3) 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): box_chars = BOX_DRAWING_CHARACTERS[style] - x = ceil(x * 4) + x = ceil(x * KEY_WIDTH) y = ceil(y * 3) - w = ceil(w * 4) + w = ceil(w * KEY_WIDTH) h = ceil(h * 3) 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): box_chars = BOX_DRAWING_CHARACTERS[style] - x = ceil(x * 4) + x = ceil(x * KEY_WIDTH) y = ceil(y * 3) - w = ceil(w * 4) + w = ceil(w * KEY_WIDTH) h = ceil(h * 3) label_len = w - 2