mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
LibGUI: Add min_content_size debug property to AbstractScrollableWidget
This helps with debugging subclasses of AbstractScrollableWidget
This commit is contained in:
parent
247e3ef6e7
commit
fddd2bf6ff
2 changed files with 14 additions and 0 deletions
|
@ -294,6 +294,18 @@ T* Object::find_descendant_of_type_named(String const& name) requires IsBaseOf<O
|
|||
[this] { return this->getter(); }, \
|
||||
{});
|
||||
|
||||
#define REGISTER_READONLY_SIZE_PROPERTY(property_name, getter) \
|
||||
register_property( \
|
||||
property_name, \
|
||||
[this] { \
|
||||
auto size = this->getter(); \
|
||||
JsonArray size_array; \
|
||||
size_array.append(size.width()); \
|
||||
size_array.append(size.height()); \
|
||||
return size_array; \
|
||||
}, \
|
||||
{});
|
||||
|
||||
#define REGISTER_RECT_PROPERTY(property_name, getter, setter) \
|
||||
register_property( \
|
||||
property_name, \
|
||||
|
|
|
@ -13,6 +13,8 @@ namespace GUI {
|
|||
|
||||
AbstractScrollableWidget::AbstractScrollableWidget()
|
||||
{
|
||||
REGISTER_READONLY_SIZE_PROPERTY("min_content_size", min_content_size);
|
||||
|
||||
m_vertical_scrollbar = add<AbstractScrollableWidgetScrollbar>(*this, Orientation::Vertical);
|
||||
m_vertical_scrollbar->set_step(4);
|
||||
m_vertical_scrollbar->on_change = [this](int) {
|
||||
|
|
Loading…
Add table
Reference in a new issue