diff options
Diffstat (limited to 'scene/gui/separator.cpp')
-rw-r--r-- | scene/gui/separator.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/scene/gui/separator.cpp b/scene/gui/separator.cpp index 32bd2239fc..e256b8f928 100644 --- a/scene/gui/separator.cpp +++ b/scene/gui/separator.cpp @@ -28,54 +28,47 @@ /*************************************************************************/ #include "separator.h" - Size2 Separator::get_minimum_size() const { - Size2 ms(3,3); - ms[orientation]=get_constant("separation"); + Size2 ms(3, 3); + ms[orientation] = get_constant("separation"); return ms; - - } void Separator::_notification(int p_what) { - - switch(p_what) { + switch (p_what) { case NOTIFICATION_DRAW: { Size2i size = get_size(); Ref<StyleBox> style = get_stylebox("separator"); - Size2i ssize=style->get_minimum_size()+style->get_center_size(); + Size2i ssize = style->get_minimum_size() + style->get_center_size(); - if (orientation==VERTICAL) { + if (orientation == VERTICAL) { - style->draw(get_canvas_item(),Rect2( (size.x-ssize.x)/2,0,ssize.x,size.y )); + style->draw(get_canvas_item(), Rect2((size.x - ssize.x) / 2, 0, ssize.x, size.y)); } else { - style->draw(get_canvas_item(),Rect2( 0,(size.y-ssize.y)/2,size.x,ssize.y )); + style->draw(get_canvas_item(), Rect2(0, (size.y - ssize.y) / 2, size.x, ssize.y)); } } break; } } -Separator::Separator() -{ +Separator::Separator() { } - -Separator::~Separator() -{ +Separator::~Separator() { } HSeparator::HSeparator() { - orientation=HORIZONTAL; + orientation = HORIZONTAL; } VSeparator::VSeparator() { - orientation=VERTICAL; + orientation = VERTICAL; } |