Commit Graph

47 Commits

Author SHA1 Message Date
Tim Ledbetter
a6f6a1afd2 Userland: Prefer non-fallible construction for LibGUI objects 2023-09-18 18:00:45 +02:00
Tim Ledbetter
ccab5ddf9b LibGUI+Applications: Use String in make_about_action() 2023-09-16 11:05:49 +02:00
Sam Atkins
aae7905369 Applications: Use native style sheet for WebViews where appropriate 2023-08-25 20:30:20 +01:00
thankyouverycool
57f3b18109 LibGUI+Userland: Remove Toolbar::try_add_{action,separator}()
These calls largely occur during initialization before there's
unsaved state worth preserving
2023-08-15 15:56:34 +02:00
Andreas Kling
bd61e75e0b LibGUI: Remove Window::try_add_menu()
And fall back to the infallible add_menu().
2023-08-14 14:57:54 +02:00
Andreas Kling
f2faf2767f LibGUI: Remove Menu::try_add_action()
And fall back to the infallible add_action().
2023-08-14 14:57:54 +02:00
Andreas Kling
1525fa3b8f LibGUI: Remove Menu::try_add_separator()
And fall back to the infallible add_separator().
2023-08-14 14:57:54 +02:00
kleines Filmröllchen
8ec9b26bba Help: Use new GML code generator 2023-08-11 21:33:48 +02:00
Lucas CHOLLET
3f35ffb648 Userland: Prefer _string over _short_string
As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
2023-08-08 07:37:21 +02:00
Andreas Kling
34344120f2 AK: Make "foo"_string infallible
Stop worrying about tiny OOMs.

Work towards #20405.
2023-08-07 16:03:27 +02:00
Karol Kosek
65a927d16e Help: Clear statusbar when leaving link 2023-06-15 13:53:22 +01:00
Karol Kosek
2029750519 LibGUI+Userland: Port StatusBar::text() and set_text functions to String 2023-06-15 13:53:22 +01:00
Hendiadyoin1
a45682dcdc Applications: Stop lying about string types 2023-06-13 01:49:02 +02:00
Tim Ledbetter
8bb6a820e2 Help: Sort search results by score
This makes pages with matching titles appear at the top of the search
results.
2023-05-29 10:47:48 -06:00
James Liu
f248f566b8 Help: Fix link to Contents page 2023-05-10 09:13:07 +01:00
Karol Kosek
969543a847 LibGUI+Userland: Make Window::*add_menu take name using new string 2023-04-19 07:59:54 +02:00
MacDue
35612c6a7f AK+Everywhere: Change URL::path() to serialize_path()
This now defaults to serializing the path with percent decoded segments
(which is what all callers expect), but has an option not to. This fixes
`file://` URLs with spaces in their paths.

The name has been changed to serialize_path() path to make it more clear
that this method will generate a new string each call (except for the
cannot_be_a_base_url() case). A few callers have then been updated to
avoid repeatedly calling this function.
2023-04-15 06:37:04 +02:00
Andreas Kling
26a4e4d23d Help: Don't abort opening help:// URLs when error *didn't* occur
Fixes #14158
2023-03-22 13:07:57 +01:00
Mathis Wiehl
f276e70ac9 Help: Don't defer tree view selection updates
It is unsafe to defer this selection update, because ::open_url itself
is called when users make selection updates, creating a race.

This fixes and infinite selection change loop one could easily reproduce
by holding an up or down arrow key in the tree view while clicking on a
tree view item a couple of times.
2023-03-07 09:50:50 +01:00
Linus Groh
09d40bfbb2 Everywhere: Use _{short_,}string to create Strings from literals 2023-02-25 20:51:49 +01:00
Tim Schumacher
d43a7eae54 LibCore: Rename File to DeprecatedFile
As usual, this removes many unused includes and moves used includes
further down the chain.
2023-02-13 00:50:07 +00:00
Tim Schumacher
82a152b696 LibGfx: Remove try_ prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit
it.
2023-01-26 20:24:37 +00:00
Tim Ledbetter
61074b6b5c Help: Update browse view when opening a new help page
The browse view now always tracks the currently open help page.
2023-01-09 09:55:02 +01:00
Sam Atkins
f0395a2042 LibGUI+Userland: Rename try_load_from_gml() -> load_from_gml() :^)
It's the only one, so the `try` prefix is unnecessary now.
2023-01-07 14:39:30 +01:00
Sam Atkins
54b1326165 Userland: Replace all uses of load_from_gml with try_load_from_gml
MOAR FIXMES! ;^)
2023-01-07 14:39:30 +01:00
kleines Filmröllchen
3cecd612ba Help: Don't expand the whole tree of the selected node's parent
This now expands nodes unnecessarily with nested sections.
2023-01-02 06:15:13 -07:00
kleines Filmröllchen
2aa374eba1 Help+LibManual: Move URL handling to LibManual 2023-01-02 06:15:13 -07:00
Maciej
8c082869d0 Help: Move-capture help page path
Previously it was reference-captured, causing crash because of stack
use after return.
2022-12-14 15:06:38 +00:00
kleines Filmröllchen
5a346c4297 Help+LibManual: Without arguments, open index page instead of crashing
This is the old behavior before the recent LibManual refactor. It also
moves the definition of the index page into LibManual for better reuse.
2022-12-12 00:37:29 -07:00
kleines Filmröllchen
b65258c093 Help+man+LibManual: Move argument handling to LibManual
This deduplicates argument handling logic from Help and man and makes it
more modular for future use cases. The argument handling works as
before: two arguments specify section and page (in this order), one
argument specifies either a page (the first section that it's found in
is used) or a path to a manpage markdown file.
2022-12-11 16:05:23 +00:00
kleines Filmröllchen
a438c4d568 Help+LibManual: Move all manpage path handling to LibManual
This way, we'll have an easier time changing these paths.
2022-12-11 16:05:23 +00:00
kleines Filmröllchen
4625f7aab5 LibManual: Refactor SectionNode in preparation for subsections
- Calculate the full name on demand
- Make section and name protected
- Reorder some members logically
- Change the name getter to be fallible, as some implementors need to
  allocate
2022-12-11 16:05:23 +00:00
kleines Filmröllchen
ad6a55e1f0 Help+LibManual: Move non-UI-specific manual handling to LibManual
This is a first step in deduplicating code within and across Help and
man.

Because LibManual also doesn't contain any DeprecatedString, some
adjustments to Help's string handling is included, just to interoperate
with LibManual better. Further work in this area mostly requires String
APIs in LibGUI.
2022-12-11 16:05:23 +00: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
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01: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
demostanis
34acae90c7 Userland: Let applications make use of make_command_palette_action() 2022-10-25 10:21:18 +01:00
networkException
4230dbbb21 AK+Everywhere: Replace "protocol" with "scheme" url helpers
URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.

See https://url.spec.whatwg.org/#concept-url-scheme
2022-09-29 09:39:04 +01:00
networkException
7a2bef7fe1 Help: Make history navigation work with man pages opened using help urls
This patch implements man pages opened using the help url protocol
properly getting added to the navigation history as well as enabling
the back and forward buttons in such cases.
2022-07-22 23:06:54 +01:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
Lucas CHOLLET
0c2dc6be66 Help: Use LibWeb to open files via RequestServer 2022-06-27 20:22:15 +01:00
DexesTTP
dcbbbf5b4a LibWebView: Move OutOfProcessWebView to a new LibWebView library
Also moves WebContentClient and the references to the generated IPC
descriptions, since they are all components of OutOfProcessWebView.

This patch has no functional changes.
2022-05-15 12:17:36 +02:00
ForLoveOfCats
85152d2f7f LaunchServer+Help: Open help urls with Help 2022-04-21 09:12:37 +04:30
kleines Filmröllchen
7e34b88ed4 LibGUI: Fully support TabWidget in GML
TabWidgets couldn't be used in GML properly, as the GML creation
routines didn't actually call the necessary functions in the TabWidget
to get a new tab added. This commit fixes that by making the name of the
tab a normal property, the previously introduced "title", which can be
trivially set from GML. Therefore, try_add_widget() loses an argument
(while try_add_tab doesn't, because it newly constructs the widget).
This allows us to get rid of the silly "fixing my widget tree after the
fact" code in Help and will make it super easy to use TabWidget in
future GML. :^)
2022-04-03 12:21:05 +02:00
kimlintu
a4e3ae0ee9 Help: Remove redundant selection update when opening page
Since the selection already gets updated in AbstractView::keydown_event
and AbstractView::mousedown_event we don't have to update it again in
the MainWidget::open_url function.

This fixes a bug that causes the selection to "spaz out" when
scrolling too fast between pages.
2022-03-08 23:34:45 +01:00
thankyouverycool
21ba9c808e Help: Improve search ergonomics
Up and down arrows now select search results. Matching index now
displays in full before filtering. Searching from the command
line focuses the query, and searches are now case insensitive.
2022-03-02 21:37:58 +01:00
thankyouverycool
8825abe7ed Help: Convert to GML and propagate more errors
Converts Help's layout to GML, propagates model and icon creation
errors, and switches to the MainWidget-namespace organization
pattern seen in more up-to-date apps like TextEditor to make things
easier to maintain going forward.
2022-03-02 21:37:58 +01:00