Commit Graph

15 Commits

Author SHA1 Message Date
Karol Kosek
70885a3dee LibGUI: Automatically scroll to a new column on adding it in ColumnsView 2022-12-30 17:16:29 +01:00
thankyouverycool
d938b9effe LibGUI+Applications: Rename automatic scrolling timer functions
Renames on_automatic_scrolling_timer_fired() =>
	automatic_scrolling_timer_did_fire()

The 'on_' prefix is usually reserved for AK::Function hooks.

Renames set_automatic_scrolling_{active,timer}() =>
	set_automatic_scrolling_timer_active()

For consistency, accuracy, and header file A E S T H E T I C S
2022-12-26 09:27:19 +01:00
MacDue
27fae78335 Meta+Userland: Pass Gfx::IntSize by value
Just two ints like Gfx::IntPoint.
2022-12-07 11:48:27 +01:00
MacDue
7be0b27dd3 Meta+Userland: Pass Gfx::IntPoint by value
This is just two ints or 8 bytes or the size of the reference on
x86_64 or AArch64.
2022-12-07 11:48:27 +01:00
thankyouverycool
8231bd9bc3 LibGUI: Add IncrementalSearchBanner
Compared to traditional modal search, incremental search begins
matching as soon as the user starts typing, highlighting results
immediately. This refactors Itamar's work for HackStudio into a
common LibGUI widget to be used in all multi-line TextEditors.
2022-11-29 15:39:13 +00:00
thankyouverycool
3c4a563415 LibGUI: Add Banner concept to AbstractScrollableWidget
Banners are abstract widgets which can house additional controls
and information on a temporary basis, popping in from the top of
their parent when needed.
2022-11-29 15:39:13 +00:00
thankyouverycool
d495405e53 LibGUI: Implement calculated_min_size() for AbstractScrollableWidget 2022-09-24 22:59:12 +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
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
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
Ben Wiederhake
b3e9a4e603 Libraries: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
2021-11-02 22:56:53 +01:00
Marcus Nilsson
d660e86d13 LibGUI: Implement automatic scrolling in AbstractView
This adds automatic scrolling when dragging items in TreeViews and other
widgets that inherit from AbstractView when the overloaded
accepts_drag() returns true. This is implemented in FileSystemModel to
allow directories and files to be dragged.
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
d47f15ab8b LibGUI: Rename ScrollableWidget => AbstractScrollableWidget 2021-05-03 21:03:13 +02:00