Commit Graph

1574 Commits

Author SHA1 Message Date
Andreas Kling
1ded1ed963 Run: Port to LibMain :^) 2021-11-26 23:27:57 +01:00
Sam Atkins
377a984905 Settings: Make sure settings are listed in alphabetical order
DirectoryIterator, and so `Desktop::AppFile::for_each()`, doesn't
guarantee anything about the order, so we manually sort afterwards.
Which means using a manual version of NonnullRefPtrVector, since that
doesn't support `quick_sort()`.
2021-11-26 22:14:56 +01:00
Sam Atkins
705b7fc407 Browser: Allow custom search engine URLs that don't start http[s]:// 2021-11-26 22:14:56 +01:00
Sam Atkins
a1e1405f26 BrowserSettings: Add some icons for it :^) 2021-11-26 22:14:56 +01:00
Sam Atkins
c22b0bb8b2 Browser+Base: Delete provided Browser.ini file
Having files in Base's user `.config` folder means that every time the
Serenity image is built, all user settings in that file are thrown away.
So, let's not do that! :^)

Modified the default value for the homepage url to match what was in
Browser.ini, so there is no visible change.
2021-11-26 22:14:56 +01:00
Sam Atkins
e84b3e7110 BrowserSettings: Implement restoring default values 2021-11-26 22:14:56 +01:00
Sam Atkins
f2b8ae7d86 BrowserSettings: Add preferred-color-scheme setting 2021-11-26 22:14:56 +01:00
Sam Atkins
11466c5316 BrowserSettings: Add setting for search engine 2021-11-26 22:14:56 +01:00
Sam Atkins
e927048754 Browser: Move search engine definitions to a json file
This both makes them configurable, and means that we can read them from
other applications, such as BrowserSettings. :^)
2021-11-26 22:14:56 +01:00
Sam Atkins
1933076143 Browser+BrowserSettings: Persist the "show bookmarks bar" setting
Previously this setting was only temporary, but we now save/load it from
the config file.
2021-11-26 22:14:56 +01:00
Sam Atkins
8a284be5c7 BrowserSettings: Create a BrowserSettings application :^)
Browser has a bunch of settings, but most are non-trivial to add here.
So far, these are implemented:

- Homepage URL
- Whether to close download windows when they complete

The others will be added in subsequent commits.
2021-11-26 22:14:56 +01:00
Karol Kosek
20191b58e2 DisplaySettings: Update wallpaper config path only on success
The Window Server is ignoring incorrect files since 235f39e449, so let's
not update the config when that happens and an error message instead!
2021-11-26 11:30:55 -08:00
Karol Kosek
e56ffd11ce DisplaySettings: Always save the background color to the config
Previously, you could notice that the background color isn't being
updated when you picked a small bitmap image with the 'center' mode.
2021-11-26 11:30:55 -08:00
Ralf Donau
1c59cfa28c SystemMonitor: Remove unveiling /tmp/portal/config 2021-11-25 08:50:31 +01:00
kleines Filmröllchen
a099a77e82 SoundPlayer+LibDSP: Move the FFT implementation to LibDSP
LibDSP can greatly benefit from this nice FFT implementation, so let's
move it into the fitting library :^)

Note that this now requires linking SoundPlayer against LibDSP. That's
not an issue (LibDSP is rather small currently anyways), as we can
probably make great use of it in the future anyways.
2021-11-24 23:45:08 +00:00
Andreas Kling
4cbf7f24be Terminal: Tighten lambda captures in create_find_window() 2021-11-24 23:32:43 +01:00
Andreas Kling
1749442a1c Terminal: Use LibCore syscall wrapper for ptsname() 2021-11-24 23:25:03 +01:00
Andreas Kling
6b587714e8 Terminal: Use ErrorOr and TRY() when setting up the "find" dialog 2021-11-24 23:11:11 +01:00
Andreas Kling
0ff9df3cd6 Terminal: Use TRY() a lot more in serenity_main() 2021-11-24 23:07:31 +01:00
Andreas Kling
bc2ee02ce0 FileManager: Use TRY() a lot more in the main functions :^) 2021-11-24 23:07:31 +01:00
Maciej
700c76ba23 CrashReporter: Don't visualize whitespace in memory regions text editor
This was visible for memory regions with empty name.
2021-11-24 19:44:02 +01:00
Andreas Kling
dbab20782e LibGUI: Make FilteringProxyModel factory function return ErrorOr 2021-11-24 13:52:01 +01:00
Andreas Kling
71414821b4 Help: TRY() all the things in serenity_main() :^)
This patch makes use of all the new fallible APIs in LibGUI together
with TRY() to catch and propagate errors. The main error getting caught
is allocation failures while trying to construct the Help UI.

It's quite interesting to see how the code changes as more and more
fallible calls get branded as such by wrapping them in TRY().

There's a lot of repetitive "TRY(try_foo())" going on right now. Once
this becomes the dominant programming pattern, we can drop the "try_"
prefix everywhere. :^)
2021-11-24 13:52:01 +01:00
Andreas Kling
b6f49924be LibDesktop: Make allowlist APIs return ErrorOr<void>
This makes it very smooth to use TRY() when setting up these lists,
as you can see in the rest of this commit. :^)
2021-11-24 00:25:23 +01:00
Andreas Kling
f526325e24 ImageViewer: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
ba4fd8fa15 FontEditor: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
973cb0a49e Calculator: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
31867bed5c KeyboardSettings: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
10b5393506 MouseSettings: Port to LibMain :^) 2021-11-24 00:25:23 +01:00
Andreas Kling
db79f1cb78 Welcome: Port to LibMain :^) 2021-11-24 00:25:22 +01:00
Andreas Kling
e7d4622ce0 Help: Port to LibMain :^) 2021-11-24 00:25:22 +01:00
Andreas Kling
6536198693 TextEditor: Port to LibMain :^)
This opens up using TRY() for syscalls and Core::Object creation.
2021-11-23 15:44:59 +01:00
Andreas Kling
58fb3ebf66 LibCore+AK: Move MappedFile from AK to LibCore
MappedFile is strictly a userspace thing, so it doesn't belong in AK
(which is supposed to be user/kernel agnostic.)
2021-11-23 11:33:36 +01:00
Andreas Kling
21a5fb0fa2 LibCore+LibSystem: Move syscall wrappers from LibSystem to LibCore
With this change, System::foo() becomes Core::System::foo().

Since LibCore builds on other systems than SerenityOS, we now have to
make sure that wrappers work with just a standard C library underneath.
2021-11-23 11:33:36 +01:00
Mustafa Quraish
4d302e0e88 Everywhere: Use Application::construct() with Main::Arguments directly
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
2021-11-22 21:13:42 -08:00
Mustafa Quraish
2fbcab46bf Everywhere: Use ArgsParser::parse() with Main::Arguments directly
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
2021-11-22 21:13:42 -08:00
Pascal Puffke
ca7b603578 Mail: Port to LibMain 2021-11-22 23:56:22 +01:00
Pascal Puffke
41b80f3d85 Piano: Port to LibMain 2021-11-22 23:56:22 +01:00
Pascal Puffke
61408e2397 PDFViewer: Port to LibMain 2021-11-22 23:56:22 +01:00
Pascal Puffke
bec7ffaf0a PixelPaint: Port to LibMain 2021-11-22 23:56:22 +01:00
Andreas Kling
c5c54f634e FileManager: Port to LibMain :^)
This simplifies a handful of calls to pledge() and sigaction().
2021-11-22 23:52:47 +01:00
Sam Atkins
97eb662e62 Browser: Scope bookmark actions so that they don't block the delete key
This fixes #10940.

Previously, all presses of the Delete key without a modifier in Browser
were uselessly consumed by the "Delete" action in the bookmark context
menu.
2021-11-22 23:48:10 +01:00
kleines Filmröllchen
b14a64b3c8 Piano: Move to LibDSP's Classic synthesizer
Almost all synthesizer code in Piano is removed in favor of the LibDSP
reimplementation.

This causes some issues that mainly have to do with the way Piano
currently handles talking to LibDSP. Additionally, the sampler is gone
for now and will be reintroduced with future work.
2021-11-22 22:26:17 +01:00
Ben Wiederhake
afc456edd6 PixelPaint: Use better-fitting image size
This makes the default image fit perfectly into the default viewport,
which means the first fit_image_to_view call will end up with a scale of
exactly 1. This scale level has no visual artifacts, which is the more
intuitive 'default' behavior.

Fixes #10975.
2021-11-22 22:14:53 +01:00
Ben Wiederhake
177478dadf PixelPaint: Add interactive zoom ComboBox to toolbar
Before, there was nothing that tells the user the current zoom level,
which is unknown after a 'fit to image' (the initial state).
2021-11-22 22:14:53 +01:00
Ben Wiederhake
9013d0fe38 PixelPaint: Add ability to fit to either width, height, or image 2021-11-22 22:14:53 +01:00
Ben Wiederhake
be697a440f PixelPaint: Allow setting ImageEditor scale and listening for changes 2021-11-22 22:14:53 +01:00
Ben Wiederhake
7f962cd9d3 PixelPaint: Floor effective viewport size to whole integers
We don't have fractional pixels available, so don't attempt to use them.
2021-11-22 22:14:53 +01:00
Pedro Pereira
272f7c340e 3DFileViewer: Port to LibMain
Simplified one pledge() and five unveil() by using TRY().
2021-11-22 21:56:04 +01:00
Andreas Kling
05e45bfdc5 Browser: Port to LibMain :^) 2021-11-22 19:47:14 +01:00
Andreas Kling
e388782f60 Terminal: Port to LibMain :^)
This simplifies a bunch of error handling and makes the main function
quite a bit shorter.

It will become shorter yet, as we get better at propagating errors. :^)
2021-11-22 19:28:31 +01:00
Tim Schumacher
8d5fb99703 CrashReporter: Show the available memory region information 2021-11-21 17:29:08 +00:00
Ben Wiederhake
69cbaac50a FontEditor: Make glyph parsing more robust
In particular, we sanity-check the received width, height, and buffer
size, before allocating.
2021-11-21 11:49:06 +00:00
Ben Wiederhake
f22c0ffe0c LibGUI+Everywhere: Make sync requests to Clipboard server more obvious 2021-11-21 11:49:06 +00:00
Ben Wiederhake
81128c5100 Browser: Make paste access to Clipboard atomic
This avoids data race issues and saves a synchronous request to the
ClipboardServer.
2021-11-21 11:49:06 +00:00
Ben Wiederhake
d29f094ffa FontEditor: Make paste access to Clipboard atomic
This avoids data race issues and saves three out of four synchronous
requests to the ClipboardServer.
2021-11-21 11:49:06 +00:00
Ben Wiederhake
b6419f2cf2 LibGUI: Make clipboard-as-bitmap parsing less data-race-y
This encourages the caller to first fetch data and type atomically, and
then parse that, instead of potentially making multiple requests.
2021-11-21 11:49:06 +00:00
Jelle Raaijmakers
55526634b6 Piano: Use default sample rate in absence of audio device 2021-11-21 09:27:00 +01:00
Itamar
dd76ba2fe1 CrashReporter: Add "Inspect in Hack Studio" button
This allows the user to open the crash coredump in Hack Studio and
inspect it in the Debug tab.
2021-11-20 21:22:24 +00:00
Itamar
d6d48ce936 CrashReporter: Unlink coredump file on exit
Previously, when the --unlink flag was passed to CrashReporter, it
unlinked the coredump file immediately after reading it.

This change makes it so the coredump file is deleted when CrashReporter
exits.
2021-11-20 21:22:24 +00:00
Sam Atkins
dc3fa1c2e5 KeyboardSettings: Add icons
A calculator isn't the ideal icon for the Num-lock section, so hopefully
someone will produce a better one later.
2021-11-20 21:05:20 +00:00
Sam Atkins
c6099eca5c KeyboardSettings: Add text area to test the currently selected keymap
Right now, this is a bit of a hack. We can't set a keymap to only apply
to the test area, so we set the system keymap instead, while also
keeping track of the "real" current keymap. Whenever the settings are
applied, we update what that "real" keymap is, and when we exit, we
revert to that keymap.

Basically, it behaves as you would expect, apart from it also affecting
other applications you are typing in while the KeyboardSettings window
is open with a different keymap selected.
2021-11-20 21:05:20 +00:00
Sam Atkins
0a2b6b64c6 KeyboardSettings: Migrate to using SettingsWindow :^) 2021-11-20 21:05:20 +00:00
Sam Atkins
4bac30f737 KeyboardSettings: Migrate layout to GML
All other Settings applications use this, so let's match them!
2021-11-20 21:05:20 +00:00
Sam Atkins
1dd5c838cf DisplaySettings: Migrate to using SettingsWindow :^) 2021-11-20 21:05:20 +00:00
Sam Atkins
a4af8b2a64 DisplaySettings: Move screen number show/hide logic into widget
This is functionally the same as before, as selecting a tab fires Show
and HideEvents. But this way, we don't need to directly access the
TabWidget, which will make using SettingsWindow simpler.
2021-11-20 21:05:20 +00:00
Sam Atkins
9fc53017c6 MouseSettings: Adjust layout so mouse-button image is no longer clipped 2021-11-20 21:05:20 +00:00
Sam Atkins
f20b0403bc MouseSettings: Migrate to using SettingsWindow :^) 2021-11-20 21:05:20 +00:00
Sam Atkins
fca7924437 MailSettings: Migrate to using SettingsWindow :^) 2021-11-20 21:05:20 +00:00
Ben Wiederhake
63078ba7fc FontEditor: Set all pixels when pasting a glyph
For an empty glyph (all pixels initially clear), this makes no
difference. However, if the glyph for the selected code point already
contains some set pixels, pasting used to "add" the set pixels, instead
of overwriting.
2021-11-20 12:56:35 +01:00
Ben Wiederhake
8d80d1346d FontEditor: Add ability to copy the selected code point
This makes it easier to preview the current glyph, if it is not easily
typable.
2021-11-20 12:56:35 +01:00
Ben Wiederhake
7180813cd4 FontEditor: Support flipping and rotating
This is especially useful for highly symmetric scripts like this:
https://www.unicode.org/charts/PDF/U1400.pdf
2021-11-20 12:56:35 +01:00
Ben Wiederhake
1dfb3ff4eb FontEditor: Tighten type of UndoGlyph::undo_state (cannot fail) 2021-11-20 12:56:35 +01:00
Ben Wiederhake
bce5a0a00d FontEditor: Don't show focus box after clicking 'present' checkbox 2021-11-20 12:56:35 +01:00
Ben Wiederhake
197b5f7c4a FontEditor: More reasonable labels, move property to GML 2021-11-20 12:56:35 +01:00
Ben Wiederhake
a8c95097b5 FontEditor: Convert UI from fixed to implicit height
This gets rid of a magic number, and means that the widget will adapt
nicely when the system font changes.
2021-11-20 12:56:35 +01:00
Ben Wiederhake
b224efe73b FontEditor: Show code point name in status bar 2021-11-20 00:31:55 +01:00
Andreas Kling
4bd4ce439a PixelPaint: Allow toggling the active layer boundary display rect
Let the user opt out of painting a rectangle around the currently
active layer.
2021-11-20 00:25:24 +01:00
Andreas Kling
7c57961c61 LibWeb: Move BrowsingContext into HTML/
Browsing contexts are defined by the HTML specification, so let's move
them into the HTML directory. :^)
2021-11-18 21:11:30 +01:00
Andreas Kling
587f9af960 AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional)
Also add slightly richer parse errors now that we can include a string
literal with returned errors.

This will allow us to use TRY() when working with JSON data.
2021-11-17 00:21:10 +01:00
Karol Kosek
e38b3f526e DisplaySettings: Handle errors when loading wallpaper bitmap
Prior this change, the app crashed if the first file in alphabetical
order in /res/wallpapers couldn't be decoded.
2021-11-16 01:07:37 +00:00
kleines Filmröllchen
8f8ae5eb53 Piano: Create controller widgets for processor parameters
These widgets attach to a processor parameter and keep the two sides in
sync. They will become very useful for smart processor interfaces.
2021-11-16 00:09:58 +00:00
kleines Filmröllchen
cca4268ff8 Piano: Always show Processor parameter values
The processor parameter values are displayed with two decimal places by
default. However, when these values become very large and exceed about 7
text symbols, the text is too long to fit the label and it'll simply not
show up. This commit fixes that by disabling the decimal place for such
large values, which allows us to show values up to 9,999,999, be it
only at integer precision.
2021-11-15 23:04:16 +00:00
kleines Filmröllchen
8af97d0ce7 Audio: Fix code smells and issues found by static analysis
This fixes all current code smells, bugs and issues reported by
SonarCloud static analysis. Other issues are almost exclusively false
positives. This makes much code clearer, and some minor benefits in
performance or bug evasion may be gained.
2021-11-15 23:00:11 +00:00
Sam Atkins
28a8e4a105 ThemeEditor: Correct GroupBox margins
Now that GroupBoxes have intrinsic margins, we don't need to provide
such large margin values in the GML.
2021-11-13 17:59:51 +00:00
Andrew January
22e80bae29 LibGUI: Change delete key handling from action to keydown_event
Having the delete key handling be done via an action limits our ability
to support key modifiers (e.g. ctrl+delete deleting the word in front of
the cursor).

The fact that it was an action _did_ allow us to have a delete button in
the TextEditor UI. However, this is an odd choice in the first place
that isn't common in other text editors, so I just removed it.
2021-11-13 12:53:29 +01:00
Pedro Pereira
15bc043114 3DFileViewer: Clean some code for increased readability on Mesh
This replaces all usages of 'm_triangle_list[i]' with 'triangle' in
order to improve readability of the code.
2021-11-13 12:52:22 +01:00
Pedro Pereira
ed41f48ea4 3DFileViewer: Calculate face-normal from vertex-normals of the triangle
This change calculates the face-normal of the triangle by adding
the three vertex-normals and then normalizing. This results in an
average of the three vertex-normals.
2021-11-13 12:52:22 +01:00
Pedro Pereira
5fd58a2663 3DFileViewer: Add 'normals' to Mesh constructor
This change allows a Mesh object to be created with a vector of normals.
2021-11-13 12:52:22 +01:00
Pedro Pereira
7fb8af73bf 3DFileViewer: Add vertex normal parsing to WavefrontOBJLoader
This change allows us to parse vertex-normal lines "vn x y z"
and map them to the correct index on face lines ("f v1/vt1/vn1").
2021-11-13 12:52:22 +01:00
Andreas Kling
d21dc1f451 Everywhere: Replace "virtual desktop" => "workspace" 2021-11-13 12:48:43 +01:00
Maciej
62169fda03 SystemMonitor: Ask user before trying to kill/stop process
These actions can be dangerous, especially for important system
processes. Let's make accidental breaking of the system a bit
harder. :^)
2021-11-13 11:14:20 +00:00
Maciej
7f7db7dbec SystemMonitor: Add Delete as alternate shortcut for killing a process
This matches behaviour of other "system monitors", like Windows's Task
Manager
2021-11-13 11:14:20 +00:00
Elyse
f19cb6bb22 SoundPlayer: Add keyboard shortcuts for stop and volume
These shortcuts allow us to stop the player (key S) and adjust
the volume level (key Up and key Down).
2021-11-13 11:53:31 +01:00
Elyse
ccced92ac2 SoundPlayer: Make 'volume_slider' a member variable
This change will allow us to modify the volume slider from any event
inside the widget.
2021-11-13 11:53:31 +01:00
Elyse
11a4fa6067 SoundPlayer: Allow volume output of up to 150%
Previously the volume slider could go up to 150% but the real
output volume stayed the same between 100% and 150%.
2021-11-13 11:53:31 +01:00
Andreas Kling
ea8c6e796f SystemMonitor: Shrink oversized GroupBox margins
Now that GroupBox reports accurate content margins, we don't need to
account for the title height in internal layout margins.
2021-11-13 11:47:46 +01:00
Andreas Kling
8b1108e485 Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Andreas Kling
a15ed8743d AK: Make ByteBuffer::try_* functions return ErrorOr<void>
Same as Vector, ByteBuffer now also signals allocation failure by
returning an ENOMEM Error instead of a bool, allowing us to use the
TRY() and MUST() patterns.
2021-11-10 21:58:58 +01:00
Simon Woertz
1476f02f99 SoundPlayer: Fix stack-use-after-scope when playing file in loop mode
The path returned by GUI:FilePicker is stored on the stack when the
callback is executed. The player only stored a StringView to the path
however it should take ownership of the path instead since the path is
accessed even after the file menu open action has returned.
2021-11-08 16:34:03 -08:00
David Isaksson
b6d075bb01 LibAudio: Rename Audio::Frame -> Audio::Sample
"Frame" is an MPEG term, which is not only unintuitive but also
overloaded with different meaning by other codecs (e.g. FLAC).
Therefore, use the standard term Sample for the central audio structure.

The class is also extracted to its own file, because it's becoming quite
large. Bundling these two changes means not distributing similar
modifications (changing names and paths) across commits.

Co-authored-by: kleines Filmröllchen <malu.bertsch@gmail.com>
2021-11-08 16:29:25 -08:00
Andreas Kling
801d46d02c PixelPaint: Use ErrorOr<T> for Image and Layer creation helpers 2021-11-08 00:35:27 +01:00
Andreas Kling
9268ed9605 PixelPaint: Use ErrorOr<T> for Image::try_compose_bitmap() 2021-11-08 00:35:27 +01:00
Andreas Kling
77fd4625b5 PixelPaint: Use ErrorOr<T> for Image writing/exporting functions 2021-11-08 00:35:27 +01:00
Andreas Kling
a7f1f1c34b LibCore: Use ErrorOr<T> for Core::File::open() 2021-11-08 00:35:27 +01:00
Andreas Kling
4a2b718ba2 LibCore: Use ErrorOr<T> for Core::File::copy_file() 2021-11-08 00:35:27 +01:00
Andreas Kling
c7e62d448c LibCore: Use ErrorOr<T> for Core::File::remove()
This function returns a subclass of Error, which is now possible.
2021-11-08 00:35:27 +01:00
Andreas Kling
0f5477c721 AK: Use ErrorOr<T> for MappedFile factories
Replace Result<T, E> with ErrorOr<T> and propagate the error to callers.
2021-11-08 00:35:27 +01:00
Andreas Kling
0de33b3d6c LibGfx: Use ErrorOr<T> for Bitmap::try_create()
Another one that was used in a fajillion places.
2021-11-08 00:35:27 +01:00
Andreas Kling
235f39e449 LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
Andreas Kling
8262bbf624 LibGfx: Use ErrorOr<T> for Bitmap::cropped() 2021-11-08 00:35:27 +01:00
Andreas Kling
5e41c70e83 LibGfx: Use ErrorOr<T> for Bitmap::scaled() 2021-11-08 00:35:27 +01:00
Andreas Kling
db90b4554e LibGfx: Use ErrorOr<T> for Bitmap::flipped() 2021-11-08 00:35:27 +01:00
Andreas Kling
69c4614a94 LibGfx: Use ErrorOr<T> for Bitmap::rotated() 2021-11-08 00:35:27 +01:00
Andreas Kling
2da4cfcc80 LibGfx: Use ErrorOr<T> for Bitmap::clone() 2021-11-08 00:35:27 +01:00
Davi
0d459553fd TextEditor: Fix hang on "Replace All" 2021-11-06 12:25:15 +01:00
Sam Atkins
7613586097 ThemeEditor: Offset the preview vertically to center it better
Previously, the active window being centered, and then the inactive one
being higher, meant having an awkward gap at the bottom. This is a
simple fix, and not perfect, but it helps. :^)
2021-11-05 23:34:22 +01:00
Sam Atkins
b51d2fee05 ThemeEditor: Add support for FlagRoles
The GUI for this is a bit odd, especially since we only have one flag,
but otherwise adding new flags would require modifying ThemeEditor. At
least it is consistent with the other theme properties.
2021-11-05 23:34:22 +01:00
Elyse
5c845dbfcb SoundPlayer: Allow playback progress slider jump to cursor
This fix allows us to move the knob wherever we click inside the slider.
The 'jump_to_cursor()' mechanism wasn't working properly because the
player was overwriting the value we had just clicked.
2021-11-04 23:45:26 +01:00
FrHun
54605794f9 Applications: Remove border from GroupBox margins 2021-11-03 16:13:19 +01:00
FrHun
8249ea792e LibGUI+FileManager: Clarify Widget margins name
Even though they are called content_margins,
they are actually only ever used to determine where
a Widget is supposed to be grabbable.
So all methods and members are renamed accordingly.
2021-11-03 16:13:19 +01:00
FrHun
a261e4d9d5 LibGUI+Settings: Remove superfluous margin sets
The margin set is completely superfluous, because it only ever affects
grabbing (in splitters), which is never used for these classes.
2021-11-03 16:13:19 +01:00
Ben Wiederhake
52a1ff4d4b LibDSP+Piano: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.

This commit is separate from the other Applications/Libraries changes
because it required additional adaption of the code. Note that the old
code did precisely what these changes try to prevent: Create and handle
a ref-counted object with a refcount of zero.
2021-11-02 22:56:53 +01:00
Ben Wiederhake
465af4c4d4 Applications: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
2021-11-02 22:56:53 +01:00
Andreas Kling
68c8d23e39 LibWeb+Browser: Show DOM comments with syntax_comment color in inspector
This required a hack since models can't return a color role directly
from data(). I've added a FIXME about it.
2021-11-02 22:30:06 +01:00
Musab Kılıç
4de7b3ad24 PixelPaint: Map color_distance_squared from 0 to 1 2021-11-02 12:20:48 +01:00
Ben Wiederhake
59619572d6 LibThreading: Remove redundant method 2021-11-02 11:07:26 +01:00
Arne Elster
be9a7057ff HexEditor: Give magic constants names
There are a lot of numbers just floating around in the code.
Give them proper names.
2021-11-01 01:48:51 +01:00
Arne Elster
4aab6ff839 HexEditor: Use size_t where applicable
File positions as well as selection positions should be size_t,
as they are never negative and can become quite big.
2021-11-01 01:48:51 +01:00
Arne Elster
6b5456f132 HexEditor: Remove magic color constant for modified bytes
The magic constant does not work together well with themes.
As there does not seem to be a suitable palette color for this,
simply invert the color.
2021-11-01 01:48:51 +01:00
Arne Elster
41edc21a8e HexEditor: Show blinking caret at current position
For better visibility of wether the editing focus is on the hex or the
ascii view, render a blinking caret instead of a solid cell background.
For that to work, it's also necessary to change the way selection works.
The selection shouldn't extend to the current position but up to the
byte before it.
2021-11-01 01:48:51 +01:00
Sam Atkins
2c901ae2be Browser: Add "Color scheme" setting
This allows the user to override whether to use a dark or light theme in
supporting websites.
2021-10-31 18:39:13 +01:00
Timothy Flynn
1939c72ecc Spreadsheet: Convert JSIntegration to ThrowCompletionOr 2021-10-31 15:48:36 +01:00
Marco Cutecchia
81b260bd1c PixelPaint: Use a bucket cursor for the Bucket tool 2021-10-31 12:37:49 +01:00
Marco Cutecchia
0f24678eaf PixelPaint: Support using a bitmap as a tool's cursor 2021-10-31 12:37:49 +01:00
ForLoveOfCats
2c93ee50cd SpaceAnalyzer: Display scan progress with popup window during analysis 2021-10-31 12:15:12 +01:00
Musab Kılıç
8f9948ad66 Calculator: Add Constants menu 2021-10-31 12:10:44 +01:00
Musab Kılıç
2ef8cbe6cf Calculator: Fix copy button not copying the fractional part bug :^) 2021-10-31 12:10:33 +01:00
Musab Kılıç
8936d15efa Calculator: Improve KeypadValue conversion to handle integer values 2021-10-31 12:09:37 +01:00
Peter
80aa1b93d1 Debugger: Add logging for the other 8 GPRs too 2021-10-31 00:20:35 +02:00
Marco Cutecchia
5f04fb0ece Spreadsheet: Make the 'Help' window accessory 2021-10-31 00:58:05 +03:30
Sam Atkins
c1d26c884d ThemeEditor: Display the theme's window icons in the preview
If the icons could not be loaded, we fall back to the defaults (which
are the bitmaps that were always used before.)
2021-10-28 11:23:44 +02:00
Sam Atkins
dbeff9ad84 ThemeEditor: Add PathRole editing
This allows both typing the path, and selecting it with a file-open
dialog.
2021-10-28 11:23:44 +02:00
Sam Atkins
e58db5592e ThemeEditor: Update value edit boxes when loading a theme file
Previously, these would continue to show the previously entered values,
until you interacted with the ComboBoxes.
2021-10-28 11:23:44 +02:00
Sam Atkins
684f8a6b15 ThemeEditor: Add MetricRole editing
The editing UI at the bottom is now split into two groups, one for
colors and one for metrics.
2021-10-28 11:23:44 +02:00
Sam Atkins
c885722a94 ThemeEditor: Convert layout to GML 2021-10-28 11:23:44 +02:00
Sam Atkins
daaf5890a6 ThemeEditor: Display window shadows in preview :^) 2021-10-28 11:23:44 +02:00
Sam Atkins
ab1ce13eea ThemeEditor: Give both preview windows a background color
The inactive window previously didn't have a background fill, so it
looked odd.
2021-10-28 11:23:44 +02:00
Jelle Raaijmakers
770c1935d4 MouseSettings: Reset the double-click timer after every second click
The old behavior of restarting the timer after every second click could
result in double-click-chains (or triple+ clicks), which does not feel
like the right behavior.

By resetting the double-clicking timer, you need to perform a new full
double-click to make the arrows change color again.
2021-10-28 11:21:18 +02:00
Filiph Sandström
d6a0726302 Everywhere: Rename left/right-click to primary/secondary
This resolves #10641.
2021-10-27 22:05:58 +03:00
Ben Wiederhake
074ce35b37 Piano: Fix typo in Copyright header
This was introduced in 74f1f2b5e2.
I have no idea why the checker script didn't pick it up. Bash bug maybe?
2021-10-27 11:35:47 -07:00
Leandro Pereira
314b8a374b SoundPlayer: Implement playlist shuffle mode
The shuffling algorithm uses a naïve bloom filter to provide random
uniformity, avoiding items that were recently played.  With 32 bits,
double hashing, and an error rate of ~10%, this bloom filter should
be able to hold around ~16 keys, which should be sufficient to give the
illusion of fairness to the shuffling algorithm.

This avoids having to shuffle the playlist itself (user might have
spent quite a bit of time to sort them, so it's not a good idea to mess
with it), or having to create a proxy model that shuffles (that could
potentially use quite a bit of memory).
2021-10-25 23:37:18 +02:00
Leandro Pereira
0812965f50 SoundPlayer: Make M3UParser more idiomatic
Let's use the nice APIs we have, and make the M3U parser a bit more
readable, shorter, and resilient.
2021-10-25 23:37:18 +02:00
Leandro Pereira
3126b78903 SoundPlayer: Fix inconsistencies and code duplication
This is a first pass at refactoring SoundPlayer so that the View widget
is decoupled from the player itself.

In doing so, this fixed a couple of issues, including possibly
inconsistent states (e.g. player could be paused and stopped at the
same time).

With the change, Player actually controls the show, and calls methods
overriden by its subclasses to perform actions, such as update the Seek
bar; the hard work of massaging the raw data is done by the Player
class, so subclasses don't need to reimplement any of these things.

This also removes some copies of playlist management code that happened
to be copied+pasted inside callbacks of buttons -- it now lives inside
a neatly packaged Playlist class, and the Player only asks for the next
song to play.

In addition, the menu bar has been slightly rearranged.
2021-10-25 23:37:18 +02:00
Andrew Pardoe
0e68550c05 MouseSettings: Add option to reverse buttons
Add option to reverse primary and secondary buttons in Mouse Settings.
- WindowServer.ini: add default entry
- switch-mouse-buttons.png: new icon for settings entry
- Mouse.gml/MouseWidget.*: new settings dialog
- ClientConnection/WindowManager/Server: window message for settings
- EventLoop.cpp: swap buttons 1 and 2 if settings are on
2021-10-25 19:20:33 +03:00
Karol Kosek
d40c36a16e Assistant: Fix adding sequential bonus in Fuzzy Match
It was comparing if they both had the same index position (which was
always false).
2021-10-25 13:00:32 +02:00
Karol Kosek
5e10cd364b Assistant: Save match all match points in Fuzzy Match
From what I think, the array should consist of point indexes that have
been matched instead of just the last one.

For example, these are the array contents after searching 'file' for
'File Manager':
- Before: [ 3 ]
- Now: [ 0, 1, 2, 3 ]

Besides that, this greatly improves the scoring logic, as it can now
calculate bonuses.

Closes: #8310
2021-10-25 13:00:32 +02:00
Karol Kosek
e7eccf3de2 Assistant: Simplify the logic of calculating bonus points
This does not change the results, but makes the code clearer.
2021-10-25 13:00:32 +02:00
Karol Kosek
ee17614e34 Assistant: Move score calculation logic to separate function 2021-10-25 13:00:32 +02:00
Karol Kosek
5ddd1555bc Assistant: Make strings const referenced
Found by clazy.
2021-10-25 13:00:32 +02:00
Andreas Kling
398c181c79 LibJS: Rename PropertyName to PropertyKey
Let's use the same name as the spec. :^)
2021-10-24 17:18:07 +02:00
Idan Horowitz
b41954182a PixelPaint: Move Mask::{get, set, to_index} to the header file
They were previously taking up 9% of samples in a profile of PixelPaint
while selecting a mask, and as a result of moving them to the header
they were inlined, which effectively eliminated them from the profile.
2021-10-24 17:02:44 +02:00
Ben Wiederhake
cb868cfa41 AK+Everywhere: Make Base64 decoding fallible 2021-10-23 19:16:40 +01:00
Sam Atkins
d2690e551c TextEditor: Add syntax-highlighting for CSS files 2021-10-23 19:07:44 +02:00
Ben Wiederhake
5c04a2d4b3 man.serenityos.org: Add section descriptions to overview page 2021-10-22 19:49:28 +03:00
Idan Horowitz
40eb3a39d4 LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
2021-10-20 12:27:19 +01:00
Idan Horowitz
20163c0584 LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
2021-10-20 12:27:19 +01:00
Nícolas F. R. A. Prado
72f1e23e6b ImageViewer: Use scaled image size when resizing window to fit it
When the image is flipped or rotated, the window is resized to ensure
that the image still fits in the frame. However, currently the original
bitmap rect is used, which doesn't take into account the scaling
factor. Fix this by using the scaled rect instead.
2021-10-19 18:24:20 +02:00
thankyouverycool
5d09f4abce Welcome: Save startup preference to user's SystemServer session
Off by default.
2021-10-18 15:55:11 +02:00
Rodrigo Tobar
356d5821e7 SystemMonitor: Request symbolication wihout source positions
The Stack tab doesn't display this information anyway, so there's no
need to have it calculated and returned to us.
2021-10-17 22:07:10 -07:00
Idan Horowitz
aad12b050b LibJS: Convert to_length() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz
f6a5ff7b00 LibJS: Convert to_i32() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Idan Horowitz
20d990563c LibJS: Convert to_number() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Karol Kosek
0a54a86a8b FontEditor: Accept file drops 2021-10-17 13:53:08 +01:00
Karol Kosek
a0cb8cfefd FontEditor: Add FontEditorWidget::open_file() function
This part is also quite needed when opening files from drag-and-drop
events.
2021-10-17 13:53:08 +01:00
Karol Kosek
72378fd36c FontEditor: Reuse the request_close() function in Open action 2021-10-17 13:53:08 +01:00
Idan Horowitz
1639ed7e0a LibJS: Convert to_double() to ThrowCompletionOr 2021-10-17 12:12:35 +01:00
Felix Rauch
183a2ec8bd PixelPaint: Create an empty layer when the last layer is removed
Previously, when the last layer got deleted, the active layer was
set to nullptr, causing a crash.

Now, we create a new transparent background layer with the image
dimensions instead.
2021-10-16 18:10:11 +01:00
Rodrigo Tobar
1f4a6e7c22 SystemMonitor: Use a TableView to display the thread stack
Using a table display this information in a much more organised and
flexible way than than what can be achieved with a TextEditor.
2021-10-15 22:10:03 -07:00
Rodrigo Tobar
6a3b24db0a SystemMonitor: Remove unnecessary header inclusion 2021-10-15 22:10:03 -07:00
Undefine
5009202038 SystemMonitor: Save refresh frequency to a config file 2021-10-13 20:44:37 +03:00
Linus Groh
52976bfac6 LibJS: Convert to_object() to ThrowCompletionOr 2021-10-13 09:55:10 +01:00
Linus Groh
4d8912a92b LibJS: Convert to_string() to ThrowCompletionOr
Also update get_function_name() to use ThrowCompletionOr, but this is
not a standard AO and should be refactored out of existence eventually.
2021-10-13 09:55:10 +01:00
Mustafa Quraish
fdfc0d1bac FileManager: Listen for changes to Desktop wallpaper in config
Since there's no global API for being able to just assign a callback
function to config changes, I've made an inline struct in desktop
mode with the sole purpose of checking to see if the Wallpaper
entry has changed, and then updates GUI::Desktop.

It's pretty neat seeing the wallpaper change as soon as you edit the
config file :^)
2021-10-10 01:15:34 -07:00
Karol Kosek
c8d825e1b3 SpaceAnalyzer: Make files removable depending on directory permissions
Prior this patch, you couldn't remove any files from the context menu
if you didn't have write access to them.

It was incorrect, as the write permission for files means that you can
modify the contents of the file, where for directories it means that
you can create, rename, and remove the files there.
2021-10-09 23:31:01 +02:00
Alex Major
d4a0ecac31 PixelPaint: Close tab now prompts for a save 2021-10-07 18:35:56 +02:00
Luke Wilde
eb774aadbf PixelPaint: Use reorderable tabs 2021-10-07 17:04:12 +02:00
Peter Elliott
da804d95f7 Browser: Use reorderable tabs 2021-10-07 12:19:27 +02:00
Mart G
5f53dc6a45 SpaceAnalyzer: Fix rendering bug when dealing with large file systems 2021-10-07 08:46:15 +03:30
sin-ack
c330ad27b6 SystemMonitor: Use u64 for all GraphWidget values
Turns out size_t is not guaranteed to be 64-bit on i686 and trying to
set the max value using a u64 caused a narrowing conversion.
2021-10-07 00:42:24 +02:00
sin-ack
7aa3cfda09 SystemMonitor: Use size_t for graph values
The memory and CPU graphs fail to display anything when the memory size
is larger than 2**31 bytes, because of the small range of int. This
commit makes replaces the type with size_t. Hopefully nobody will have
18 quintillion bytes of memory before this gets replaced. :^)
2021-10-07 00:04:05 +02:00
Andreas Kling
c4826eae4f LibWeb: Rename Layout::BlockBox => BlockContainer
There's a subtle difference here. A "block box" in the spec is a
block-level box, while a "block container" is a box whose children are
either all inline-level boxes in an IFC, or all block-level boxes
participating in a BFC.

Notably, an "inline-block" box is a "block container" but not a "block
box" since it is itself inline-level.
2021-10-06 20:10:36 +02:00
Marco Cutecchia
80e70f95ab PixelPaint: Fix first undo action not working 2021-10-05 15:41:21 +02:00
Marco Cutecchia
c7431da3f2 PixelPaint: Ensure a layer is selected when restoring a snapshot
Previously when restoring the starting snapshot in the UndoStack we
would end up with no layer selected, which was kinda annoying
2021-10-05 15:41:21 +02:00
Ben Wiederhake
52e9f25403 Everywhere: Change from http to https where feasible
I used "git grep -FIn http://" to find all occurrences, and looked at
each one. If an occurrence was really just a link, and if a https
version exists, and if our Browser can access it at least as well as the
http version, then I changed the occurrence to https.

I'm happy to report that I didn't run into a single site where Browser
can't deal with the https version.
2021-10-05 02:08:08 +02:00
Tim Schumacher
7af7fc8c16 Everywhere: Fix more Copyright header inconsistencies 2021-10-04 11:10:09 +01:00
Andreas Kling
f8354c5503 LibWeb+Browser: Disable Same-Origin Policy by default for now
Until we have CORS preflight checks working, this is only getting in the
way of testing and I have to disable it manually all the time.
2021-10-03 23:39:07 +02:00
Linus Groh
3be26f56db LibJS: Convert has_own_property() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
Linus Groh
b7e5f08e56 LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the
most used AO of all of them. Definitely worth it though.
2021-10-03 20:14:03 +01:00
sw1tchbl4d3
fc2ed732df CrashReporter: Don't crash when "Generating..." Window gets closed 2021-10-03 16:16:57 +02:00