Commit graph

19 commits

Author SHA1 Message Date
Sam Atkins
703da34947 LibGUI: Create an alias for Widget UnregisteredChildHandler 2023-01-07 14:39:30 +01:00
Sam Atkins
fa98034ff7 LibGUI+Userland: Make GML unregistered_child_handler fallible 2023-01-01 09:55:05 -05:00
Sam Atkins
b32f5dbcff LibCore+LibGUI: Add fallible versions of Widget::load_from_gml()
The existing `load_from_gml()` methods look the same as before from the
outside. Inside though, they now forward to `try_load_from_gml()` which
returns Error when things go wrong. It also now calls the `try_create()`
factory method for Objects instead of the `construct()` one.
2023-01-01 09:55:05 -05:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Cameron Youell
4e3b965d7f LibGUI: Fix a typo 2022-12-05 13:59:00 +00:00
FrHun
247e3ef6e7 LibGUI: Add custom layout change handling to ScrollableContainerWidget 2022-06-30 11:53:50 +02: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
Karol Kosek
f505f1ab5e LibGUI: Try use layout's preferred size for the content size
Previously this was only done if the widget had shrink_to_fit property
enabled.
2022-05-11 20:24:57 +02:00
Karol Kosek
9156614de3 LibGUI: Always use widget's minimum size in ScrollableContainerWidget
I don't know if it makes much sense to use min_size and shrink_to_fit
at the same time, but it will make the code a bit cleaner later.
2022-05-11 20:24:57 +02:00
Karol Kosek
3e4f912479 LibGUI: Reuse common parts in ScrollableContainerWidget
No functional changes.
2022-05-11 20:24:57 +02:00
Karol Kosek
c6bcc0f96e LibGUI: Check if a property is a GML Object in ScrollableContainerWidget
Previously we couldn't set the content widget from GML because it was
looking for a GUI::Object, not a GML::Object.
2022-05-07 20:03:17 +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
kleines Filmröllchen
41ef4f11dc LibGUI: Move GML parsing and formatting to new AST
This commit introduces a couple of connected changes that are hard to
untangle, unfortunately:
- Parse GML into the AST instead of JSON
- Change the load_from_json API on Widget to load_from_gml_ast
- Remove this same API from Core::Object as it isn't used outside of
  LibGUI and was a workaround for the object registration detection;
  by verifying the objects we're getting and casting we can remove this
  constraint.
- Format GML by calling the formating APIs on the AST itself; remove
  GMLFormatter.cpp as it's not needed anymore.

After this change, GML formatting already respects comments :^)
2022-02-07 18:39:50 +01:00
FrHun
54f459e020 LibGUI: AbstractScrollableWidget GML/JSON 2021-11-03 16:13:19 +01:00
FrHun
7110afe9bf LibGUI: ScrollableContainerWidget respect size 2021-11-03 16:13:19 +01:00
FrHun
a59e9a7a81 LibGUI: ScrollableContainerWidget consider frame
Do not consider the space that is taken up by the frame, as useable
size.
2021-11-03 16:13:19 +01:00
Gunnar Beutner
eed6ce8b8b Profiler: Fix scrolling behavior
When resizing the timeline view the timelines should scroll to the
bottom when the resize operation reveals space that is beyond the
view.
2021-05-08 09:55:24 +02:00
Andreas Kling
18d344609f LibGUI: Add ScrollableContainerWidget :^)
This widget provides a scrollable view onto another (child) widget.
If the child is larger than the parent, scrollbars are provided for
panning around the child.
2021-05-05 22:17:33 +02:00