diff options
Diffstat (limited to 'scene/resources/default_theme/default_theme.cpp')
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 3f19c2eafc..3a824a56a3 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -6,6 +6,7 @@ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -120,7 +121,7 @@ static Ref<Texture> make_icon(T p_src) { } static Ref<Shader> make_shader(const char *vertex_code, const char *fragment_code, const char *lighting_code) { - Ref<Shader> shader = (memnew(Shader(Shader::MODE_CANVAS_ITEM))); + Ref<Shader> shader = (memnew(Shader())); //shader->set_code(vertex_code, fragment_code, lighting_code); return shader; @@ -283,16 +284,10 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref< // ToolButton - Ref<StyleBox> tb_empty = memnew(StyleBoxEmpty); - tb_empty->set_default_margin(MARGIN_LEFT, 6 * scale); - tb_empty->set_default_margin(MARGIN_RIGHT, 6 * scale); - tb_empty->set_default_margin(MARGIN_TOP, 4 * scale); - tb_empty->set_default_margin(MARGIN_BOTTOM, 4 * scale); - - t->set_stylebox("normal", "ToolButton", tb_empty); - t->set_stylebox("pressed", "ToolButton", make_stylebox(button_pressed_png, 4, 4, 4, 4)); - t->set_stylebox("hover", "ToolButton", make_stylebox(button_normal_png, 4, 4, 4, 4)); - t->set_stylebox("disabled", "ToolButton", make_empty_stylebox(4, 4, 4, 4)); + t->set_stylebox("normal", "ToolButton", make_empty_stylebox(6, 4, 6, 4)); + t->set_stylebox("pressed", "ToolButton", make_stylebox(button_pressed_png, 4, 4, 4, 4, 6, 4, 6, 4)); + t->set_stylebox("hover", "ToolButton", make_stylebox(button_normal_png, 4, 4, 4, 4, 6, 4, 6, 4)); + t->set_stylebox("disabled", "ToolButton", make_empty_stylebox(6, 4, 6, 4)); t->set_stylebox("focus", "ToolButton", focus); t->set_font("font", "ToolButton", default_font); @@ -537,10 +532,8 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref< // WindowDialog - Ref<StyleBoxTexture> style_pp_win = sb_expand(make_stylebox(popup_window_png, 10, 26, 10, 8), 8, 24, 8, 6); - t->set_stylebox("panel", "WindowDialog", style_pp_win); - t->set_constant("titlebar_height", "WindowDialog", 20 * scale); - t->set_constant("scaleborder_size", "WindowDialog", 4); + t->set_stylebox("panel", "WindowDialog", sb_expand(make_stylebox(popup_window_png, 10, 26, 10, 8), 8, 24, 8, 6)); + t->set_constant("scaleborder_size", "WindowDialog", 4 * scale); t->set_font("title_font", "WindowDialog", large_font); t->set_color("title_color", "WindowDialog", Color(0, 0, 0)); |