mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-13 14:21:11 +01:00
Fix code folding icon color not matching defined color
Cherrypick of #58457 in master Caused by reusing icons from the main editor in the code editor. These icons were converted based on the main editor theme and not the code editor theme. - Create new icons for use specifically in the code editor - Add these icons to the exceptions when converting dark theme icons to light theme automatically - Change the default value of the code folding color to match previous color - Code folding icon is now pure white by default to correctly match the color defined in settings
This commit is contained in:
parent
2b70218bd1
commit
cbdc659738
@ -250,6 +250,14 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme =
|
||||
exceptions.insert("StatusSuccess");
|
||||
exceptions.insert("StatusWarning");
|
||||
exceptions.insert("OverbrightIndicator");
|
||||
|
||||
// Prevents Code Editor icons from changing
|
||||
exceptions.insert("GuiTab");
|
||||
exceptions.insert("GuiSpace");
|
||||
exceptions.insert("GuiEllipsis");
|
||||
exceptions.insert("TextEditFold");
|
||||
exceptions.insert("TextEditFolded");
|
||||
exceptions.insert("TextEditorPlay");
|
||||
}
|
||||
|
||||
// These ones should be converted even if we are using a dark theme.
|
||||
@ -1007,8 +1015,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_constant("side_margin", "TabContainer", 0);
|
||||
theme->set_icon("tab", "TextEdit", theme->get_icon("GuiTab", "EditorIcons"));
|
||||
theme->set_icon("space", "TextEdit", theme->get_icon("GuiSpace", "EditorIcons"));
|
||||
theme->set_icon("folded", "TextEdit", theme->get_icon("GuiTreeArrowRight", "EditorIcons"));
|
||||
theme->set_icon("fold", "TextEdit", theme->get_icon("GuiTreeArrowDown", "EditorIcons"));
|
||||
theme->set_icon("folded", "TextEdit", theme->get_icon("TextEditFolded", "EditorIcons"));
|
||||
theme->set_icon("fold", "TextEdit", theme->get_icon("TextEditFold", "EditorIcons"));
|
||||
theme->set_color("font_color", "TextEdit", font_color);
|
||||
theme->set_color("font_color_readonly", "TextEdit", font_color_readonly);
|
||||
theme->set_color("caret_color", "TextEdit", font_color);
|
||||
@ -1343,7 +1351,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
const float mono_value = mono_color.r;
|
||||
const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.07);
|
||||
const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.14);
|
||||
const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.7);
|
||||
const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.27);
|
||||
|
||||
// editor main color
|
||||
const Color main_color = dark_theme ? Color(0.34, 0.7, 1.0) : Color(0.02, 0.5, 1.0);
|
||||
|
1
editor/icons/icon_text_edit_fold.svg
Normal file
1
editor/icons/icon_text_edit_fold.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="m3 5 3 3 3-3" fill="none" stroke="#fff" stroke-width="2"/></svg>
|
After Width: | Height: | Size: 221 B |
1
editor/icons/icon_text_edit_folded.svg
Normal file
1
editor/icons/icon_text_edit_folded.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><path d="m4 9 3-3-3-3" fill="none" stroke="#fff" stroke-width="2"/></svg>
|
After Width: | Height: | Size: 221 B |
1
editor/icons/icon_text_editor_play.svg
Normal file
1
editor/icons/icon_text_editor_play.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m4 1048.4v-8l7 4z" fill="#e0e0e0" fill-rule="evenodd" stroke="#e0e0e0" stroke-linejoin="round" stroke-width="2" transform="translate(0 -1036.4)"/></svg>
|
After Width: | Height: | Size: 245 B |
@ -5425,7 +5425,7 @@ void TextEdit::_update_caches() {
|
||||
cache.folded_icon = get_theme_icon("folded");
|
||||
cache.can_fold_icon = get_theme_icon("fold");
|
||||
cache.folded_eol_icon = get_theme_icon("GuiEllipsis", "EditorIcons");
|
||||
cache.executing_icon = get_theme_icon("MainPlay", "EditorIcons");
|
||||
cache.executing_icon = get_theme_icon("TextEditorPlay", "EditorIcons");
|
||||
text.set_font(cache.font);
|
||||
|
||||
if (syntax_highlighter) {
|
||||
|
Loading…
Reference in New Issue
Block a user