Commit graph

1112 commits

Author SHA1 Message Date
Shannon Booth
c60150da15 HackStudio: Use StringView in DiffViewer::draw_line 2023-06-26 19:26:34 +02:00
Shannon Booth
23df5748f6 LibDiff: Make Diff::parse_hunks fallible
Currently the only error that can happen is an OOM. However, in the
future there may be other errors that this function may throw, such as
detecting an invalid patch.
2023-06-26 19:26:34 +02:00
Sam Atkins
ae6bde6847 GMLPlayground: Add a Statusbar 2023-06-17 20:36:03 +02:00
Karol Kosek
4b169cf25f LibGUI+Userland: Use action text as a fallback in Action::status_tip()
Many applications already do this in their code. This change will simply
move the logic to a single function to stop repeating ourselves!
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
Sam Atkins
f33824d2e9 LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
Hendiadyoin1
3d1fd17f8b SQLStudio: Stop lying about string types 2023-06-13 01:49:02 +02:00
Karol Kosek
27011cf55d LibFSAC+Userland: Pass options for FSAC::open_file() using a struct
It was rather inconvenient having to specify all arguments if you wanted
to modify only the last one.
2023-06-11 09:40:17 +01:00
Ben Wiederhake
f20d04726a LibFileSystem+Everything: Remove resolve_executable_from_environment 2023-06-06 23:46:36 +02:00
Ben Wiederhake
00bd443d1c UserspaceEmulator: Prefer FileSystem over DeprecatedFile 2023-06-06 23:46:36 +02:00
Liav A
aaa1de7878 Kernel: Move {Virtual,Physical}Address classes to the Memory directory 2023-06-04 21:32:34 +02:00
Caoimhe
617edafbf2 LibGUI: Add support for jumping to a line and column in TextEditor
We had support for going to a specific line before, but now we support
jumping around using the `line:column` format :^)
2023-06-01 06:26:40 +02:00
Ben Wiederhake
f07ac8f20a HackStudio: Prefer FileSystem over DeprecatedFile
This also straightens out the logic to determine the project_path.
Instead of calling realpath on potentially-null strings and sometimes
not even reading the result, we now only make these calls when required,
and properly handle any error.
2023-05-27 17:30:55 +02:00
kleines Filmröllchen
213025f210 AK: Rename Time to Duration
That's what this class really is; in fact that's what the first line of
the comment says it is.

This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
2023-05-24 23:18:07 +02:00
Jelle Raaijmakers
f391ccfe53 LibGfx+Everywhere: Change Gfx::Rect to be endpoint exclusive
Previously, calling `.right()` on a `Gfx::Rect` would return the last
column's coordinate still inside the rectangle, or `left + width - 1`.
This is called 'endpoint inclusive' and does not make a lot of sense for
`Gfx::Rect<float>` where a rectangle of width 5 at position (0, 0) would
return 4 as its right side. This same problem exists for `.bottom()`.

This changes `Gfx::Rect` to be endpoint exclusive, which gives us the
nice property that `width = right - left` and `height = bottom - top`.
It enables us to treat `Gfx::Rect<int>` and `Gfx::Rect<float>` exactly
the same.

All users of `Gfx::Rect` have been updated accordingly.
2023-05-23 12:35:42 +02:00
thankyouverycool
02d94a303c Base+Userland: Apply Human Interface Guidelines to Object text
Corrects a slew of titles, buttons, labels, menu items and status bars
for capitalization, ellipses and punctuation.

Rewords a few actions and dialogs to use uniform language and
punctuation.
2023-05-23 05:59:49 +02:00
Ben Wiederhake
f9a24eb7eb LibCore: Migrate Command from Deprecated{File,String}
This gives us free error-propagation in Core::command(...) and
HackStudio::ProjectBuilder::for_each_library_dependencies.

The comment about "String will be in the null state" has been misleading
for a long time, so it is removed.
2023-05-19 23:31:20 +02:00
Ben Wiederhake
9f820fa2c5 HackStudio: Prefer FileSystem::copy_file_or_directory 2023-05-19 21:12:15 +02:00
Timothy Flynn
d1a1b1ab75 LibWebView: Remove the DumpLayoutTree program
This program's purpose is now achieved with headless-browser, which has
the added benefit of being runnable outside of Serenity.
2023-05-16 13:22:23 -07:00
Sam Atkins
f3fe9b64bf GMLPlayground: Keep view_frame_action around to prevent a crash
The `view_frame_action` variable only exists for the duration of
`initialize_menubar()`, so calling it in `m_preview_window->on_close`
would crash. This fixes that by storing the action pointer inside
MainWidget. (And storing the `view_window_action` too because it felt
weird storing one and not the other.)
2023-05-16 18:37:32 +01:00
Karol Kosek
e02cbd9daa GMLPlayground: Make 'Open' action start in the Application source folder
Font Editor and Theme Editor already open the dialog in system folders
(/res/fonts and /res/themes). To be fair, they do have a special folder
just for their files, but I think this is good enough if you want to
start hacking an app :^)

Additionaly, this also adds a filter to show only .gml files by default.
2023-05-16 12:57:34 +01:00
Karol Kosek
8dcfb6bfbd GMLPlayground: Reuse request_close() in 'Open' and recent files actions 2023-05-16 12:57:34 +01:00
Karol Kosek
e7954f62b3 GMLPlayground: Use current file name in the 'Save as...' dialog
Previously it was always "Untitled".
2023-05-16 12:57:34 +01:00
Karol Kosek
23ac52bc80 GMLPlayground: Use try_make for syntax highlighting and autocomplete 2023-05-16 12:57:34 +01:00
Karol Kosek
477ee34215 GMLPlayground: Set parent window for preview window
Closing the main window didn't close the preview window along with it.
2023-05-16 12:57:34 +01:00
Karol Kosek
94f408097a GMLPlayground: Remove one DeprecatedString usage 2023-05-16 12:57:34 +01:00
Karol Kosek
5fd4d34880 GMLPlayground: Handle drop events 2023-05-16 12:57:34 +01:00
Karol Kosek
8c00e57f56 GMLPlayground: Extract most logic into a MainWidget class 2023-05-16 12:57:34 +01:00
Karol Kosek
3c13faff57 GMLPlayground: Set file path when reading file
We weren't setting the path on the 'Open' action, which meant that a
startup file name was always visible in the title bar (unless we save a
file to a different path, or pick a file from the 'recent files' list).

By setting it to update the stored file path in the load_file()
function, it'll be guaranteed the file name will always be set.

This also will add the startup opened file to the recently opened files
list.
2023-05-16 12:57:34 +01:00
Karol Kosek
b7558a5ce4 LibGUI+Userland: Store column names in JsonArrayModel as String 2023-05-15 06:42:10 +02:00
Karol Kosek
945f05ed76 Userland: Port Model::column_name() to String 2023-05-15 06:42:10 +02:00
Ben Wiederhake
88334f67be HackStudio: Prefer FileSystem over DeprecatedFile 2023-05-13 17:04:05 +02:00
Lucas CHOLLET
8c34959b53 AK: Add the Input word to input-only buffered streams
This concerns both `BufferedSeekable` and `BufferedFile`.
2023-05-09 11:18:46 +02:00
Maciej
cf52542fcf LibMarkdown+LibSyntax: Add a Markdown syntax highlighter
It currently supports only headers and code blocks.
2023-05-05 17:08:40 +01:00
Lucas CHOLLET
1a97382305 LibGUI: Make Application's construction fallible
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.

This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.

From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
2023-05-05 16:41:21 +01:00
iyush
a268dcb1e2 HackStudio: Move around execution order and prevent crashing
Previously hackstudio tried to synchronize the language server before
executing the command inside the editor.  If sync-command for the server
(for example the CommentLineCommand) is not implemented inside the
function responsible for syncing the language server, the IDE would
crash.

This patch makes it such that the synchronization happens only after IDE
executes the command locally.  If such command is not implemented (as
was the case earlier), it would simply reupdate the content inside the
language server. Even though the reupdate might be expensive, it is
better than crashing hackstudio altogether.

Because of reordering, the relevant function names have been changed to
better reflect the code flow.
2023-04-30 06:08:22 +02:00
thankyouverycool
f7e034d4b2 LibGfx+Userland: Merge FrameShape and FrameShadow into FrameStyle
Previously, Frames could set both these properties along with a
thickness to confusing effect: Most shapes of the same shadowing only
differentiated at a thickness >= 2, and some not at all. This led
to a lot of creative but ultimately superfluous choices in the code.

Instead let's streamline our options, automate thickness, and get
the right look without so much guesswork.

Plain shadowing has been consolidated into a single Plain style,
and 0 thickness can be had by setting style to NoFrame.
2023-04-30 05:49:46 +02:00
thankyouverycool
91bafc2653 LibGUI+Userland: Port Labels to String 2023-04-30 05:48:14 +02:00
Ali Mohammad Pur
7e6341587b AK+Everywhere: Disallow Error::from_string_view(FooString)
That pattern seems to show up a lot in code written by people that
aren't intimately familiar with the lifetime model of Error and Strings.
This commit makes the compiler detect it and present a more helpful
diagnostic than "garbage string at runtime".
2023-04-28 05:55:20 +02:00
Andreas Kling
c756e021a7 Userland: Remove "Inspector" program and related utilities
This program has never lived up to its original idea, and has been
broken for years (property editing, etc). It's also unmaintained and
off-by-default since forever.

At this point, Inspector is more of a maintenance burden than a feature,
so this commit removes it from the system, along with the mechanism in
Core::EventLoop that enables it.

If we decide we want the feature again in the future, it can be
reimplemented better. :^)
2023-04-25 14:48:40 +02:00
Tim Ledbetter
05c8aa71f2 Applications: Update man page links for applications
This commit updates all application man page links to point to the
Applications subdirectory.
2023-04-25 02:16:48 -06:00
Cameron Youell
ba38984a60 SQLStudio: Convert MainWidget to a failable constructor 2023-04-24 09:21:51 +02:00
Karol Kosek
83af64f053 SQLStudio: Propagate errors from MainWidget::initialize_menubar() 2023-04-20 17:02:23 +01:00
Karol Kosek
51bd9ca037 LibGUI+Userland: Make Menu::*add_submmenu take name using new string 2023-04-19 07:59:54 +02:00
Karol Kosek
969543a847 LibGUI+Userland: Make Window::*add_menu take name using new string 2023-04-19 07:59:54 +02:00
Karol Kosek
956f4d9205 Userland: Construct Menus with name using the non-deprecated String 2023-04-19 07:59:54 +02:00
thankyouverycool
02a9e5d3f6 LibGUI+Userland: Improve error and font handling for InputBox
Adds fallible factories, ports DeprecatedString, and rebuilds the
layout to accomodate system font changes.
2023-04-18 10:05:21 +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
iyush
cc301f9861 HackStudio: Set_cursor even if the file is already open
Upon opening already opened file, the cursor was previously not
set to the correct line and column. With this patch, it should
be correctly set.

Fixes a bug where ctrl+clicking a function declaration would not
jump to the line if the file containing the function is already
open.
2023-04-13 09:52:33 +02:00
Tim Ledbetter
0829101eb8 Applications: Use thousands separator for numbers shown in status bar
TextEditor, HackStudio and SQLStudio now print the current line and
column number, as well as the number of currently selected words, with
thousands separators.

TextEditor also uses thousands seperators for the current word and
character count.
2023-04-12 09:03:01 +02:00