Add margin to Transform

This commit is contained in:
scorpion-26 2023-07-19 01:00:49 +02:00
parent 49a73063d5
commit 0a1a384e48
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_valign(m_Widget, Utils::ToGtkAlign(m_VerticalTransform.alignment));
gtk_widget_set_hexpand(m_Widget, m_HorizontalTransform.expand); gtk_widget_set_hexpand(m_Widget, m_HorizontalTransform.expand);
gtk_widget_set_vexpand(m_Widget, m_VerticalTransform.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) if (m_OnCreate)
m_OnCreate(*this); m_OnCreate(*this);

View file

@ -18,6 +18,10 @@ struct Transform
int size = -1; int size = -1;
bool expand = true; bool expand = true;
Alignment alignment = Alignment::Fill; Alignment alignment = Alignment::Fill;
// Left/Top
int marginBefore = 0;
// Right/Bottom
int marginAfter = 0;
}; };
enum class Orientation enum class Orientation