diff --git a/src/gui/widget.cpp b/src/gui/widget.cpp index 6349e802a..ae5c1fab4 100644 --- a/src/gui/widget.cpp +++ b/src/gui/widget.cpp @@ -679,6 +679,19 @@ void Widget::setBounds(const Rect& rc) jwidget_set_rect(this, &jrc); } +Border Widget::getBorder() const +{ + return Border(border_width.l, border_width.t, border_width.r, border_width.b); +} + +void Widget::setBorder(const Border& br) +{ + border_width.l = br.left(); + border_width.t = br.top(); + border_width.r = br.right(); + border_width.b = br.bottom(); +} + void jwidget_relayout(JWidget widget) { jwidget_set_rect(widget, widget->rc); diff --git a/src/gui/widget.h b/src/gui/widget.h index 9a2b0a9c0..f30307f50 100644 --- a/src/gui/widget.h +++ b/src/gui/widget.h @@ -10,6 +10,7 @@ #include #include "gfx/rect.h" +#include "gfx/border.h" #include "gui/component.h" #include "gui/jbase.h" #include "gui/jrect.h" @@ -243,6 +244,9 @@ public: gfx::Rect getBounds() const; void setBounds(const gfx::Rect& rc); + gfx::Border getBorder() const; + void setBorder(const gfx::Border& border); + // =============================================================== // REFRESH ISSUES // ===============================================================