Commit Graph

1368 Commits

Author SHA1 Message Date
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