improve growing behavior of widgets

This commit is contained in:
hippoz 2022-10-15 14:51:58 +03:00
parent 805c9ff194
commit 002318c213
Signed by: hippoz
GPG key ID: 7C52899193467641
2 changed files with 3 additions and 2 deletions

View file

@ -149,7 +149,7 @@ private:
bool m_consumes_hits { false }; bool m_consumes_hits { false };
bool m_accepts_events { true }; bool m_accepts_events { true };
bool m_absolute { false }; bool m_absolute { false };
bool m_grows { true }; bool m_grows { false };
ControlWidgetType m_control_type { ControlWidgetType::Widget }; ControlWidgetType m_control_type { ControlWidgetType::Widget };
}; };

View file

@ -32,8 +32,9 @@ int main() {
auto list_view = main_widget->add<Raven::ListView>(); auto list_view = main_widget->add<Raven::ListView>();
auto content = main_widget->add<Raven::Widget>(); auto content = main_widget->add<Raven::Widget>();
auto content_layout = content->set_layout<Raven::ColumnLayout>(); auto content_layout = content->set_layout<Raven::BoxLayout>(Raven::Direction::Vertical);
content_layout->set_margin(6.0); content_layout->set_margin(6.0);
content_layout->set_spacing(6.0);
content->set_style(&Raven::raised_widget_style); content->set_style(&Raven::raised_widget_style);
auto selected_label = content->add<Raven::Label>("No selection"); auto selected_label = content->add<Raven::Label>("No selection");