summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-07-18 14:06:04 +0200
committerGitHub <noreply@github.com>2017-07-18 14:06:04 +0200
commit0afa77a8a2e148fac6b57fab3e85c6e631e12c63 (patch)
tree1d1f89e19f9dda09d4c4c6c246ec6f510f251047 /editor
parente21ea393ea9d69a53f82ec4aa6d8c7f05c16979a (diff)
parent17c3422431c3312d6e124b0afa871fd166928669 (diff)
Merge pull request #9689 from djrm/theme_fixes
Added separators using StyleBoxLine, some theme style fixes
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp4
-rw-r--r--editor/editor_themes.cpp22
-rw-r--r--editor/icons/2x/icon_variant.pngbin0 -> 398 bytes
-rw-r--r--editor/icons/icon_variant.pngbin240 -> 237 bytes
-rw-r--r--editor/icons/source/icon_variant.svg146
-rw-r--r--editor/script_editor_debugger.cpp19
6 files changed, 176 insertions, 15 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 00609b22d7..8912467b72 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1628,7 +1628,7 @@ void EditorNode::_edit_current() {
p->add_separator();
p->add_shortcut(ED_SHORTCUT("property_editor/make_subresources_unique", TTR("Make Sub-Resources Unique")), OBJECT_UNIQUE_RESOURCES);
p->add_separator();
- p->add_icon_shortcut(gui_base->get_icon("Help", "EditorIcons"), ED_SHORTCUT("property_editor/open_help", TTR("Open in Help")), OBJECT_REQUEST_HELP);
+ p->add_icon_shortcut(gui_base->get_icon("HelpSearch", "EditorIcons"), ED_SHORTCUT("property_editor/open_help", TTR("Open in Help")), OBJECT_REQUEST_HELP);
}
List<MethodInfo> methods;
@@ -5642,7 +5642,7 @@ EditorNode::EditorNode() {
p = help_menu->get_popup();
p->connect("id_pressed", this, "_menu_option");
p->add_icon_item(gui_base->get_icon("ClassList", "EditorIcons"), TTR("Classes"), HELP_CLASSES);
- p->add_icon_item(gui_base->get_icon("Help", "EditorIcons"), TTR("Search"), HELP_SEARCH);
+ p->add_icon_item(gui_base->get_icon("HelpSearch", "EditorIcons"), TTR("Search"), HELP_SEARCH);
p->add_separator();
p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Online Docs"), HELP_DOCS);
p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Q&A"), HELP_QA);
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index ce9b004ce1..4e8f7029ff 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -69,6 +69,15 @@ static Ref<StyleBoxFlat> make_flat_stylebox(Color color, float p_margin_left = -
return style;
}
+static Ref<StyleBoxLine> make_line_stylebox(Color color, int thickness = 1, float grow = 1, bool vertical = false) {
+ Ref<StyleBoxLine> style(memnew(StyleBoxLine));
+ style->set_color(color);
+ style->set_grow(grow);
+ style->set_thickness(thickness);
+ style->set_vertical(vertical);
+ return style;
+}
+
static Ref<StyleBoxFlat> change_border_color(Ref<StyleBoxFlat> p_style, Color p_color) {
Ref<StyleBoxFlat> style = p_style->duplicate();
style->set_light_color(p_color);
@@ -143,6 +152,9 @@ Ref<Theme> create_editor_theme() {
Color title_color_hl_text_color = dark_bg ? Color(1, 1, 1, 0.9) : Color(0, 0, 0, 0.9);
Ref<Texture> title_hl_close_icon = theme->get_icon((dark_bg ? "GuiCloseLight" : "GuiCloseDark"), "EditorIcons");
+ bool dark_base = ((base_color.r + base_color.g + base_color.b) / 3.0) < 0.5;
+ Color separator_color = dark_base ? Color(1, 1, 1, 0.1) : Color(0, 0, 0, 0.1);
+
theme->set_color("highlight_color", "Editor", highlight_color);
theme->set_color("base_color", "Editor", base_color);
theme->set_color("dark_color_1", "Editor", dark_color_1);
@@ -244,7 +256,7 @@ Ref<Theme> create_editor_theme() {
theme->set_color("icon_color_pressed", "Button", Color(highlight_color.r * 1.15, highlight_color.g * 1.15, highlight_color.b * 1.15, highlight_color.a));
// OptionButton
- Ref<StyleBoxFlat> style_option_button = make_flat_stylebox(dark_color_1, 4, 4, 4, 4);
+ Ref<StyleBoxFlat> style_option_button = make_flat_stylebox(dark_color_1, 4, 4, 8, 4);
style_option_button->set_border_size(border_width);
style_option_button->set_light_color(light_color_1);
style_option_button->set_dark_color(light_color_1);
@@ -259,6 +271,8 @@ Ref<Theme> create_editor_theme() {
theme->set_color("font_color_pressed", "OptionButton", highlight_color);
theme->set_color("icon_color_hover", "OptionButton", HIGHLIGHT_COLOR_LIGHT);
theme->set_icon("arrow", "OptionButton", theme->get_icon("GuiOptionArrow", "EditorIcons"));
+ theme->set_constant("arrow_margin", "OptionButton", 4);
+ theme->set_constant("modulate_arrow", "OptionButton", true);
// CheckButton
theme->set_icon("on", "CheckButton", theme->get_icon("GuiToggleOn", "EditorIcons"));
@@ -271,7 +285,7 @@ Ref<Theme> create_editor_theme() {
style_popup_menu->set_dark_color(light_color_1);
style_popup_menu->set_border_blend(false);
theme->set_stylebox("panel", "PopupMenu", style_popup_menu);
- theme->set_stylebox("separator", "PopupMenu", make_empty_stylebox());
+ theme->set_stylebox("separator", "PopupMenu", make_line_stylebox(separator_color, border_width, 8 - border_width));
// Tree & ItemList background
Ref<StyleBoxFlat> style_tree_bg = make_flat_stylebox(dark_color_1, 2, 4, 2, 4);
@@ -362,8 +376,8 @@ Ref<Theme> create_editor_theme() {
theme->set_icon("close", "Tabs", title_hl_close_icon);
// Separatos (no separatos)
- theme->set_stylebox("separator", "HSeparator", make_empty_stylebox());
- theme->set_stylebox("separator", "VSeparator", make_empty_stylebox());
+ 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);
diff --git a/editor/icons/2x/icon_variant.png b/editor/icons/2x/icon_variant.png
new file mode 100644
index 0000000000..bb8075a069
--- /dev/null
+++ b/editor/icons/2x/icon_variant.png
Binary files differ
diff --git a/editor/icons/icon_variant.png b/editor/icons/icon_variant.png
index 1ae2812ff7..af7590345e 100644
--- a/editor/icons/icon_variant.png
+++ b/editor/icons/icon_variant.png
Binary files differ
diff --git a/editor/icons/source/icon_variant.svg b/editor/icons/source/icon_variant.svg
new file mode 100644
index 0000000000..d966190ab0
--- /dev/null
+++ b/editor/icons/source/icon_variant.svg
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92+devel unknown"
+ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"
+ sodipodi:docname="icon_variant.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627418"
+ inkscape:cx="12.635414"
+ inkscape:cy="11.860443"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:snap-bbox-midpoints="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ inkscape:document-rotation="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <g
+ transform="translate(0,-3)"
+ id="layer1-5"
+ inkscape:label="Layer 1"
+ style="fill:#e0e0e0;fill-opacity:1">
+ <rect
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4320"
+ width="2"
+ height="5.9999666"
+ x="3"
+ y="1044.3622" />
+ <rect
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4324"
+ width="2"
+ height="5.9999843"
+ x="6"
+ y="1044.3622" />
+ <rect
+ y="1044.3622"
+ x="3"
+ height="2.0000174"
+ width="1"
+ id="rect4326"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 3,1044.3622 a 3,3 0 0 0 -3,3 h 2 a 1.0000174,1.0000174 0 0 1 1,-1 z"
+ id="path4328"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path4330"
+ d="m 14,1050.3622 a 3,3 0 0 1 -3,-3 h 2 a 1.0000174,1.0000174 0 0 0 1,1 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ <rect
+ transform="scale(1,-1)"
+ y="-1052.3622"
+ x="14"
+ height="7.9999843"
+ width="2"
+ id="rect4334"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ transform="scale(1,-1)"
+ y="-1047.3622"
+ x="11"
+ height="2.9999826"
+ width="2"
+ id="rect4338"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4340"
+ d="m 3,1050.3622 a 3,3 0 0 1 -3,-3 h 2 a 1.0000174,1.0000174 0 0 0 1,1 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4342"
+ d="m 8,1044.3622 a 3,3 0 0 1 3,3 H 9 a 1.0000174,1.0000174 0 0 0 -1,-1 z"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <rect
+ y="1047.3622"
+ x="9"
+ height="3.0000174"
+ width="2"
+ id="rect4344"
+ style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+ </g>
+</svg>
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 9dce48937c..4b3ebf5643 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -1849,30 +1849,31 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
}
{ // misc
- VBoxContainer *info_left = memnew(VBoxContainer);
- info_left->set_h_size_flags(SIZE_EXPAND_FILL);
+ GridContainer *info_left = memnew(GridContainer);
+ info_left->set_columns(2);
info_left->set_name(TTR("Misc"));
tabs->add_child(info_left);
clicked_ctrl = memnew(LineEdit);
- info_left->add_margin_child(TTR("Clicked Control:"), clicked_ctrl);
+ clicked_ctrl->set_h_size_flags(SIZE_EXPAND_FILL);
+ info_left->add_child(memnew(Label(TTR("Clicked Control:"))));
+ info_left->add_child(clicked_ctrl);
clicked_ctrl_type = memnew(LineEdit);
- info_left->add_margin_child(TTR("Clicked Control Type:"), clicked_ctrl_type);
+ info_left->add_child(memnew(Label(TTR("Clicked Control Type:"))));
+ info_left->add_child(clicked_ctrl_type);
live_edit_root = memnew(LineEdit);
+ live_edit_root->set_h_size_flags(SIZE_EXPAND_FILL);
{
HBoxContainer *lehb = memnew(HBoxContainer);
Label *l = memnew(Label(TTR("Live Edit Root:")));
- lehb->add_child(l);
- l->set_h_size_flags(SIZE_EXPAND_FILL);
+ info_left->add_child(l);
+ lehb->add_child(live_edit_root);
le_set = memnew(Button(TTR("Set From Tree")));
lehb->add_child(le_set);
le_clear = memnew(Button(TTR("Clear")));
lehb->add_child(le_clear);
info_left->add_child(lehb);
- MarginContainer *mc = memnew(MarginContainer);
- mc->add_child(live_edit_root);
- info_left->add_child(mc);
le_set->set_disabled(true);
le_clear->set_disabled(true);
}