diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-09-26 08:03:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-26 08:03:00 +0200 |
commit | 777f26fe29718a6609bea84f693ae96d8f22a01c (patch) | |
tree | 19c12dfbbfc2c1dd7dfc5649b26988ea8b5bcdd0 /editor/plugins | |
parent | 1da6b4d1d1a2154fba85f5a37f958d333347ab10 (diff) | |
parent | b622c92fad36ef7c8cfb84f7e0de188557808ee0 (diff) |
Merge pull request #11597 from djrm/pr_interface_colors
Removed most of the custom colors from the interface.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 13 |
3 files changed, 16 insertions, 15 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index db3a303a9b..cd53264437 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1434,7 +1434,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { error_hb = memnew(HBoxContainer); library_main->add_child(error_hb); error_label = memnew(Label); - error_label->add_color_override("color", Color(1, 0.4, 0.3)); + error_label->add_color_override("color", get_color("error_color", "Editor")); error_hb->add_child(error_label); description = NULL; diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 70d771afc8..067629c460 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -613,8 +613,8 @@ void CurveEditor::_draw() { Vector2 min_edge = get_world_pos(Vector2(0, view_size.y)); Vector2 max_edge = get_world_pos(Vector2(view_size.x, 0)); - const Color grid_color0(0, 0, 0, 0.5); - const Color grid_color1(0, 0, 0, 0.15); + const Color grid_color0 = get_color("grid_major_color", "Editor"); + const Color grid_color1 = get_color("grid_minor_color", "Editor"); draw_line(Vector2(min_edge.x, curve.get_min_value()), Vector2(max_edge.x, curve.get_min_value()), grid_color0); draw_line(Vector2(max_edge.x, curve.get_max_value()), Vector2(min_edge.x, curve.get_max_value()), grid_color0); draw_line(Vector2(0, min_edge.y), Vector2(0, max_edge.y), grid_color0); @@ -636,7 +636,7 @@ void CurveEditor::_draw() { Ref<Font> font = get_font("font", "Label"); float font_height = font->get_height(); - const Color text_color(1, 1, 1, 0.3); + const Color text_color = get_color("font_color", "Editor"); { // X axis @@ -664,7 +664,7 @@ void CurveEditor::_draw() { if (_selected_point >= 0) { - const Color tangent_color(0.5, 0.5, 1, 1); + const Color tangent_color = get_color("accent_color", "Editor"); int i = _selected_point; Vector2 pos = curve.get_point_position(i); @@ -686,8 +686,8 @@ void CurveEditor::_draw() { draw_set_transform_matrix(_world_to_view); - const Color line_color(1, 1, 1, 0.85); - const Color edge_line_color(1, 1, 1, 0.4); + const Color line_color = get_color("highlight_color", "Editor"); + const Color edge_line_color = get_color("font_color", "Editor"); CanvasItemPlotCurve plot_func(*this, line_color, edge_line_color); plot_curve_accurate(curve, 4.f / view_size.x, plot_func); @@ -714,8 +714,8 @@ void CurveEditor::_draw() { draw_set_transform_matrix(Transform2D()); - const Color point_color(1, 1, 1); - const Color selected_point_color(1, 0.5, 0.5); + const Color point_color = get_color("font_color", "Editor"); + const Color selected_point_color = get_color("accent_color", "Editor"); for (int i = 0; i < curve.get_point_count(); ++i) { Vector2 pos = curve.get_point_position(i); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 41c2c61d82..3370ce51fd 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -39,7 +39,7 @@ void draw_margin_line(Control *edit_draw, Vector2 from, Vector2 to) { Vector2 line = (to - from).normalized() * 10; while ((to - from).length_squared() > 200) { - edit_draw->draw_line(from, from + line, Color(0.97, 0.2, 0.2), 2); + edit_draw->draw_line(from, from + line, EditorNode::get_singleton()->get_theme_base()->get_color("mono_color", "Editor"), 2); from += line * 2; } } @@ -66,6 +66,7 @@ void TextureRegionEditor::_region_draw() { VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D()); if (snap_mode == SNAP_GRID) { + Color grid_color = get_color("grid_major_color", "Editor"); Size2 s = edit_draw->get_size(); int last_cell = 0; @@ -76,7 +77,7 @@ void TextureRegionEditor::_region_draw() { if (i == 0) last_cell = cell; if (last_cell != cell) - edit_draw->draw_line(Point2(i, 0), Point2(i, s.height), Color(0.3, 0.7, 1, 0.3)); + edit_draw->draw_line(Point2(i, 0), Point2(i, s.height), grid_color); last_cell = cell; } else @@ -85,7 +86,7 @@ void TextureRegionEditor::_region_draw() { if (i == 0) last_cell = cell; if (last_cell != cell) - edit_draw->draw_rect(Rect2(i - snap_separation.x * draw_zoom, 0, snap_separation.x * draw_zoom, s.height), Color(0.3, 0.7, 1, 0.3)); + edit_draw->draw_rect(Rect2(i - snap_separation.x * draw_zoom, 0, snap_separation.x * draw_zoom, s.height), grid_color); last_cell = cell; } } @@ -97,7 +98,7 @@ void TextureRegionEditor::_region_draw() { if (i == 0) last_cell = cell; if (last_cell != cell) - edit_draw->draw_line(Point2(0, i), Point2(s.width, i), Color(0.3, 0.7, 1, 0.3)); + edit_draw->draw_line(Point2(0, i), Point2(s.width, i), grid_color); last_cell = cell; } else @@ -106,7 +107,7 @@ void TextureRegionEditor::_region_draw() { if (i == 0) last_cell = cell; if (last_cell != cell) - edit_draw->draw_rect(Rect2(0, i - snap_separation.y * draw_zoom, s.width, snap_separation.y * draw_zoom), Color(0.3, 0.7, 1, 0.3)); + edit_draw->draw_rect(Rect2(0, i - snap_separation.y * draw_zoom, s.width, snap_separation.y * draw_zoom), grid_color); last_cell = cell; } } @@ -137,7 +138,7 @@ void TextureRegionEditor::_region_draw() { mtx.basis_xform(rect.position + rect.size), mtx.basis_xform(rect.position + Vector2(0, rect.size.y)) }; - Color color(0.9, 0.5, 0.5); + Color color = get_color("mono_color", "Editor"); for (int i = 0; i < 4; i++) { int prev = (i + 3) % 4; |