diff --git a/src/Widget.cpp b/src/Widget.cpp index f69e1ac..dd18b32 100644 --- a/src/Widget.cpp +++ b/src/Widget.cpp @@ -173,6 +173,10 @@ void Widget::ApplyPropertiesToWidget() gtk_widget_set_valign(m_Widget, Utils::ToGtkAlign(m_VerticalTransform.alignment)); gtk_widget_set_hexpand(m_Widget, m_HorizontalTransform.expand); gtk_widget_set_vexpand(m_Widget, m_VerticalTransform.expand); + gtk_widget_set_margin_start(m_Widget, m_HorizontalTransform.marginBefore); + gtk_widget_set_margin_end(m_Widget, m_HorizontalTransform.marginAfter); + gtk_widget_set_margin_top(m_Widget, m_VerticalTransform.marginBefore); + gtk_widget_set_margin_bottom(m_Widget, m_VerticalTransform.marginAfter); if (m_OnCreate) m_OnCreate(*this); diff --git a/src/Widget.h b/src/Widget.h index bfb2e95..30b9a51 100644 --- a/src/Widget.h +++ b/src/Widget.h @@ -18,6 +18,10 @@ struct Transform int size = -1; bool expand = true; Alignment alignment = Alignment::Fill; + // Left/Top + int marginBefore = 0; + // Right/Bottom + int marginAfter = 0; }; enum class Orientation