You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Fix minimap capturing events and improve its theme
Add an editor setting for minimap opacity in visual editors
This commit is contained in:
@@ -91,6 +91,7 @@ static Ref<Texture> flip_icon(Ref<Texture> p_texture, bool p_flip_y = false, boo
|
||||
|
||||
Ref<ImageTexture> texture(memnew(ImageTexture));
|
||||
Ref<Image> img = p_texture->get_data();
|
||||
img = img->duplicate();
|
||||
|
||||
if (p_flip_y) {
|
||||
img->flip_y();
|
||||
@@ -1076,7 +1077,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_constant("bezier_len_neg", "GraphEdit", 160 * EDSCALE);
|
||||
|
||||
// GraphEditMinimap
|
||||
theme->set_stylebox("bg", "GraphEditMinimap", make_flat_stylebox(dark_color_1, 0, 0, 0, 0));
|
||||
Ref<StyleBoxFlat> style_minimap_bg = make_flat_stylebox(dark_color_1, 0, 0, 0, 0);
|
||||
style_minimap_bg->set_border_color(dark_color_3);
|
||||
style_minimap_bg->set_border_width_all(1);
|
||||
theme->set_stylebox("bg", "GraphEditMinimap", style_minimap_bg);
|
||||
|
||||
Ref<StyleBoxFlat> style_minimap_camera;
|
||||
Ref<StyleBoxFlat> style_minimap_node;
|
||||
if (dark_theme) {
|
||||
@@ -1093,9 +1098,15 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_stylebox("camera", "GraphEditMinimap", style_minimap_camera);
|
||||
theme->set_stylebox("node", "GraphEditMinimap", style_minimap_node);
|
||||
|
||||
Ref<Texture> resizer_icon = theme->get_icon("GuiResizer", "EditorIcons");
|
||||
theme->set_icon("resizer", "GraphEditMinimap", flip_icon(resizer_icon, true, true));
|
||||
theme->set_color("resizer_color", "GraphEditMinimap", Color(1, 1, 1, 0.65));
|
||||
Ref<Texture> minimap_resizer_icon = theme->get_icon("GuiResizer", "EditorIcons");
|
||||
Color minimap_resizer_color;
|
||||
if (dark_theme) {
|
||||
minimap_resizer_color = Color(1, 1, 1, 0.65);
|
||||
} else {
|
||||
minimap_resizer_color = Color(0, 0, 0, 0.65);
|
||||
}
|
||||
theme->set_icon("resizer", "GraphEditMinimap", flip_icon(minimap_resizer_icon, true, true));
|
||||
theme->set_color("resizer_color", "GraphEditMinimap", minimap_resizer_color);
|
||||
|
||||
// GraphNode
|
||||
const float mv = dark_theme ? 0.0 : 1.0;
|
||||
|
||||
Reference in New Issue
Block a user