Skip to content

Commit

Permalink
Improvements and fixes for the default theme.
Browse files Browse the repository at this point in the history
Added customizable border size and window highlight.
  • Loading branch information
djrm committed Jul 16, 2017
1 parent a5b7c22 commit a3c2d9a
Show file tree
Hide file tree
Showing 90 changed files with 2,313 additions and 155 deletions.
17 changes: 4 additions & 13 deletions editor/asset_library_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() {

Ref<StyleBoxEmpty> border;
border.instance();
/*border->set_default_margin(MARGIN_LEFT,5);
border->set_default_margin(MARGIN_RIGHT,5);
border->set_default_margin(MARGIN_BOTTOM,5);
border->set_default_margin(MARGIN_TOP,5);*/
border->set_default_margin(MARGIN_LEFT, 5);
border->set_default_margin(MARGIN_RIGHT, 5);
border->set_default_margin(MARGIN_BOTTOM, 5);
border->set_default_margin(MARGIN_TOP, 5);
add_style_override("panel", border);

HBoxContainer *hb = memnew(HBoxContainer);
Expand Down Expand Up @@ -1261,15 +1261,6 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {

templates_only = p_templates_only;

Ref<StyleBoxEmpty> border;
border.instance();
border->set_default_margin(MARGIN_LEFT, 15);
border->set_default_margin(MARGIN_RIGHT, 15);
border->set_default_margin(MARGIN_BOTTOM, 5);
border->set_default_margin(MARGIN_TOP, 5);

add_style_override("panel", border);

VBoxContainer *library_main = memnew(VBoxContainer);

add_child(library_main);
Expand Down
5 changes: 3 additions & 2 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void EditorNode::_notification(int p_what) {
gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles"));
play_button_panel->add_style_override("panel", gui_base->get_stylebox("PlayButtonPanel", "EditorStyles"));
scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles"));
bottom_panel->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles"));
bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer"));
scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles"));
scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles"));
if (bool(EDITOR_DEF("interface/scene_tabs/resize_if_many_tabs", true))) {
Expand Down Expand Up @@ -5422,6 +5422,7 @@ EditorNode::EditorNode() {
scene_root_parent = memnew(PanelContainer);
scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles"));
// sc->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles"));

//Ref<StyleBox> sp = scene_root_parent->get_stylebox("panel","TabContainer");
//scene_root_parent->add_style_override("panel",sp);
Expand Down Expand Up @@ -5990,7 +5991,7 @@ EditorNode::EditorNode() {
_update_layouts_menu();

bottom_panel = memnew(PanelContainer);
bottom_panel->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles"));
bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer"));
center_split->add_child(bottom_panel);
center_split->set_dragger_visibility(SplitContainer::DRAGGER_HIDDEN);

Expand Down
9 changes: 6 additions & 3 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,15 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {

set("interface/theme/preset", 0);
hints["interface/theme/preset"] = PropertyInfo(Variant::INT, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Grey,Godot 2,Arc,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/theme/base_color", Color::html("#273241"));
set("interface/theme/base_color", Color::html("#323b4f"));
hints["interface/theme/highlight_color"] = PropertyInfo(Variant::COLOR, "interface/theme/highlight_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/theme/highlight_color", Color::html("#b79047"));
set("interface/theme/highlight_color", Color::html("#699ce8"));
hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/theme/contrast", 0.2);
hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01");
set("interface/theme/highlight_tabs", false);
set("interface/theme/border_size", 1);
hints["interface/theme/border_size"] = PropertyInfo(Variant::INT, "interface/theme/border_size", PROPERTY_HINT_RANGE, "0,2,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/theme/custom_theme", "");
hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);

Expand Down Expand Up @@ -613,7 +616,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {

set("editors/grid_map/pick_distance", 5000.0);

set("editors/3d/grid_color", Color(0, 1, 0, 0.2));
set("editors/3d/grid_color", Color(1, 1, 1, 0.2));
hints["editors/3d/grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);

set("editors/3d/default_fov", 55.0);
Expand Down
Loading

0 comments on commit a3c2d9a

Please sign in to comment.