Commit graph

20 commits

Author SHA1 Message Date
FrHun
82d7934959 LibGUI: ScrollableContainerWidget GML autocomplete 2021-11-03 16:13:19 +01:00
thislooksfun
fc411695c7 LibGUI: Keep autocomplete open after applying 'layout: ' 2021-11-02 17:53:22 +01:00
thislooksfun
6c776d267a LibGUI: Remove unnecessary braces 2021-11-02 17:53:22 +01:00
thislooksfun
4e5bf5c138 LibGUI: Abstract out even more duplicated logic 2021-11-02 17:53:22 +01:00
thislooksfun
d4eef0f17d LibGUI: Abstract out and name repeated logic 2021-11-02 17:53:22 +01:00
thislooksfun
d73d044f2b LibGUI: Suggest classes when typing identifiers
We now suggest classes even if the line does not start with an @.
After all, we now have fuzzy matching, so why *shouldn't* "color"
match @GUI::ColorInput as well as background_color?
2021-11-02 17:53:22 +01:00
thislooksfun
22a955b2d7 LibGUI: Abstract out widget and layout class matching 2021-11-02 17:53:22 +01:00
thislooksfun
e1e856132c LibGUI: Don't suggest widgets inside layouts
Having a widget inside a layout is meaningless, so why suggest them in
the first place?
2021-11-02 17:53:22 +01:00
thislooksfun
e403796842 LibGUI: Abstract out some duplicated logic for suggesting properties
A lot of the code in this area is duplicated, which is not great. In
fact this also fixes a bug where suggested partially matched props
would include read-only properties, since that check had only been
added to one of the two loops.
2021-11-02 17:53:22 +01:00
thislooksfun
03b52e26f0 LibGUI: Use fuzzy matching for GML suggestions 2021-11-02 17:53:22 +01:00
thislooksfun
1a3ea0c892 LibGUI: Add myself to the copyright header 2021-11-02 17:53:22 +01:00
thislooksfun
49b4dfd6cd LibGUI: Suggest 'layout' even before the user starts typing 2021-11-02 17:53:22 +01:00
thislooksfun
8863fe5852 LibGUI: Remove unused check
This check was removed as it will now never trigger.

The completion has the suffix ': ' on it, and the key does not.
Therefore if the user has not yet typed the ':', it will not be equal,
and after they do the check on line 167 will fail so the entry won't be
in the list to begin with.
2021-11-02 17:53:22 +01:00
thislooksfun
9a70ae1593 LibGUI: Automatically append ': ' after autocompleted GML properties 2021-11-02 17:53:22 +01:00
thislooksfun
f8c98cbf55 LibGUI: Show autocomplete for Layout properties 2021-11-02 17:53:22 +01:00
thislooksfun
b0122744a6 LibGUI: Match layout classes even after you start typing
The previous commit fixed the issue with layout classes not being
suggested at all, but there was still another issue. Once you started
typing the class name a different suggester would take over and only
show widgets. This commit makes it so it still only suggests layouts
in that situation.

This, combined with the last commit, makes autocompleting layouts way
more discoverable and user-friendly. :^)
2021-11-02 17:53:22 +01:00
thislooksfun
f048d16be5 LibGUI: Correctly suggest layout classes
Previously when the GMLAutocompleteProvider was invoked just after the
'layout:' tag it would suggest nothing. This is because Layouts do not
inherit from Widget, so the two checks would always eliminate every
suggestion from the list. This patch makes it always suggest any
(registered) object that inherits from GUI::Layout.

This should make layouts more discoverable and easier to quickly use.
2021-11-02 17:53:22 +01:00
thislooksfun
989c111d65 LibGUI: Remove unnecessary curly braces
Not needed for the commit, but I always try to leave the code nicer
than I found it. :)
2021-11-02 17:53:22 +01:00
thislooksfun
c3b0b9057e LibCore+LibGUI: Make ObjectClassRegistration::construct() nullable
This lays the groundwork for allowing the registration of abstract
core objects, which will be needed for improved GML autocomplete.
2021-11-02 17:53:22 +01:00
Conor Byrne
2b5566d7cc LibGUI+Playground: Move GMLAutocompleteProvider to LibGUI 2021-07-29 11:33:16 +02:00
Renamed from Userland/DevTools/Playground/GMLAutocompleteProvider.cpp (Browse further)