Skip to content

Commit

Permalink
Merge pull request #10164 from djrm/pr_theme_fixes
Browse files Browse the repository at this point in the history
Visual polishing
  • Loading branch information
akien-mga authored Aug 10, 2017
2 parents e93ce33 + 273d2ab commit 81dde26
Show file tree
Hide file tree
Showing 23 changed files with 187 additions and 84 deletions.
27 changes: 14 additions & 13 deletions editor/animation_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,11 +1091,11 @@ void AnimationKeyEditor::_track_editor_draw() {
int sep = get_constant("vseparation", "Tree");
int hsep = get_constant("hseparation", "Tree");
Color color = get_color("font_color", "Tree");
Color sepcolor = get_color("light_color_1", "Editor");
Color timecolor = get_color("dark_color_2", "Editor");
Color sepcolor = Color(1, 1, 1, 0.2);
Color timecolor = Color(1, 1, 1, 0.2);
Color hover_color = Color(1, 1, 1, 0.05);
Color select_color = Color(1, 1, 1, 0.1);
Color invalid_path_color = Color(1, 0.6, 0.4, 0.5);
Color invalid_path_color = get_color("error_color", "Editor");
Color track_select_color = get_color("highlight_color", "Editor");

Ref<Texture> remove_icon = get_icon("Remove", "EditorIcons");
Expand Down Expand Up @@ -1156,11 +1156,12 @@ void AnimationKeyEditor::_track_editor_draw() {
int settings_limit = size.width - right_separator_ofs;
int name_limit = settings_limit * name_column_ratio;

te->draw_line(ofs + Point2(name_limit, 0), ofs + Point2(name_limit, size.height), color);
te->draw_line(ofs + Point2(settings_limit, 0), ofs + Point2(settings_limit, size.height), color);
Color linecolor = Color(1, 1, 1, 0.2);
te->draw_line(ofs + Point2(name_limit, 0), ofs + Point2(name_limit, size.height), linecolor);
te->draw_line(ofs + Point2(settings_limit, 0), ofs + Point2(settings_limit, size.height), linecolor);
te->draw_texture(hsize_icon, ofs + Point2(name_limit - hsize_icon->get_width() - hsep, (h - hsize_icon->get_height()) / 2));

te->draw_line(ofs + Point2(0, h), ofs + Point2(size.width, h), color);
te->draw_line(ofs + Point2(0, h), ofs + Point2(size.width, h), linecolor);
// draw time

float keys_from;
Expand All @@ -1180,7 +1181,7 @@ void AnimationKeyEditor::_track_editor_draw() {

int end_px = (l - h_scroll->get_value()) * scale;
int begin_px = -h_scroll->get_value() * scale;
Color notimecol = get_color("light_color_1", "Editor");
Color notimecol = get_color("dark_color_2", "Editor");

{

Expand Down Expand Up @@ -1276,7 +1277,7 @@ void AnimationKeyEditor::_track_editor_draw() {
if ((sc / step) != (prev_sc / step) || (prev_sc < 0 && sc >= 0)) {

int scd = sc < 0 ? prev_sc : sc;
te->draw_line(ofs + Point2(name_limit + i, 0), ofs + Point2(name_limit + i, h), color);
te->draw_line(ofs + Point2(name_limit + i, 0), ofs + Point2(name_limit + i, h), linecolor);
te->draw_string(font, ofs + Point2(name_limit + i + 3, (h - font->get_height()) / 2 + font->get_ascent()).floor(), String::num((scd - (scd % step)) / double(SC_ADJ), decimals), sub ? color_time_dec : color_time_sec, zoomw - i);
}
}
Expand Down Expand Up @@ -1335,7 +1336,7 @@ void AnimationKeyEditor::_track_editor_draw() {
te->draw_line(ofs + Point2(0, y + h), ofs + Point2(size.width, y + h), sepcolor);

Point2 icon_ofs = ofs + Point2(size.width, y + (h - remove_icon->get_height()) / 2).floor();
icon_ofs.y += 4;
icon_ofs.y += 4 * EDSCALE;

/* icon_ofs.x-=remove_icon->get_width();
Expand All @@ -1353,7 +1354,7 @@ void AnimationKeyEditor::_track_editor_draw() {
*/
track_ofs[0] = size.width - icon_ofs.x;
icon_ofs.x -= down_icon->get_width();
te->draw_texture(down_icon, icon_ofs);
te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE));

int wrap_type = animation->track_get_interpolation_loop_wrap(idx) ? 1 : 0;
icon_ofs.x -= hsep;
Expand All @@ -1366,7 +1367,7 @@ void AnimationKeyEditor::_track_editor_draw() {
track_ofs[1] = size.width - icon_ofs.x;

icon_ofs.x -= down_icon->get_width();
te->draw_texture(down_icon, icon_ofs);
te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE));

int interp_type = animation->track_get_interpolation_type(idx);
ERR_CONTINUE(interp_type < 0 || interp_type >= 3);
Expand All @@ -1385,7 +1386,7 @@ void AnimationKeyEditor::_track_editor_draw() {

icon_ofs.x -= hsep;
icon_ofs.x -= down_icon->get_width();
te->draw_texture(down_icon, icon_ofs);
te->draw_texture(down_icon, icon_ofs - Size2(0, 4 * EDSCALE));

icon_ofs.x -= hsep;
icon_ofs.x -= cont_icon[umode]->get_width();
Expand Down Expand Up @@ -3745,7 +3746,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
history = EditorNode::get_singleton()->get_editor_history();

ec = memnew(Control);
ec->set_custom_minimum_size(Size2(0, 150));
ec->set_custom_minimum_size(Size2(0, 150) * EDSCALE);
add_child(ec);
ec->set_v_size_flags(SIZE_EXPAND_FILL);

Expand Down
12 changes: 6 additions & 6 deletions editor/editor_audio_buses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,20 +1061,19 @@ EditorAudioBuses::EditorAudioBuses() {
top_hb = memnew(HBoxContainer);
add_child(top_hb);

file = memnew(ToolButton);
file->set_text("default_bus_layout.tres");
top_hb->add_child(file);
file->connect("pressed", this, "_select_layout");

add = memnew(Button);
top_hb->add_child(add);
;
add->set_text(TTR("Add Bus"));

add->connect("pressed", this, "_add_bus");

top_hb->add_spacer();

file = memnew(ToolButton);
file->set_text("default_bus_layout.tres");
top_hb->add_child(file);
file->connect("pressed", this, "_select_layout");

load = memnew(Button);
load->set_text(TTR("Load"));
top_hb->add_child(load);
Expand All @@ -1096,6 +1095,7 @@ EditorAudioBuses::EditorAudioBuses() {
_new->connect("pressed", this, "_new_layout");

bus_scroll = memnew(ScrollContainer);
bus_scroll->add_style_override("panel", memnew(StyleBoxEmpty));
bus_scroll->set_v_size_flags(SIZE_EXPAND_FILL);
bus_scroll->set_enable_h_scroll(true);
bus_scroll->set_enable_v_scroll(false);
Expand Down
9 changes: 2 additions & 7 deletions editor/editor_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,18 @@ EditorLog::EditorLog() {
HBoxContainer *hb = memnew(HBoxContainer);
vb->add_child(hb);
title = memnew(Label);
title->set_text(TTR(" Output:"));
title->set_text(TTR("Output:"));
title->set_h_size_flags(SIZE_EXPAND_FILL);
hb->add_child(title);

//pd = memnew( PaneDrag );
//hb->add_child(pd);
//pd->connect("dragged",this,"_dragged");
//pd->set_default_cursor_shape(Control::CURSOR_MOVE);

clearbutton = memnew(Button);
hb->add_child(clearbutton);
clearbutton->set_text(TTR("Clear"));
clearbutton->connect("pressed", this, "_clear_request");

ec = memnew(Control);
vb->add_child(ec);
ec->set_custom_minimum_size(Size2(0, 180));
ec->set_custom_minimum_size(Size2(0, 180) * EDSCALE);
ec->set_v_size_flags(SIZE_EXPAND_FILL);

pc = memnew(PanelContainer);
Expand Down
9 changes: 5 additions & 4 deletions editor/editor_plugin_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,16 @@ EditorPluginSettings::EditorPluginSettings() {
plugin_list->set_column_expand(1, false);
plugin_list->set_column_expand(2, false);
plugin_list->set_column_expand(3, false);
plugin_list->set_column_min_width(1, 100);
plugin_list->set_column_min_width(2, 250);
plugin_list->set_column_min_width(3, 80);
plugin_list->set_column_min_width(1, 100 * EDSCALE);
plugin_list->set_column_min_width(2, 250 * EDSCALE);
plugin_list->set_column_min_width(3, 80 * EDSCALE);
plugin_list->set_hide_root(true);
plugin_list->connect("item_edited", this, "_plugin_activity_changed");

MarginContainer *mc = memnew(MarginContainer);
VBoxContainer *mc = memnew(VBoxContainer);
mc->add_child(plugin_list);
mc->set_v_size_flags(SIZE_EXPAND_FILL);
mc->set_h_size_flags(SIZE_EXPAND_FILL);

add_child(mc);

Expand Down
7 changes: 3 additions & 4 deletions editor/editor_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ String EditorProfiler::_get_time_as_text(Metric &m, float p_time, int p_calls) {

Color EditorProfiler::_get_color_from_signature(const StringName &p_signature) const {

Color bc = get_color("error_color", "Editor");
double rot = ABS(double(p_signature.hash()) / double(0x7FFFFFFF));
Color c;
c.set_hsv(rot, 1, 1);
return c;
c.set_hsv(rot, bc.get_s(), bc.get_v());
return c.linear_interpolate(get_color("base_color", "Editor"), 0.07);
}

void EditorProfiler::_item_edited() {
Expand Down Expand Up @@ -387,7 +388,6 @@ void EditorProfiler::_update_frame() {

if (plot_sigs.has(m.categories[i].signature)) {
category->set_checked(0, true);
category->set_custom_bg_color(0, Color(0, 0, 0));
category->set_custom_color(0, _get_color_from_signature(m.categories[i].signature));
}

Expand All @@ -411,7 +411,6 @@ void EditorProfiler::_update_frame() {

if (plot_sigs.has(it.signature)) {
item->set_checked(0, true);
item->set_custom_bg_color(0, Color(0, 0, 0));
item->set_custom_color(0, _get_color_from_signature(it.signature));
}
}
Expand Down
6 changes: 3 additions & 3 deletions editor/editor_themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Ref<Theme> create_editor_theme() {
theme->set_color("light_color_1", "Editor", light_color_1);
theme->set_color("light_color_2", "Editor", light_color_2);

Color success_color = highlight_color.linear_interpolate(Color(0, 1, .8), 0.8);
Color success_color = highlight_color.linear_interpolate(Color(.6, 1, .6), 0.8);
Color warning_color = highlight_color.linear_interpolate(Color(1, 1, .2), 0.8);
Color error_color = highlight_color.linear_interpolate(Color(1, .2, .2), 0.8);
theme->set_color("success_color", "Editor", success_color);
Expand Down Expand Up @@ -382,12 +382,12 @@ Ref<Theme> create_editor_theme() {
theme->set_stylebox("SceneTabBG", "EditorStyles", make_empty_stylebox(6, 5, 6, 5));
theme->set_icon("close", "Tabs", title_hl_close_icon);

// Separatos (no separatos)
// Separators (no separators)
theme->set_stylebox("separator", "HSeparator", make_line_stylebox(separator_color, border_width));
theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, border_width, 0, true));

// Debugger
Ref<StyleBoxFlat> style_panel_debugger = make_flat_stylebox(dark_color_2, 0, 4, 0, 0);
Ref<StyleBoxFlat> style_panel_debugger = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
theme->set_stylebox("DebuggerPanel", "EditorStyles", style_panel_debugger);

Ref<StyleBoxFlat> style_tab_fg_debugger = make_flat_stylebox(dark_color_2, 10, 5, 10, 5);
Expand Down
1 change: 0 additions & 1 deletion editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
file_list_vb->set_v_size_flags(SIZE_EXPAND_FILL);

path_hb = memnew(HBoxContainer);
path_hb->add_child(memnew(Control));
file_list_vb->add_child(path_hb);

button_back = memnew(ToolButton);
Expand Down
Binary file added editor/icons/2x/icon_audio_stream_player_3_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified editor/icons/2x/icon_bus_vu_frozen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified editor/icons/2x/icon_connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/icons/2x/icon_native_script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/icons/icon_audio_stream_player_3_d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified editor/icons/icon_bus_vu_frozen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified editor/icons/icon_connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added editor/icons/icon_native_script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions editor/icons/source/icon_audio_stream_player_3_d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 81dde26

Please sign in to comment.