diff options
Diffstat (limited to 'src/gui/Widget.cpp')
-rw-r--r-- | src/gui/Widget.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gui/Widget.cpp b/src/gui/Widget.cpp index 4baeff1..8732bd7 100644 --- a/src/gui/Widget.cpp +++ b/src/gui/Widget.cpp @@ -32,4 +32,34 @@ namespace gsr { parent_widget->remove_widget_as_selected_in_parent(); } } + + bool Widget::has_parent_with_selected_child_widget() const { + // TODO: Optimize since this is called in draw function in widgets + if(parent_widget) { + if(parent_widget->selected_child_widget) + return true; + return parent_widget->has_parent_with_selected_child_widget(); + } + return false; + } + + void Widget::set_horizontal_alignment(Alignment alignment) { + horizontal_aligment = alignment; + } + + void Widget::set_vertical_alignment(Alignment alignment) { + vertical_aligment = alignment; + } + + Widget::Alignment Widget::get_horizontal_alignment() const { + return horizontal_aligment; + } + + Widget::Alignment Widget::get_vertical_alignment() const { + return vertical_aligment; + } + + void Widget::set_visible(bool visible) { + this->visible = visible; + } }
\ No newline at end of file |