Commit graph

14 commits

Author SHA1 Message Date
MacDue
f743a8c00e LibGUI: Fix scrollbars not showing after updating content size
This fixes the scrollbars in not showing till after a resize in Browser
:^)
2022-07-01 23:58:08 +01:00
FrHun
fddd2bf6ff LibGUI: Add min_content_size debug property to AbstractScrollableWidget
This helps with debugging subclasses of AbstractScrollableWidget
2022-06-30 11:53:50 +02:00
FrHun
d0a418540e LibGUI: Fix flickering scrollbars in AbstractScrollableWidget
The new min_content_size value is to be set by the subclasses, it is
then used to determine if the scrollbars should be shown after a
resize, but before the content size will be calculated by the following
layout pass.
2022-06-30 11:53:50 +02:00
FrHun
68ad5f3780 LibGUI: Remove temporary compatibility measures for new layout system 2022-06-28 17:52:42 +01:00
FrHun
0d56d80514 LibGUI: Use new layout system in scrollable widgets
These changes are mainly nessecairy to remove dependence on the
temporary implicit conversions currently still in place.
2022-06-28 17:52:42 +01:00
FrHun
024305e742 LibGUI: Add UIDimension and UISize types
These types are used to represent size information for layouts.
They can hold integer (int) values ≥0 or special values like shrink
and fit.
2022-06-28 17:52:42 +01:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Lenny Maiorani
fe3b846ac8 Libraries: Use default constructors/destructors in LibGUI
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-12 14:44:43 -08:00
Dmitry Petrov
1662213737 Userland: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
Elyse
d53e1fa1fa Everywhere: Use 'increase_slider_by()' method from AbstractSlider
This method help us to avoid repeating the pattern
'set_value(value() + delta)'.
2021-12-30 14:31:50 +01:00
FrHun
dab7ec190e LibGUI: Margins for AbstractScrollableWidget
Implement, and use internally, content_margins() from Widget.
Since AbstractScrollableWidget already has a method called content_size,
the convenience method, with the same name, in Widget has to be
explicitly called.
2021-11-03 16:13:19 +01:00
Marcus Nilsson
53cfc6ec9f LibGUI: Account for scrollbar width when calculating autoscroll delta 2021-09-29 23:58:55 +02:00
Marcus Nilsson
eec411c508 LibGUI: Add a AutoScroll timer to AbstractScrollableWidget
This commit adds a timer to AbstractScrollableWidget that can be used
when implementing automatic scrolling. By overriding
on_automatic_scrolling_timer_fired() we can calculate the scrolling
delta when dragging objects, and redraw as needed. A helper function,
automatic_scroll_delta_from_position() gives us a delta that
we can use to calculate speed and direction. By default
m_autoscroll_threshold is 20 pixels from the edge, and gives a linear
change in scroll delta.
2021-09-16 22:29:21 +02:00
Andreas Kling
f7de453716 LibGUI: Rename ScrollableWidget.cpp => AbstractScrollableWidget.cpp 2021-05-04 14:38:43 +02:00
Renamed from Userland/Libraries/LibGUI/ScrollableWidget.cpp (Browse further)