Add margin to Transform

This commit is contained in:
scorpion-26 2023-07-19 01:00:49 +02:00
parent 342ff57ba7
commit ba366729fe
2 changed files with 8 additions and 0 deletions

View file

@ -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);

View file

@ -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