diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-07-18 14:06:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 14:06:04 +0200 |
commit | 0afa77a8a2e148fac6b57fab3e85c6e631e12c63 (patch) | |
tree | 1d1f89e19f9dda09d4c4c6c246ec6f510f251047 /scene/gui/option_button.cpp | |
parent | e21ea393ea9d69a53f82ec4aa6d8c7f05c16979a (diff) | |
parent | 17c3422431c3312d6e124b0afa871fd166928669 (diff) | |
download | redot-engine-0afa77a8a2e148fac6b57fab3e85c6e631e12c63.tar.gz |
Merge pull request #9689 from djrm/theme_fixes
Added separators using StyleBoxLine, some theme style fixes
Diffstat (limited to 'scene/gui/option_button.cpp')
-rw-r--r-- | scene/gui/option_button.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index f75e0986c1..b842419eab 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -52,11 +52,26 @@ void OptionButton::_notification(int p_what) { RID ci = get_canvas_item(); Ref<Texture> arrow = Control::get_icon("arrow"); Ref<StyleBox> normal = get_stylebox("normal"); + Color clr = Color(1, 1, 1); + if (get_constant("modulate_arrow")) + switch (get_draw_mode()) { + case DRAW_PRESSED: + clr = get_color("font_color_pressed"); + break; + case DRAW_HOVER: + clr = get_color("font_color_hover"); + break; + case DRAW_DISABLED: + clr = get_color("font_color_disabled"); + break; + default: + clr = get_color("font_color"); + } Size2 size = get_size(); Point2 ofs(size.width - arrow->get_width() - get_constant("arrow_margin"), int(Math::abs((size.height - arrow->get_height()) / 2))); - arrow->draw(ci, ofs); + arrow->draw(ci, ofs, clr); } break; } |