@@ -85,6 +85,25 @@ static Ref<StyleBoxLine> make_line_stylebox(Color p_color, int p_thickness = 1,
85
85
return style;
86
86
}
87
87
88
+ static Ref<Texture2D> flip_icon (Ref<Texture2D> p_texture, bool p_flip_y = false , bool p_flip_x = false ) {
89
+ if (!p_flip_y && !p_flip_x) {
90
+ return p_texture;
91
+ }
92
+
93
+ Ref<ImageTexture> texture (memnew (ImageTexture));
94
+ Ref<Image> img = p_texture->get_data ();
95
+
96
+ if (p_flip_y) {
97
+ img->flip_y ();
98
+ }
99
+ if (p_flip_x) {
100
+ img->flip_x ();
101
+ }
102
+
103
+ texture->create_from_image (img);
104
+ return texture;
105
+ }
106
+
88
107
#ifdef MODULE_SVG_ENABLED
89
108
static Ref<ImageTexture> editor_generate_icon (int p_index, bool p_convert_color, float p_scale = EDSCALE, bool p_force_filter = false ) {
90
109
Ref<ImageTexture> icon = memnew (ImageTexture);
@@ -1073,11 +1092,33 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
1073
1092
theme->set_icon (" more" , " GraphEdit" , theme->get_icon (" ZoomMore" , " EditorIcons" ));
1074
1093
theme->set_icon (" reset" , " GraphEdit" , theme->get_icon (" ZoomReset" , " EditorIcons" ));
1075
1094
theme->set_icon (" snap" , " GraphEdit" , theme->get_icon (" SnapGrid" , " EditorIcons" ));
1095
+ theme->set_icon (" minimap" , " GraphEdit" , theme->get_icon (" GridMinimap" , " EditorIcons" ));
1076
1096
theme->set_constant (" bezier_len_pos" , " GraphEdit" , 80 * EDSCALE);
1077
1097
theme->set_constant (" bezier_len_neg" , " GraphEdit" , 160 * EDSCALE);
1078
1098
1079
- // GraphNode
1099
+ // GraphEditMinimap
1100
+ theme->set_stylebox (" bg" , " GraphEditMinimap" , make_flat_stylebox (dark_color_1, 0 , 0 , 0 , 0 ));
1101
+ Ref<StyleBoxFlat> style_minimap_camera;
1102
+ Ref<StyleBoxFlat> style_minimap_node;
1103
+ if (dark_theme) {
1104
+ style_minimap_camera = make_flat_stylebox (Color (0.65 , 0.65 , 0.65 , 0.2 ), 0 , 0 , 0 , 0 );
1105
+ style_minimap_camera->set_border_color (Color (0.65 , 0.65 , 0.65 , 0.45 ));
1106
+ style_minimap_node = make_flat_stylebox (Color (1 , 1 , 1 ), 0 , 0 , 0 , 0 );
1107
+ } else {
1108
+ style_minimap_camera = make_flat_stylebox (Color (0.38 , 0.38 , 0.38 , 0.2 ), 0 , 0 , 0 , 0 );
1109
+ style_minimap_camera->set_border_color (Color (0.38 , 0.38 , 0.38 , 0.45 ));
1110
+ style_minimap_node = make_flat_stylebox (Color (0 , 0 , 0 ), 0 , 0 , 0 , 0 );
1111
+ }
1112
+ style_minimap_camera->set_border_width_all (1 );
1113
+ style_minimap_node->set_corner_radius_all (1 );
1114
+ theme->set_stylebox (" camera" , " GraphEditMinimap" , style_minimap_camera);
1115
+ theme->set_stylebox (" node" , " GraphEditMinimap" , style_minimap_node);
1116
+
1117
+ Ref<Texture2D> resizer_icon = theme->get_icon (" GuiResizer" , " EditorIcons" );
1118
+ theme->set_icon (" resizer" , " GraphEditMinimap" , flip_icon (resizer_icon, true , true ));
1119
+ theme->set_color (" resizer_color" , " GraphEditMinimap" , Color (1 , 1 , 1 , 0.65 ));
1080
1120
1121
+ // GraphNode
1081
1122
const float mv = dark_theme ? 0.0 : 1.0 ;
1082
1123
const float mv2 = 1.0 - mv;
1083
1124
const int gn_margin_side = 28 ;
0 commit comments