mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-04 20:24:23 +02:00
Update/deprecate theme item names
Updates theme names to be compatible with Godot 3.5 (no spaces), consistent with other Godot theme item names (snake_case), and match the color names listed on the [ANSI escape code wikipedia page](https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit). Deprecates the old names and warns users to change them.
This commit is contained in:
parent
aee3efd8de
commit
95b66115c4
15 changed files with 349 additions and 260 deletions
|
@ -175,22 +175,50 @@ func _update_theme():
|
|||
# inheritance to work we can pass through the theme variables manually.
|
||||
for color in _default_theme.get_color_list("Terminal"):
|
||||
var c: Color
|
||||
|
||||
var deprecated_color: String = color.replace("bright", "light").replace("_", " ").capitalize()
|
||||
match deprecated_color:
|
||||
"White":
|
||||
deprecated_color = "Light Grey"
|
||||
"Light Black":
|
||||
deprecated_color = "Dark Grey"
|
||||
"Light White":
|
||||
deprecated_color = "Wahite"
|
||||
|
||||
if has_color(color, "Terminal"):
|
||||
c = get_color(color, "Terminal")
|
||||
elif has_color(deprecated_color, "Terminal"):
|
||||
push_warning(
|
||||
(
|
||||
"Color name '%s' is deprecated and will be removed it a future version. Use the name '%s' instead."
|
||||
% [deprecated_color, color]
|
||||
)
|
||||
)
|
||||
c = get_color(deprecated_color, "Terminal")
|
||||
else:
|
||||
c = _default_theme.get_color(color, "Terminal")
|
||||
_native_terminal.add_color_override(color, c)
|
||||
for font in _default_theme.get_font_list("Terminal"):
|
||||
var f: Font
|
||||
var deprecated_font: String = font.replace("_", " ").capitalize()
|
||||
|
||||
if has_font(font, "Terminal"):
|
||||
f = get_font(font, "Terminal")
|
||||
elif has_font("Regular", "Terminal"):
|
||||
f = get_font("Regular", "Terminal")
|
||||
elif has_font(deprecated_font, "Terminal"):
|
||||
push_warning(
|
||||
(
|
||||
"Font name '%s' is deprecated and will be removed in a future version. Use the name '%s' instead."
|
||||
% [deprecated_font, font]
|
||||
)
|
||||
)
|
||||
f = get_font(deprecated_font, "Terminal")
|
||||
elif has_font("regular", "Terminal"):
|
||||
f = get_font("regular", "Terminal")
|
||||
else:
|
||||
if _default_theme.has_font(font, "Terminal"):
|
||||
f = _default_theme.get_font(font, "Terminal")
|
||||
else:
|
||||
f = _default_theme.get_font(font, "Regular")
|
||||
f = _default_theme.get_font(font, "regular")
|
||||
_native_terminal.add_font_override(font, f)
|
||||
_native_terminal._update_theme()
|
||||
_native_terminal._update_size()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue