Commit graph

3484 commits

Author SHA1 Message Date
Timothy Flynn
d8b14da380 Browser+Ladybird+LibWebView: Move some common functions to LibWebView
The implementations of handle_web_content_process_crash and
take_screenshot are exactly the same across Browser and Ladybird. Let's
reduce some code duplication and move them to LibWebView.
2023-05-17 19:47:05 +02:00
thankyouverycool
587c44cfbb FontEditor: Filter files by BitmapFont in FilePicker 2023-05-17 06:47:57 +02:00
thankyouverycool
a62f204b25 FontEditor: Show complete filename in error messages
And clean up Save and Open action code style.
2023-05-17 06:47:57 +02:00
thankyouverycool
19b8b9d187 FontEditor: Show recently opened files in File menu
And update GlyphEditorWidget on initialize(). Fixes Editor not showing
the new active glyph when loading recent fonts from a menu.
2023-05-17 06:47:57 +02:00
thankyouverycool
c10b1e3aea FontEditor: Add action text to Undo and Redo 2023-05-17 06:47:57 +02:00
Timothy Flynn
374284d0d8 Browser: Move screenshot context menu actions above inspector actions
Feels a bit more natural, at least to align with muscle memory from
other browsers.
2023-05-16 19:47:18 +02:00
Timothy Flynn
1df0a141af Browser: Add a context menu for video elements
This includes actions such as controlling play state, downloading the
video, and opening the video in a new tab.
2023-05-16 12:48:39 +02:00
Daniel Bertalan
fc003cd248 Userland: Silence or resolve new GCC 13 warnings
GCC 13 produces the following true positive warnings:
- `-Wredundant-move` when trying to move `result->tooltip()`, which
  is a const reference in `Assistant/main.cpp`
- `-Wuse-after-free` when freeing an environment variable before
  removing it from `s_malloced_environment_variables`
- `-Wdangling-pointer` when storing an AST node's `this` pointer to the
  interpreter's node stack in LibJS. This is not actually an issue, as
  it is popped when the scope ends, but GCC has no way of telling this.
2023-05-15 07:00:29 +02:00
Karol Kosek
bde96640ac Spreadsheet: Don't release the file buffer when importing CSV files
CSVImportDialogPage takes and holds a StringView meaning that the data
was dropped instantly and displayed garbage instead.
2023-05-15 06:55:41 +02: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
Caoimhe
8bcf5b72eb VideoPlayer: Use LibFileSystemAccessClient 2023-05-14 15:56:49 -06:00
Caoimhe
69396d4c4d VideoPlayer: Store video sizing mode in the configuration 2023-05-14 15:56:49 -06:00
Caoimhe
61add64f0f VideoPlayer: Pledge the "VideoPlayer" configuration domain 2023-05-14 15:56:49 -06:00
Ben Wiederhake
b23a0b409d SystemMonitor: Prefer Core::File, poll ProcessStatisticsReader correctly
The signature of Core::ProcessStatisticsReader::get_all changed, and
instead of requiring a pointer to an open file, it now needs a bool to
indicate whether usernames should be polled or not. `m_proc_all` was
always converted to `false` in `RefPtr::operator bool()`, so we were
missing usernames for a long time.
2023-05-14 13:46:57 +02:00
Fabian Dellwing
b01fcccbbd Userland+Base: Don't run NetworkSettings in elevated mode 2023-05-13 17:59:37 -06:00
Fabian Dellwing
24b1bdca27 NetworkSettings: Use helper script to write config
This change allows us to not run the app with elevated privileges.

It uses the Escalator to call a helper and passes the settings as
JsonObject to it.
2023-05-13 17:59:37 -06:00
Fabian Dellwing
27297d2817 Escalator: Major rework and enable forwarding of stdin/stdout
- Escalator now uses `posix_spawn` instead of `exec`
- Escalator is now able to forward stdin and stdout
- A few general changes to improve code quality
2023-05-13 17:59:37 -06:00
thankyouverycool
7fa8fae786 FontEditor: Allow application to launch without a font
Since LibFSAC requires a reified window before loading a font, it
makes sense to have a safe null state for the app.

This lets us stay alive after a failed file request on startup,
handle failure at any point during initialization, and claw back
memory from all our font RefPtrs.

A default startup font or none at all can now be set in FontEditor.ini
2023-05-13 12:53:49 +02:00
thankyouverycool
24046f9adf FontEditor: Let GlyphEditorWidget initialize a null BitmapFont
And remove public reference getters as there is no guarantee they are
nonnull.
2023-05-13 12:53:49 +02:00
thankyouverycool
0ad5e85163 LibGUI+Applications: Let GlyphMapWidget initialize a null Font
FontEditor will need to clear references to its mutable font in
the future while CharacterMap has no use for the highlights clone,
so let's convert GlyphMapWidget's set_font wrapper into a separate
initialize function for the editor and stop hiding the base function
for others. Setting font null in either ultimately points the map to
the system's default font.
2023-05-13 12:53:49 +02:00
thankyouverycool
cf4ddd1dcf FontEditor: Move common restoration work into restore_state() 2023-05-13 12:53:49 +02:00
thankyouverycool
c7eee16292 FontEditor: Use resultant FSAC filename when Saving-as
Fixes desync between file and title.
2023-05-13 12:53:49 +02:00
thankyouverycool
a0f160bfc4 FontEditor: Use fallible {Input,Message}Boxes
And replace DeprecatedString and fix misnamed argument in show_error()
2023-05-13 12:53:49 +02:00
thankyouverycool
6212e5b1f0 FontEditor: Don't crash on missing icons
Instead of crashing on failed icon loading with TRY(), let's report
missing but non-critical resources in detail and gracefully move on.
2023-05-13 12:53:49 +02:00
thankyouverycool
ea8bcb2f30 FontEditor: Rename m_edited_font => m_font and remove getter
Pithier and it matches the naming convention used in FontEditor's
child widgets. Since it was never used outside MainWidget and there
will soon be no guarantee that m_font is nonnull, the public
BitmapFont& getter has also been removed.
2023-05-13 12:53:49 +02:00
thankyouverycool
1ee78c40ae FontEditor: Remove unnecessary call to hide() NewFontDialog
This workaround has not been needed since 5c92397
2023-05-13 12:53:49 +02:00
thankyouverycool
e2762d8956 FontEditor: Remove unnecessary setters and getters
As these were only used internally, let's simplify things and prevent
potential desync between widget state and saved settings by moving the
logic into their respective actions.
2023-05-13 12:53:49 +02:00
thankyouverycool
e8f2192aca FontEditor: Remove unnecessary deferred invokes
Since moving initialization out of the constructor and recalculating
GlyphMap's content size on range and font changes, these deferrals are
no longer needed.
2023-05-13 12:53:49 +02:00
thankyouverycool
3264b5cab2 FontEditor: Make update_title() private 2023-05-13 12:53:49 +02:00
thankyouverycool
ed3f9347f3 FontEditor: Tighten lambda captures 2023-05-13 12:53:49 +02:00
thankyouverycool
36641187d1 FontEditor: Propagate errors formatting preview text 2023-05-13 12:53:49 +02:00
thankyouverycool
5ec9654477 FontEditor: Propagate errors when loading GML 2023-05-13 12:53:49 +02:00
thankyouverycool
1a30439b11 FontEditor: Port some instances of DeprecatedString 2023-05-13 12:53:49 +02:00
thankyouverycool
0e276e0458 FontEditor: Iterate slope and weight lists by size() 2023-05-13 12:53:49 +02:00
thankyouverycool
2d2133b229 FontEditor: Convert Model lists to Vector<String>
And propagate errors while building them.
2023-05-13 12:53:49 +02:00
Caoimhe
99de0b2c14 HexEditor: Add list of recently opened files 2023-05-11 20:20:40 +01:00
Tim Ledbetter
cf4a43e4c0 Chess+GameSettings: Optionally highlight the king when in check
When either king is in check, its square is now highlighted with a red
background. This behavior can be toggled in GameSettings.
2023-05-10 12:13:35 +01:00
James Liu
f248f566b8 Help: Fix link to Contents page 2023-05-10 09:13:07 +01: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
Andreas Kling
15211cd753 Userland: Show "Ladybird" instead of "Browser" in titles, menus, etc
While the binary is still called "Browser" for now, let's make it clear
that we're converging on a single name for this application.
2023-05-09 06:12:09 +02:00
Karol Kosek
7e4db556eb ThemeEditor: Remove one usage of DeprecatedString
Up until 3d53dc8228, to_string(ColorRole)
returned char*, which prevented us from directly creating a String
class.
2023-05-06 16:12:11 +01:00
MacDue
bd0bf8250e PixelPaint: Use ValueSlider for radial gradient hardness
This makes this input consistent with the hardness properties of other
tools.
2023-05-06 08:03:02 +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
Tim Ledbetter
f132751fae PixelPaint: Ensure the selection is always within image bounds 2023-05-05 16:35:42 +01:00
Tim Ledbetter
ea0b527675 PixelPaint: Allow lasso tool to select outside the active layer
This makes the lasso tool behavior consistent with other selection
tools.
2023-05-05 16:35:42 +01:00
Tim Ledbetter
971a5467bf PixelPaint: Use the crosshair cursor with the lasso tool
This matches the behavior of other selection tools.
2023-05-05 16:35:42 +01:00
Caoimhe
5e4d835caf FontEditor: Use LibFileSystemAccessClient 2023-05-05 16:25:55 +01:00
Caoimhe
f663e2dbd1 FontEditor: Don't paint in GlyphEditorWidget if m_font is null
The font isn't set in the constructor, there may be a case where the
font hasn't loaded before the first paint event. Therefore, we should
not paint if the font is null. All other methods should be fine.
2023-05-05 16:25:55 +01:00
Cubic Love
248542535d Base+LibChess: Move assets from /icons/ to /graphics/
The graphics directory is a more suitable home for game assets.
2023-05-05 11:52:33 +01:00
Cubic Love
1d6f2e5608 Base+LibCards: Move card backs from /icons/ to /graphics/
The graphics directory is a more suitable home for game assets.
Also, move card backs into their own subfolder in preparation for a
themes subfolder for card fronts.
2023-05-05 11:52:33 +01:00
kleines Filmröllchen
0ab19dc4cd Piano: Allow per-track controls (again)
This makes Piano exactly as usable as when I started the large refactor
some years ago, which *sounds* like I'm a terrible person but now it (1)
looks nicer and (2) has a flexible backend that can already deal with
aribtrary kinds of processors on any track.
2023-05-05 01:32:09 +02:00
kleines Filmröllchen
d757027638 Piano: Use size_t for track count 2023-05-05 01:32:09 +02:00
MacDue
95c571ca53 PixelPaint: Make gradient tool hardness slider width match other inputs 2023-05-04 23:59:51 +02:00
MacDue
3a60ddc5a8 PixelPaint: Correct variable names in GradientTool.cpp
Previously these variables were all prefixed `size_`, but used for
the opacity value.
2023-05-04 23:59:51 +02:00
Joel Petersson
23bc306f99 SoundPlayer: Clear client buffer when playback is stopped
Previously we would not clear the client buffer of the
ConnectionToServer when playback was stopped. This would
cause old samples to be buffered and played when playback
was restarted.

With this commit we now perform this clearing of the client
buffer correctly.
2023-05-03 10:01:14 +02:00
Caoimhe
2adcf85d9d HexEditor: Remember all of the layout options in the configuration 2023-05-03 08:33:11 +01:00
Joel Petersson
e98315de6b SoundPlayer: Fix glitchy visualization on pause/stop
Previously when pausing or stoping a track in SoundPlayer,
the visualizations would glitch out. This was caused by them
being updated with the same buffer over and over.
With this patch a pause action will freeze the visualization at the
point of the pause and a stop action will reset the visualization
so it displays nothing until a track is started.
2023-05-02 09:15:20 +02:00
Joel Petersson
f1d8e55168 SoundPlayer: Introduce buffer_reset api to VisualizationWidget
Previously there was no way to clear the internal buffer in a
VisualizationWidget. These buffers are what determines how a
VisualizationWidget is rendered, so with this commit we are now
able to reset visualizations.
2023-05-02 09:15:20 +02:00
Andreas Kling
676e1c2cdc CertificateSettings: Add missing ellipsis on import/export buttons 2023-05-01 11:10:18 +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
4c9933bfb7 LibGUI: Remove Label icons and replace instances with ImageWidget
These icons are a relic of GLabel and were never implemented to
accomodate both image and text. This convenience can always be added
in the future, but no current instance assumes or needs it, so let's
replace them all with ImageWidget to show clearer intent.
2023-04-30 05:48:14 +02:00
thankyouverycool
91bafc2653 LibGUI+Userland: Port Labels to String 2023-04-30 05:48:14 +02:00
Tim Ledbetter
fd9b6878f6 PixelPaint: Clip the gradient tool preview to the active layer rect
This makes it easier to see what the result will be when using two
solid colors.
2023-04-30 00:24:06 +02:00
Abuneri
a04316403e Spreadsheet: Add blank sheet when import dialog is cancelled
If you launch the Spreadsheet app by clicking on a CSV
(or other supported formats) the import dialog is immediately
launched. If you cancel out of the import the application ends
up in an empty state where there are no sheets added. When you
launch the app normally it defaults to having a blank sheet, so
we should have the same behaviour in this scenario to prevent users
from having to manually add the new/blank sheet before being able to
use the app
2023-04-29 12:14:21 +01:00
huttongrabiel
8bc232e6be Spreadsheet: Enable the ability to undo/redo changes in cell color
Cells can be updated with new background/foreground colors and then this
action can be undone/redone.
2023-04-29 12:09:08 +01:00
huttongrabiel
7c204745ee Spreadsheet: Add CellUndoMetadataCommand class
Enables the ability to undo changes in metadata without undoing chages
in data. Previously there was only CellUndoData which cannot undo things
such as changes in cell background color.
2023-04-29 12:09:08 +01:00
huttongrabiel
40725c7c8c Spreadsheet: Add CellChange constructor for changes in type metadata
Allows the creation of CellChanges where the change is in the type
metadata instead of in data.
2023-04-29 12:09:08 +01:00
Torstennator
cd33f271b1 PixelPaint: Add radial gradient support
This patch adds radial gradients to the gradients tool.
2023-04-29 11:55:31 +01:00
Jelle Raaijmakers
cc35bab143 DisplaySettings: Show bilinear filtered wallpaper in MonitorWidget
After 7b10c8048c, this is probably more correct.
2023-04-27 21:17:11 +01:00
Jelle Raaijmakers
c7f651d526 DisplaySettings: Remove unused code from MonitorWidget 2023-04-27 21:17:11 +01:00
Timothy Flynn
61c0174fec Browser+Ladybird: Render text in the JS console with a monospace font 2023-04-26 15:43:57 +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
Andreas Kling
8e7d7b0ec2 LibCore: Remove some unnecessary includes from EventLoop.h 2023-04-25 14:48:40 +02:00
Andreas Kling
411d36719e LibCore: Simplify Core::Notifier by only allowing one event type
Not a single client of this API actually used the event mask feature to
listen for readability AND writability.

Let's simplify the API and have only one hook: on_activation.
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
Tim Ledbetter
2618639bdb Help: Ensure window title is updated when a subsection is selected 2023-04-25 02:16:48 -06:00
Sam Atkins
5f6dd87163 LibChess: Add and use Square::{file,rank}_char() methods
This saves us having to build and allocate a String, just to then use
one character of it.
2023-04-24 20:58:35 +02:00
Jonah
cf8875426d Browser: Support selections from the accessibility tab
You can now select elements and see their attributes in the bottom
panel like when navigating from the DOM tab.
2023-04-24 10:39:34 +02:00
Cameron Youell
e9ad7b8eed BrowserSettings: Convert BrowserSettingsWidget to a failable factory 2023-04-24 09:21:51 +02:00
Cameron Youell
2df0eeaa20 Browser: Convert BookmarksBarWidget to use failable functions 2023-04-24 09:21:51 +02:00
Cameron Youell
8134dccdc7 AK: Add new failable JsonArray::{append/set} functions
Move all old usages to the more explicit `JsonArray:must_{append/set}`
2023-04-24 09:21:51 +02:00
Daniel Bertalan
ff2fa72e28 LibCoredump+CrashReporter: Make CrashReporter work on AArch64
This commit implements printing out the AArch64 register file and
generating backtraces. Tested to work on the sshd port.
2023-04-23 14:30:59 +02:00
Timothy Flynn
8da0a34515 BrowserSettings: Propagate errors from creation of content filter widget 2023-04-22 12:32:40 +02:00
Timothy Flynn
8352417278 BrowserSettings: Slightly change text for adding a new content filter
Add an ellipsis to the button to add a new domain to indicate an action
must be taken after pressing the button. Shorten the label next to the
domain text box to be less overly verbose.
2023-04-22 12:32:40 +02:00
Timothy Flynn
d1ad513cb1 BrowserSettings: Port content filters to String 2023-04-22 12:32:40 +02:00
Timothy Flynn
5089766af6 Browser+Ladybird+LibWeb: Port content filters to String 2023-04-22 12:32:40 +02:00
Timothy Flynn
76ae60da15 Browser+Ladybird+LibWeb: Prevent infinite growth of content filters
We never clear content filters on either end of the Browser-WebContent
IPC connection. So when the filters change, we re-append all filters to
the Vector holding them. This incidentally makes it impossible to remove
a filter.

Change both sides to clear their filter lists when receiving a new set
of filters.
2023-04-22 12:32:40 +02:00
Timothy Flynn
a01ad58e91 Browser: Add support for CookieJar to run in a transient, in-memory mode
This is to allow running Ladybird without the SQL database for testing.
Primarily, this will let us set 'follow-fork-mode' to 'child' within GDB
to enter the WebContent process, rather than the SQLServer process. But
this is also handy for digging into cookie storage issues.
2023-04-21 07:56:14 +02:00
Karol Kosek
84a231d4e5 TextEditor: Propagate errors from MainWidget::initialize_menubar() 2023-04-20 17:02:23 +01:00
Karol Kosek
0b110c88ae PDFViewer: Propagate errors from PDFViewerWidget::initialize_menubar() 2023-04-20 17:02:23 +01:00
Karol Kosek
41cf3b741f HexEditor: Propagate errors from HexEditorWidget::initialize_menubar() 2023-04-20 17:02:23 +01:00
Karol Kosek
abe5787126 CharacterMap: Propagate errors from 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
dccd70385d LibGUI+Browser: Set menu names using the new String class 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
Timothy Flynn
fed2606591 Browser: Propagate autoplay settings to the WebContent process 2023-04-18 16:30:02 +02:00
Timothy Flynn
65283d6879 BrowserSettings: Add a tab to control the Browser's autoplay settings
This adds a checkbox to enable autoplay on all websites (disabled by
default) and a website list to enable autoplay on individual websites
(set to file:// URLs only by default).
2023-04-18 16:30:02 +02:00
thankyouverycool
5872fe6536 SpreadSheet: Use new InputBox features
Rename now uses a compact box and populates the editor with the
old name, and "Add new" now has a comfy icon. Both prevent empty
names.
2023-04-18 10:05:21 +02:00
thankyouverycool
bc8b409a3c FontEditor: Use compact InputBox for Go to Glyph action 2023-04-18 10:05:21 +02:00
thankyouverycool
8d86f2e69f Calculator: Use numeric InputBox for digit rounding and shrinking
Calc was using a bespoke SpinBox dialog which is no longer necessary.
2023-04-18 10:05:21 +02:00
thankyouverycool
14072ce8f0 FileManager: Use InputBox icons for file and directory creation
And set a window icon in desktop mode.
2023-04-18 10:05:21 +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
Brendan Kelly
8d0985ef01 SoundPlayer: Pledge "FileManager" config domain
This stops SoundPlayer from crashing when attempting to open a sound
file from inside the GUI
2023-04-17 10:34:40 +02:00
Tom
e758545b91 FileManager+LibGUI: Cache the FileSystem::can_delete_or_move value
Add the function FileSystemModel::Node::can_delete_or_move which will
cache the result of FileSystem::can_delete_or_move for a node. This
prevents having to make system calls repeatedly to obtain this
information.

Fixes #18399
2023-04-17 10:34:20 +02:00
thankyouverycool
55423b4ed0 LibGfx+Userland: Add width_rounded_up() helper 2023-04-15 15:24:50 +02:00
thankyouverycool
c9404c3a63 LibGUI+Userland: Convert MessageBox to fallible construction
Adds fallible versions of MessageBox's helper factories, ports
DeprecatedString, and rewrites build() to be both fallible and
more responsive to font changes.

MessageBox now auto shrinks and no longer has to re-build its
layout when text changes. It is manually resized once at
creation to position properly as a Dialog before being shown.
2023-04-15 15:24:50 +02:00
Tim Ledbetter
e144b477bd Assistant: Replace usages of adopt_ref() with make_ref_counted()
Let's be consistent with how we construct Result objects.
2023-04-15 09:02:01 +01:00
Tim Ledbetter
493fc65e42 Assistant: Do not log cancellation errors from FileProvider queries 2023-04-15 09:02:01 +01:00
Tim Ledbetter
4d4ac769c1 Assistant: Cache AppFile objects on AppProvider creation
This avoids unnecesarily recreating AppFiles on every query.
2023-04-15 09:02:01 +01:00
Tim Ledbetter
6ecff2ac28 Assistant: Avoid creating unnecessary FileResult objects
A BinaryHeap is now used to keep track of the 6 highest scoring files.
This ensures that a FileResult is not created for a result that will
never be displayed.
2023-04-15 09:02:01 +01:00
MacDue
5db1eb9961 AK+Everywhere: Replace URL::paths() with path_segment_at_index()
This allows accessing and looping over the path segments in a URL
without necessarily allocating a new vector if you want them percent
decoded too (which path_segment_at_index() has an option for).
2023-04-15 06:37:04 +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
Ethan Yeager
bf5a18babb PixelPaint: Correct gradient tool's position during preview 2023-04-14 13:42:45 +01:00
Brendan Kelly
7dd3c4a79c SoundPlayer: Check if loader is null
This patch prevents SoundPlayer from crashing when attempting to "seek"
when no file has been loaded
2023-04-14 07:13:32 -04:00
Zaggy1024
4df9ef487d VideoPlayer: Use rounded seconds for the timestamp label
Previously, the time would read "00:00:01" when the timestamp was
merely 1 millisecond past the start of the video. If a video does not
start with a sample at timestamp 0, then, seeking to the start would
display that text rather than "00:00:00".
2023-04-14 12:05:52 +01:00
Zaggy1024
79779aff18 VideoPlayer: Update the current timestamp on state changes
The state could change and cause a timestamp change without the video
frame event firing, which could desync the seek bar from the video's
actual time.
2023-04-14 12:05:52 +01:00
Matteo Benetti
3e1626acdc Spreadsheet+LibSyntax: Never insert spans directly
Function `CellSyntaxHighlighter::rehighlight()` direct inserted spans
to TextDocument `m_span` vector missing out important reordering and
merging operation carried out by `TextDocument::set_spans()`.

This caused overlapping spans for a cell with only a `=` symbol
(one for the actual token and one for the highlighting) to
miscalculate `start` and `end` value and a `length` value (of
`size_t` type) with a `0-1` substraction (result: 18446744073709551615)
causing `Utf32View::substring_view()` to fail the
`!Checked<size_t>::addition_would_overflow(offset, length)` assertion

This remove the possibility to directly alter `TextDocument`'s spans
thus forcing the utilization of `HighlighterClient::do_set_spans()`
interface function.

Proper refactor have been applied to
`CellSyntaxHighlighter::rehighlight()` function
2023-04-14 10:00:52 +02:00
Linus Groh
f345f72b55 LibJS: Port Value::to_object() to NonnullGCPtr 2023-04-14 09:59:29 +02:00
Tom
fe54a0ca27 WindowServer: Implement tile window overlay
This adds a tiling mode that will show a tile window overlay rather
than immediately tiling a window, triggering window resizes.
2023-04-13 20:18:49 +02:00
Tom
6f9c5b71fd WindowServer: Use enum class for Effects and ShowGeometry 2023-04-13 20:18:49 +02:00
Linus Groh
b84f8fb55b LibJS: Make intrinsics getters return NonnullGCPtr
Some of these are allocated upon initialization of the intrinsics, and
some lazily, but in neither case the getters actually return a nullptr.

This saves us a whole bunch of pointer dereferences (as NonnullGCPtr has
an `operator T&()`), and also has the interesting side effect of forcing
us to explicitly use the FunctionObject& overload of call(), as passing
a NonnullGCPtr is ambigous - it could implicitly be turned into a Value
_or_ a FunctionObject& (so we have to dereference manually).
2023-04-13 14:29:42 +02:00
Fabian Dellwing
93232d4e6d LibTLS: Streamline certificate loading
Some refactoring of our root ca loading process:

- Remove duplicate code
- Remove duplicate calls to `parse_root_ca`
- Load user imported certificates in Browser/RequestServer
2023-04-12 11:40:06 +03:30
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
Tim Ledbetter
994a861019 FileManager: Use a thousands separator for numbers in PropertiesWindow 2023-04-11 13:03:30 +02:00
Jelle Raaijmakers
be303facb8 3DFileViewer+Tubes: Add map_fixed to pledges
Both applications eventually reach LibGPU's loading of a dynamic library
(e.g. LibSoftGPU) which requires this pledge.

The pledge was always required, but went unchecked until 01318d8f9b.
2023-04-11 06:38:18 -04:00
Liav A
e931b2ecd9 SystemMonitor: Handle zombie processes properly
SystemMonitor had a bug in which it would crash in case there are zombie
processes left in the system.
The fix for this is to check if a process has no threads (which will
indicate that the process is a zombie and is waiting to be reaped), and
if that's the case, artificially create a thread row that is just enough
to represent the zombie process.
2023-04-10 11:25:01 -06:00
Cameron Youell
71e665f0f9 Settings: Improve default window size
Before, one icon was hidden slightly out of sight and there was a
scrollbar.
2023-04-09 21:35:34 -06:00
Cameron Youell
ef5cca71dc CertificateSettings: Update to be more consistent with other settings 2023-04-09 21:35:34 -06:00
Kemal Zebari
0060b8c4e5 Browser: Have BookmarksBarWidget signal bookmark changes for Tab
This fixes an issue with a tab not updating its bookmark button when
we either edit or delete a bookmark and the tab happens to be on the
same page associated with the bookmark URL. `BookmarksBarWidget`
"signals" a `Tab` object of any bookmark changes, where it will
update the bookmark button depending on if the current URL is an
existing bookmark or not.
2023-04-09 21:34:20 -06:00
Cameron Youell
58af4c85a4 KeyboardSettings: Port to Core::File 2023-04-09 20:58:54 -06:00
Cameron Youell
7734eba03f Piano+LibAudio: Port to Core::File 2023-04-09 20:58:54 -06:00
huttongrabiel
ad5abc9a8f DisplaySettings: Use FileSystemAccessServer instead of FilePicker
Make a call to the FileSystemAccessServer instead of using FilePicker to
select a new wallpaper in BackgroundSettings.
2023-04-09 18:19:57 -06:00
Timothy Flynn
3591a13e85 LibVideo+VideoPlayer: Convert playback event handler to callbacks
To pass events from LibVideo's PlaybackManager to interested parties, we
currently dispatch Core::Event objects that outside callers listen for.
Dispatching events in this manner rely on a Core::EventLoop. In order to
use PlaybackManager from LibWeb, change this mechanism to instead use a
set of callbacks to inform callers of events.
2023-04-09 23:55:05 +02:00
Ben Wiederhake
560133a0c6 Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
Cubic Love
f522178881 Base: Add icons for Assistant
Add 32px and 16px application icons for Assistant
2023-04-07 11:44:23 +01:00
stelar7
d527edf0ab LibTLS: Change Certificate parsing to use ErrorOr
Loads of changes that are tightly connected... :/
* Change lambdas to static functions
* Add spec docs to those functions
* Keep the current scope around as a parameter
* Add wrapping classes for some Certificate members
* Parse ec and ecdsa data from certificates
2023-04-06 09:57:31 +03:30
Fabian Dellwing
14d78e10d1 LibGUI+CertificateSettings: Use custom SortingProxy
The default SortingProxyModel does not allow to react to reodering.
As we would like to keep the column width on sorting, we create a
subclass and inject our code into the sorting method.
2023-04-03 19:58:47 -06:00
Fabian Dellwing
dfce65a0ab CertificateSettings: Add export functionality 2023-04-03 19:58:47 -06:00
Fabian Dellwing
7ce75ee3c5 CertificateSettings: Add import functionality 2023-04-03 19:58:47 -06:00
Fabian Dellwing
c273784c3e CertificateSettings: Create basic Cert Store application
This commit adds a new application named CertificateSettings that
houses our Cert Store. It should be expanded in the future.
2023-04-03 19:58:47 -06:00
Sam Atkins
b746d324cf Spreadsheet: Propagate errors from SpreadsheetWidget::initialize_menubar 2023-04-03 21:16:26 +02:00
Sam Atkins
1e275dd942 Spreadsheet: Add list of recently-opened files 2023-04-03 21:16:26 +02:00
Sam Atkins
5c76b63f79 PDFViewer: Add list of recently-opened files 2023-04-03 16:32:03 +02:00
Tim Ledbetter
3fa9c9bda4 PixelPaint: Update recent files list on project save
This is consistent with the behavior of other applications.
2023-04-03 07:13:27 +02:00
matcool
1bd8f4eb03 PixelPaint: Make Bloom use InplaceFilter instead of Filter
This change affects the filter preview widget, which would get the bloom
filter applied over the same bitmap, leading to an incorrect preview.
2023-04-03 07:13:13 +02:00
justus2510
2259ddf937 ImageViewer: Fix crash when setting wallpaper
When trying to set the wallpaper from the menu, ImageViewer would
crash because setting the wallpaper requires the program to pledge
to the WindowManager domain. This patch adds that pledge.
2023-04-03 07:11:28 +02:00
MacDue
df577b457a Browser: Add tooltip to reset zoom level button 2023-03-31 21:46:56 +01:00
sbcohen2000
9e21b3f216 KeyboardSettings: Add checkbox to enable Caps Lock mapping to Ctrl
This patch adds an additional control to KeyboardSettings allowing
the user to map Caps Lock to Ctrl. Previously, this was only possible
by writing to /sys/kernel/variables/caps_lock_to_ctrl.

Writing to /sys/kernel/variables/caps_lock_to_ctrl requires root
privileges, but KeyboardSettings will not attempt to elevate
the privilege of the user if they are not root. Instead, the
checkbox is rendered as un-editable.
2023-03-31 12:45:21 -04:00
Liav A
ba43ee4046 CrashReporter: Warn about malloc and free patterns in fault address
Warn the user about seemingly known malloc() and free() patterns in the
fault address.
This brings back the functionality that was removed recently in the
5416a37fde commit, but this time we detect
these patterns in userspace code and not in kernel code.
2023-03-31 12:09:06 +02:00
MacDue
b7f9b316ed Browser: Add reset zoom level button to toolbar
This button shows the current zoom level and when clicked resets
the zoom back to 100%. It is only displayed for zoom levels other
than 100%.
2023-03-29 07:17:35 +02:00
Kemal Zebari
c5542ea2c9 Browser: Remove unused variables in BookmarksBarWidget 2023-03-27 10:39:17 +01:00
MacDue
039d5edc6f Browser: Show current zoom level in view menu 2023-03-26 21:55:21 +01:00
Jelle Raaijmakers
256030da4e PixelPaint: Correctly set default layer name
Previously, if you confirmed the "new layer" dialog without any change
to the layer name, the layer would end up with an empty string for its
name.
2023-03-26 12:30:58 +01:00
Tim Ledbetter
30b3c30aba PixelPaint: Remove unused function definition from Image 2023-03-26 01:49:58 +01:00
Tim Ledbetter
8b4158633b PixelPaint: Use new String to format error messages 2023-03-26 00:47:29 +01:00
Tim Ledbetter
5b84fafbca PixelPaint: Include possible errno description in error messages
In the case where an error is created from an errno, calling
string_literal() will print nothing. Using Error's formatter
instead gives a more descriptive error message.
2023-03-26 00:47:29 +01:00
Tim Ledbetter
3faf089be5 PixelPaint: Add a Duplicate Layer action
The "Duplicate Layer" action inserts a copy of the selected layer into
the layer stack. The new layer is placed above the selected layer.
2023-03-26 00:44:26 +01:00
Tim Ledbetter
55feecee36 PixelPaint: Make wand tool work when layer and image rects differ
Previously, the position of the mask used to calculate the new
selection did not match the position of the active layer. The program
would crash when trying to set a mask pixel outside the bounds of the
active layer.
2023-03-26 00:21:29 +01:00
MacDue
3feddbf9da Run: Use Core::Process::spawn() to launch commands 2023-03-24 22:06:38 +00:00
MacDue
2aa8c9950e FileManager: Use GUI::Process::spawn_or_show_error() to open terminals 2023-03-24 22:06:38 +00:00
Cameron Youell
1dc3ba6ed5 Applications: Convert DeprecatedFile usages to LibFileSystem 2023-03-24 10:58:43 +00:00
Caoimhe
208e3f1978 ImageViewer: Use LibFileSystemAccessClient
This commit also starts the adoption of ErrorOr<T> and the String class
in ImageViewer. However, there is still a few more changes that could
be made.

Since the actions of using LibFSAC and using String in more places are
tightly coupled, I decided to put them in one commit.
2023-03-24 09:38:46 +00:00
Caoimhe
ac5f4792a8 ImageViewer: Fix crash when opening ImageViewer without an image
Seems like a thing which slipped through the cracks... We shouldn't try
to scale the image to the window's size if the bitmap doesn't exist.
2023-03-23 18:45:51 +00:00
Lucas CHOLLET
17eb77cf55 ImageViewer: Scale image to window on resize 2023-03-22 23:22:58 +01:00
Lucas CHOLLET
d8819c2d0e ImageViewer: Scale image to window on startup
We used to do the opposite, meaning that a huge images make the window
bigger than the screen. We now define a range for the window size and
scale the image if it doesn't fit un the current scope.
2023-03-22 23:22:58 +01:00
Lucas CHOLLET
c574b97246 ImageViewer: Scale image to window size on image change 2023-03-22 23:22:58 +01:00
Lucas CHOLLET
5cceae821d ImageViewer: Don't resize window on image rotation or flip 2023-03-22 23:22:58 +01:00
Lucas CHOLLET
fd0b809d54 Spreadsheet: Port to Core::File 2023-03-22 23:21:20 +01:00
Julian Offenhäuser
0d46c27741 PDFViewer: Create OutlineModel items with the correct pointer
This fixes a bug where we would construct a ModelIndex with a pointer to
NonnullRefPtr<OutlineItem>, instead of a pointer to the underlying
OutlineItem, which caused a crash later on when we would try to
dereference that pointer.
2023-03-22 22:56:24 +01: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
Kyle Lanmon
244ea0fa9c Presenter: Don't give a style value if there are no styles 2023-03-22 10:32:02 +01:00
Kyle Lanmon
fcda397136 Presenter: Support multiple frames per slide 2023-03-22 10:32:02 +01:00
Lucas CHOLLET
496b7ffb2b LibGfx: Move all image loaders and writers to a subdirectory 2023-03-21 22:39:25 +01:00
Cameron Youell
752f06f228 LibFileSystem: Move TempFile from LibCore to LibFileSystem
As suggested in commit de18485
2023-03-21 19:03:21 +00:00
Cameron Youell
1d24f394c6 Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
Timothy Flynn
f8b6369c23 WebContent+Everywhere: Add a WebContent IPC to activate a tab 2023-03-21 09:39:49 +00:00
Timothy Flynn
e6fc35897f WebContent+Everywhere: Add an option to not activate new tabs over IPC
WebDriver, for example, will want to create new tabs without activating
them.
2023-03-21 09:39:49 +00:00
Caoimhe
92800cff4a Presenter: Add a "Resize to Fit Content" action
When resizing, it can be hard to get the content to appear nicely
without a black border where the window's aspect ratio doesn't match the
content's aspect ratio.

With this new action, it is possible to automatically adjust the
window's size to match the content's aspect ratio. When it is resizing,
it will maintain the width of the window, but adjust the height to match
the aspect ratio of the content.
2023-03-21 10:10:29 +01:00
Caoimhe
72a45799e0 Presenter: Add a "View" menu
It didn't really make sense for "Toggle Full Screen" to be under
"Presentation", and now there's a place for any future view-related
actions.
2023-03-21 10:10:29 +01:00
Caoimhe
f2df495970 Presenter: Change "Full Screen" action to "Toggle Full Screen"
When using its keybind, it didn't really feel right to press Shift+F5 to
enter fullscreen, but not to exit it!
2023-03-21 10:10:29 +01:00
implicitfield
1eb6484ebd DisplaySettings: Detect if a non-default color scheme is in use 2023-03-21 10:06:41 +01:00
implicitfield
44b67db7ab DisplaySettings: Stop using DeprecatedString
This also further improves error propagation in cases where String
demands it.
2023-03-21 10:06:41 +01:00
implicitfield
9f2a396c6e DisplaySettings: Propagate errors in MonitorWidget 2023-03-21 10:06:41 +01:00
implicitfield
f1d1517414 DisplaySettings: Propagate errors in MonitorSettingsWidget 2023-03-21 10:06:41 +01:00
implicitfield
682bff4c49 DisplaySettings: Propagate errors in FontSettingsWidget 2023-03-21 10:06:41 +01:00
implicitfield
00be9eb210 DisplaySettings: Propagate errors in EffectsSettingsWidget 2023-03-21 10:06:41 +01:00
implicitfield
1c20cf7bee DisplaySettings: Propagate errors in BackgroundSettingsWidget 2023-03-21 10:06:41 +01:00
implicitfield
c95ec6092b DisplaySettings: Propagate errors in DesktopSettingsWidget 2023-03-21 10:06:41 +01:00
implicitfield
9c7dfd4fd4 DisplaySettings: Propagate errors in ThemesSettingsWidget 2023-03-21 10:06:41 +01:00
Junior Rantila
f0ceaca2f4 VideoPlayer: Add drag and drop support
This patch makes it so that we view clips by dropping them on an open
VideoPlayer window.
2023-03-21 08:45:58 +00:00
Sam Atkins
d0730c1c75 TextEditor: Remove confirmation when opening from recent files list
If the user has clicked to open a recent file, we don't need to ask them
again if they want to open it.
2023-03-20 09:04:38 +00:00
Caoimhe
23d31ac11d SoundPlayer: Keep track of the selected visualization in the config 2023-03-19 18:57:30 +00:00
Caoimhe
4c49e0f4a3 SoundPlayer: Move get_image_from_music_file to the advanced view 2023-03-19 18:57:30 +00:00
Caoimhe
87bfb47d1f FileManager: Extract .zip files to a temporary folder when opened
Prior to this commit, when you double-click a .zip file to open it, it
gets opened in Text-Editor as there is no other file association.

Now, when FileManager is invoked with a .zip file as the first argument,
a temporary directory will be created and the .zip will be extracted
into it. Once the FileManager window is closed, Core::TempFile will
delete the temporary directory.

This adds something like what we see in other operating systems' file
explorers, except for the fact that most other operating systems will
treat the .zip file as its own independent read-only filesystem. It
would be nice to do that in the future, but I feel like this is
sufficient for now.
2023-03-19 00:14:03 +00:00
Andreas Kling
72d817d4ea LibWeb+Browser+Ladybird: Add menu action to dump paint tree 2023-03-18 20:23:35 +01:00
Timothy Flynn
13dfadba79 LibJS: Propagate errors from VM creation 2023-03-17 16:39:08 +00:00
Kemal Zebari
3918a8492b Browser: Have the bookmark button use the editor dialog
Now when the bookmark button that has not yet bookmarked the current
URL is pressed, it will add the bookmark but also prompt the user
with the BookmarkEditor dialog in case they wish to make final
touches to their bookmark title or URL. If they cancel or escape
the dialog, the bookmark will be removed.
2023-03-17 13:43:11 +00:00