summaryrefslogtreecommitdiff
path: root/editor/editor_themes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_themes.cpp')
-rw-r--r--editor/editor_themes.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 28bc20a957..50e3408037 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -41,7 +41,7 @@
#include "modules/svg/image_loader_svg.h"
#endif
-static Ref<StyleBoxTexture> make_stylebox(Ref<Texture> p_texture, float p_left, float p_top, float p_right, float p_botton, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_botton = -1, bool p_draw_center = true) {
+static Ref<StyleBoxTexture> make_stylebox(Ref<Texture2D> p_texture, float p_left, float p_top, float p_right, float p_botton, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_botton = -1, bool p_draw_center = true) {
Ref<StyleBoxTexture> style(memnew(StyleBoxTexture));
style->set_texture(p_texture);
style->set_margin_size(MARGIN_LEFT, p_left * EDSCALE);
@@ -90,19 +90,13 @@ Ref<ImageTexture> editor_generate_icon(int p_index, bool p_convert_color, float
Ref<ImageTexture> icon = memnew(ImageTexture);
Ref<Image> img = memnew(Image);
- // dumb gizmo check
- bool is_gizmo = String(editor_icons_names[p_index]).begins_with("Gizmo");
-
// Upsample icon generation only if the editor scale isn't an integer multiplier.
// Generating upsampled icons is slower, and the benefit is hardly visible
// with integer editor scales.
const bool upsample = !Math::is_equal_approx(Math::round(p_scale), p_scale);
ImageLoaderSVG::create_image_from_string(img, editor_icons_sources[p_index], p_scale, upsample, p_convert_color);
- if ((p_scale - (float)((int)p_scale)) > 0.0 || is_gizmo || p_force_filter)
- icon->create_from_image(img); // in this case filter really helps
- else
- icon->create_from_image(img, 0);
+ icon->create_from_image(img); // in this case filter really helps
return icon;
}
@@ -412,6 +406,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("error_color", "Editor", error_color);
theme->set_color("property_color", "Editor", property_color);
+ if (!dark_theme) {
+ theme->set_color("vulkan_color", "Editor", Color::hex(0xad1128ff));
+ } else {
+ theme->set_color("vulkan_color", "Editor", Color(1.0, 0.0, 0.0));
+ }
const int thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size");
theme->set_constant("scale", "Editor", EDSCALE);
theme->set_constant("thumb_size", "Editor", thumb_size);
@@ -931,7 +930,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("panel", "EditorAbout", style_complex_window);
// HScrollBar
- Ref<Texture> empty_icon = memnew(ImageTexture);
+ Ref<Texture2D> empty_icon = memnew(ImageTexture);
theme->set_stylebox("scroll", "HScrollBar", make_stylebox(theme->get_icon("GuiScrollBg", "EditorIcons"), 5, 5, 5, 5, 0, 0, 0, 0));
theme->set_stylebox("scroll_focus", "HScrollBar", make_stylebox(theme->get_icon("GuiScrollBg", "EditorIcons"), 5, 5, 5, 5, 0, 0, 0, 0));