add scrollcontainer hack for width

This commit is contained in:
hippoz 2022-07-26 01:06:19 +03:00
parent 533b6ebe91
commit 32524f01e2
Signed by: hippoz
GPG key ID: 7C52899193467641

View file

@ -1,5 +1,5 @@
#include "ScrollContainer.hpp"
#include "src/Styles.hpp"
#include "Styles.hpp"
#include <iostream>
#include <memory>
@ -11,6 +11,9 @@ void ScrollContainer::on_layout() {
m_target->rect().set_x(-m_scroll.x());
m_target->rect().set_y(-m_scroll.y());
// todo: doesn't work with horizontal scrolling
m_target->rect().set_min_width(rect().width());
m_target->rect().set_max_width(rect().width());
}
std::shared_ptr<Widget> ScrollContainer::make_target() {