draw button focus before text and icon

closes #2047
This commit is contained in:
Juan Linietsky
2015-06-08 10:36:11 -03:00
parent 7590f3db21
commit c76900beb8
3 changed files with 14 additions and 5 deletions

View File

@ -97,6 +97,13 @@ void Button::_notification(int p_what) {
} break;
}
if (has_focus()) {
Ref<StyleBox> style = get_stylebox("focus");
style->draw(ci,Rect2(Point2(),size));
}
Ref<StyleBox> style = get_stylebox("normal" );
Ref<Font> font=get_font("font");
Ref<Texture> _icon;
@ -134,11 +141,7 @@ void Button::_notification(int p_what) {
_icon->draw(ci,Point2(style->get_offset().x, Math::floor( (size.height-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) );
}
if (has_focus()) {
Ref<StyleBox> style = get_stylebox("focus");
style->draw(ci,Rect2(Point2(),size));
}
}
}