Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix unchecked checkbox visibility in 3d editor viewport

Benjamin Saez54db9cd44056
diff --git a/editor/scene/3d/node_3d_editor_viewport.cpp b/editor/scene/3d/node_3d_editor_viewport.cpp
index b8250e3ae6e..166352e2064 100644
--- a/editor/scene/3d/node_3d_editor_viewport.cpp
+++ b/editor/scene/3d/node_3d_editor_viewport.cpp
@@ -7135,7 +7135,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
preview_camera->set_shortcut(ED_SHORTCUT("spatial_editor/toggle_camera_preview", TTRC("Toggle Camera Preview"), KeyModifierMask::CTRL | Key::P));
vbox->add_child(preview_camera);
preview_camera->set_h_size_flags(SIZE_SHRINK_BEGIN);
- preview_camera->set_theme_type_variation("CheckBoxNoIconTint");
+ preview_camera->set_theme_type_variation("CheckBoxNoIconTintNoDim");
preview_camera->hide();
preview_camera->connect(SceneStringName(toggled), callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview));
@@ -7145,7 +7145,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
pilot_camera->set_shortcut(ED_SHORTCUT("spatial_editor/toggle_pilot_preview", TTRC("Toggle Pilot Mode in Preview")));
vbox->add_child(pilot_camera);
pilot_camera->set_h_size_flags(SIZE_SHRINK_BEGIN);
- pilot_camera->set_theme_type_variation("CheckBoxNoIconTint");
+ pilot_camera->set_theme_type_variation("CheckBoxNoIconTintNoDim");
pilot_camera->hide();
pilot_camera->connect(SceneStringName(toggled), callable_mp(this, &Node3DEditorViewport::_toggle_pilot_preview));
previewing = nullptr;
diff --git a/editor/themes/theme_classic.cpp b/editor/themes/theme_classic.cpp
index 068cdddf735..5f67648c89e 100644
--- a/editor/themes/theme_classic.cpp
+++ b/editor/themes/theme_classic.cpp
@@ -1955,6 +1955,12 @@ void ThemeClassic::populate_editor_styles(const Ref<EditorTheme> &p_theme, Edito
p_theme->set_color("icon_pressed_color", "CheckBoxNoIconTint", p_config.icon_normal_color);
p_theme->set_color("icon_hover_color", "CheckBoxNoIconTint", p_config.dark_icon_and_font ? p_config.mono_color : p_config.mono_color.inverted());
p_theme->set_color("icon_hover_pressed_color", "CheckBoxNoIconTint", p_config.dark_icon_and_font ? p_config.mono_color : p_config.mono_color.inverted());
+
+ p_theme->set_type_variation("CheckBoxNoIconTintNoDim", "CheckBoxNoIconTint");
+ if (!p_config.dark_icon_and_font) {
+ // Overblown white to offset icon dimming.
+ p_theme->set_color("checkbox_unchecked_color", "CheckBoxNoIconTintNoDim", Color(3, 3, 3));
+ }
}
// Buttons styles that stand out against the panel background (e.g. AssetLib).
diff --git a/editor/themes/theme_modern.cpp b/editor/themes/theme_modern.cpp
index a8c07ea8c52..b5c6bd157a3 100644
--- a/editor/themes/theme_modern.cpp
+++ b/editor/themes/theme_modern.cpp
@@ -2022,6 +2022,12 @@ void ThemeModern::populate_editor_styles(const Ref<EditorTheme> &p_theme, Editor
p_theme->set_color("icon_pressed_color", "CheckBoxNoIconTint", p_config.icon_normal_color);
p_theme->set_color("icon_hover_color", "CheckBoxNoIconTint", p_config.dark_icon_and_font ? p_config.mono_color : p_config.mono_color_inv);
p_theme->set_color("icon_hover_pressed_color", "CheckBoxNoIconTint", p_config.dark_icon_and_font ? p_config.mono_color : p_config.mono_color_inv);
+
+ p_theme->set_type_variation("CheckBoxNoIconTintNoDim", "CheckBoxNoIconTint");
+ if (!p_config.dark_icon_and_font) {
+ // Overblown white to offset icon dimming.
+ p_theme->set_color("checkbox_unchecked_color", "CheckBoxNoIconTintNoDim", Color(3, 3, 3));
+ }
}
// Buttons styles that stand out against the panel background (e.g. AssetLib).