🧑‍💻 Improve TFT Color UI layout / theme (#26077)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Alexander Gavrilenko 2023-07-17 10:53:36 +03:00 committed by GitHub
parent 4d6e5c12b3
commit 244de2458a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
189 changed files with 23074 additions and 4425 deletions

View file

@ -110,14 +110,219 @@
#endif
#if HAS_GRAPHICAL_TFT
#define NOTOSANS 1
#define UNIFONT 2
#define HELVETICA 3
#include "../../../../Marlin/src/lcd/tft/fontdata/fontdata.h"
#define UI_INCL_(W, H) STRINGIFY_(../../../../Marlin/src/lcd/tft/ui_##W##x##H.h)
#define UI_INCL(W, H) UI_INCL_(W, H)
#include UI_INCL(TFT_WIDTH, TFT_HEIGHT)
#define Latin_Extended_A 1
#define Cyrillic 2
#define Greek 3
#define Katakana 4
#define Korean 5
#define Vietnamese 6
#define Simplified_Chinese 7
#define Traditional_Chinese 8
#if TFT_FONT == NOTOSANS
#define TFT_FONT_NOTOSANS
#if FONT_SIZE == 14
#define TFT_FONT_NOTOSANS_14
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_NOTOSANS_14_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_NOTOSANS_14_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_NOTOSANS_14_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_NOTOSANS_14_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_NOTOSANS_14_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_NOTOSANS_14_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_NOTOSANS_14_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_NOTOSANS_14_ZH_TW
#endif
#elif FONT_SIZE == 16
#define TFT_FONT_NOTOSANS_16
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_NOTOSANS_16_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_NOTOSANS_16_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_NOTOSANS_16_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_NOTOSANS_16_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_NOTOSANS_16_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_NOTOSANS_16_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_NOTOSANS_16_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_NOTOSANS_16_ZH_TW
#endif
#elif FONT_SIZE == 19
#define TFT_FONT_NOTOSANS_19
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_NOTOSANS_19_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_NOTOSANS_19_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_NOTOSANS_19_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_NOTOSANS_19_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_NOTOSANS_19_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_NOTOSANS_19_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_NOTOSANS_19_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_NOTOSANS_19_ZH_TW
#endif
#elif FONT_SIZE == 26
#define TFT_FONT_NOTOSANS_26
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_NOTOSANS_26_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_NOTOSANS_26_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_NOTOSANS_26_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_NOTOSANS_26_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_NOTOSANS_26_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_NOTOSANS_26_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_NOTOSANS_26_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_NOTOSANS_26_ZH_TW
#endif
#elif FONT_SIZE == 27
#define TFT_FONT_NOTOSANS_27
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_NOTOSANS_27_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_NOTOSANS_27_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_NOTOSANS_27_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_NOTOSANS_27_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_NOTOSANS_27_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_NOTOSANS_27_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_NOTOSANS_27_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_NOTOSANS_27_ZH_TW
#endif
#elif FONT_SIZE == 28
#define TFT_FONT_NOTOSANS_28
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_NOTOSANS_28_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_NOTOSANS_28_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_NOTOSANS_28_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_NOTOSANS_28_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_NOTOSANS_28_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_NOTOSANS_28_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_NOTOSANS_28_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_NOTOSANS_28_ZH_TW
#endif
#elif FONT_SIZE == 29
#define TFT_FONT_NOTOSANS_29
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_NOTOSANS_29_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_NOTOSANS_29_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_NOTOSANS_29_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_NOTOSANS_29_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_NOTOSANS_29_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_NOTOSANS_29_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_NOTOSANS_29_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_NOTOSANS_29_ZH_TW
#endif
#endif
#elif TFT_FONT == UNIFONT
#define TFT_FONT_UNIFONT
#if FONT_SIZE == 10
#define TFT_FONT_UNIFONT_10
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_UNIFONT_10_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_UNIFONT_10_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_UNIFONT_10_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_UNIFONT_10_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_UNIFONT_10_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_UNIFONT_10_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_UNIFONT_10_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_UNIFONT_10_ZH_TW
#endif
#elif FONT_SIZE == 20
#define TFT_FONT_UNIFONT_20
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_UNIFONT_20_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_UNIFONT_20_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_UNIFONT_20_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_UNIFONT_20_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_UNIFONT_20_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_UNIFONT_20_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_UNIFONT_20_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_UNIFONT_20_ZH_TW
#endif
#elif FONT_SIZE == 30
#define TFT_FONT_UNIFONT_30
#if FONT_EXTRA == Latin_Extended_A
#define TFT_FONT_UNIFONT_30_LATIN
#elif FONT_EXTRA == Cyrillic
#define TFT_FONT_UNIFONT_30_CYRIL
#elif FONT_EXTRA == Greek
#define TFT_FONT_UNIFONT_30_GREEK
#elif FONT_EXTRA == Katakana
#define TFT_FONT_UNIFONT_30_KATA
#elif FONT_EXTRA == Korean
#define TFT_FONT_UNIFONT_30_KO
#elif FONT_EXTRA == Vietnamese
#define TFT_FONT_UNIFONT_30_VI
#elif FONT_EXTRA == Simplified_Chinese
#define TFT_FONT_UNIFONT_30_ZH_CN
#elif FONT_EXTRA == Traditional_Chinese
#define TFT_FONT_UNIFONT_30_ZH_TW
#endif
#endif
#elif TFT_FONT == HELVETICA
#define TFT_FONT_HELVETICA
#if FONT_SIZE == 14
#define TFT_FONT_HELVETICA_14
#elif FONT_SIZE == 19
#define TFT_FONT_HELVETICA_19
#endif
#endif
#endif

View file

@ -94,7 +94,7 @@ if pioutil.is_pio_build():
val = None
if val:
opt = mat[1].upper()
blab("%s.custom_marlin.%s = '%s'" % ( env['PIOENV'], opt, val ))
blab("%s.custom_marlin.%s = '%s'" % ( env['PIOENV'], opt, val ), 2)
add_to_feat_cnf(opt, val)
def get_all_known_libs():
@ -202,14 +202,14 @@ if pioutil.is_pio_build():
relp = os.path.relpath(fullpath, marlinbasedir)
if srcfilepattern.match(relp):
if info:
blab("Added src file %s (%s)" % (relp, str(info)))
blab("Added src file %s (%s)" % (relp, str(info)), 3)
else:
blab("Added src file %s " % relp)
blab("Added src file %s " % relp, 3)
cur_srcs.add(relp)
# Special rule: If a direct folder is specified add all files within.
fullplain = os.path.join(marlinbasedir, plain)
if os.path.isdir(fullplain):
blab("Directory content addition for %s " % plain)
blab("Directory content addition for %s " % plain, 3)
gpattern = os.path.join(fullplain, "**")
for fname in glob.glob(gpattern, recursive=True):
addentry(fname, "dca")
@ -227,12 +227,12 @@ if pioutil.is_pio_build():
# Special rule: If a direct folder is specified then remove all files within.
def onremove(relp, info=None):
if info:
blab("Removed src file %s (%s)" % (relp, str(info)))
blab("Removed src file %s (%s)" % (relp, str(info)), 3)
else:
blab("Removed src file %s " % relp)
blab("Removed src file %s " % relp, 3)
fullplain = os.path.join(marlinbasedir, plain)
if os.path.isdir(fullplain):
blab("Directory content removal for %s " % plain)
blab("Directory content removal for %s " % plain, 2)
def filt(x):
common = os.path.commonpath([plain, x])
if not common == os.path.normpath(plain): return True
@ -248,10 +248,10 @@ if pioutil.is_pio_build():
cur_srcs = set(filter(filt, cur_srcs))
# Transform the resulting set into a string.
for x in cur_srcs:
if len(build_src_filter) > 0: build_src_filter += ' '
if build_src_filter != "": build_src_filter += ' '
build_src_filter += "+<" + x + ">"
#blab("Final build_src_filter: " + build_src_filter)
#blab("Final build_src_filter: " + build_src_filter, 3)
else:
build_src_filter = build_filters
@ -281,7 +281,7 @@ if pioutil.is_pio_build():
#
def MarlinHas(env, feature):
load_marlin_features()
r = re.compile('^' + feature + '$')
r = re.compile('^' + feature + '$', re.IGNORECASE)
found = list(filter(r.match, env['MARLIN_FEATURES']))
# Defines could still be 'false' or '0', so check
@ -294,7 +294,7 @@ if pioutil.is_pio_build():
elif val in env['MARLIN_FEATURES']:
some_on = env.MarlinHas(val)
#blab("%s is %s" % (feature, str(some_on)))
#blab("%s is %s" % (feature, str(some_on)), 2)
return some_on