Commit graph

1900 commits

Author SHA1 Message Date
Luke 0f66589007 Everywhere: Fix more typos 2020-12-31 01:47:41 +01:00
Stephan Unverwerth b4d1390714 LibGFX: Move default_xxx_font() methods from Font to FontDatabase
When we have an abstract font class it makes no sense to keep
these methods in the Font class.
2020-12-30 20:40:30 +01:00
Andreas Kling 6cec7a2da6 TextEditor: Switch to using GUI::FontPicker for picking editor font :^) 2020-12-30 20:37:51 +01:00
Andreas Kling 34ae570928 Terminal: Switch to using GUI::FontPicker for choosing terminal font 2020-12-30 20:37:51 +01:00
Linus Groh 45f00ce38d CrashReporter: Show assertion message in backtrace, if any 2020-12-30 16:28:27 +01:00
Morc - Richard Gráčik d32c845652 Terminal: Fix bell mode in Terminal Settings 2020-12-30 15:22:14 +01:00
Andreas Kling cb67264f61 LibGUI: Rename AbstractSlider::on_value_changed => on_change
This matches other similar hook names.
2020-12-30 15:20:47 +01:00
Linus Groh 761169f5c0 CrashReporter: Show PID from coredump 2020-12-30 15:00:17 +01:00
Linus Groh bde65ba7ca CrashReporter: Read executable path from coredump process info
We no longer have to look at the backtrace and guess the executable,
it's now embedded in the coredump's ProcessInfo notes entry directly.

Fixes #4645.
2020-12-30 15:00:17 +01:00
Andreas Kling 2c9147154c Terminal+LibVT: Add settings window to the terminal context menu 2020-12-30 13:42:16 +01:00
AnotherTest 4a2da10e38 ProtocolServer: Stream the downloaded data if possible
This patchset makes ProtocolServer stream the downloads to its client
(LibProtocol), and as such changes the download API; a possible
download lifecycle could be as such:
notation = client->server:'>', server->client:'<', pipe activity:'*'
```
> StartDownload(GET, url, headers, {})
< Response(0, fd 8)
* {data, 1024b}
< HeadersBecameAvailable(0, response_headers, 200)
< DownloadProgress(0, 4K, 1024)
* {data, 1024b}
* {data, 1024b}
< DownloadProgress(0, 4K, 2048)
* {data, 1024b}
< DownloadProgress(0, 4K, 1024)
< DownloadFinished(0, true, 4K)
```

Since managing the received file descriptor is a pain, LibProtocol
implements `Download::stream_into(OutputStream)`, which can be used to
stream the download into any given output stream (be it a file, or
memory, or writing stuff with a delay, etc.).
Also, as some of the users of this API require all the downloaded data
upfront, LibProtocol also implements `set_should_buffer_all_input()`,
which causes the download instance to buffer all the data until the
download is complete, and to call the `on_buffered_download_finish`
hook.
2020-12-30 13:31:55 +01:00
Andreas Kling 94e4aa94b5 Terminal: Tweak height of settings window 2020-12-30 13:15:23 +01:00
Andreas Kling db086ef9cc Terminal: Make the find shortcut Ctrl+Shift+F
Let's leave all the Ctrl+Letter shortcuts for the TTY itself.
2020-12-30 12:53:50 +01:00
Idan Horowitz 7e457b98c3 Terminal: Remove redundant scroll length settings option
This is no longer needed as a global one is now available
under mouse settings.
2020-12-30 11:58:52 +01:00
Idan Horowitz fd945c8007 Applications: Added a new MouseSettings application
This app allows the user to easily adjust his mouse's acceleration
as well as the scrollwheel's global scroll length.

The mouse acceleration changes would not be noticeable in qemu as
by default serenity uses VMWareBackdoor when available which lets
the host handle mouse movement instead of the guest (Serenity),
so in order to test this on a none-baremetal pc the VMWareBackdoor
has to be disabled.
2020-12-30 11:58:52 +01:00
Andreas Kling bc0658ce27 FileManager: Use GUI::SeparatorWidget in the properties dialog
This looks a lot better than putting a GUI::Frame in there.
2020-12-30 03:53:37 +01:00
Andreas Kling 2dc09d1cd7 TextEditor: Show "Untitled" when there's no current document path 2020-12-30 03:44:38 +01:00
Andreas Kling 7c0e43eb3d CrashDaemon: Move from Applications to Services 2020-12-30 03:20:06 +01:00
Andreas Kling a331a39a99 DisplaySettings: Push the bottom buttons to the bottom the window 2020-12-30 03:18:45 +01:00
Andreas Kling 972fedf3cf Terminal: Tweak settings window slightly 2020-12-30 03:15:00 +01:00
Andreas Kling 10b5b9ee66 CrashReporter: Don't keep the coredump file open longer than necessary
Let's be nice and close the file after we've extracted what we need.
2020-12-30 02:56:31 +01:00
Andreas Kling 8df1f6951e DisplaySettings: Convert the GUI to GML :^) 2020-12-30 02:45:20 +01:00
Andreas Kling e07a66d011 LibGUI: Remove unused Widget backcolor/forecolor properties
These were some leftovers from the VisualBuilder times.
2020-12-30 02:45:20 +01:00
Gal Horowitz 35c4338625 HexEditor: Ignore control keys in text mode
The HexEditor now ignores control key events in text mode.
Previously null bytes were written.
2020-12-30 02:12:04 +01:00
Andreas Kling 1cca2405fc LibGUI: Give some widgets a reasonable default fixed height
Instead of hard-coding 22 in random places, just make the following
widgets have a fixed height of 22 by default: Button, CheckBox,
ColorInput, ComboBox, RadioButton, SpinBox, TextBox.

In the future we can make this relative to the current font size,
but for now at least this centralizes the setting a bit better.
2020-12-30 01:54:53 +01:00
Andreas Kling 7dc5a3ead8 LibGUI: Rewrite layout system in terms of min and max sizes
This patch removes size policies and preferred sizes, and replaces them
with min-size and max-size for each widget.

Box layout now works in 3 passes:

    1) Set all items (widgets/spacers) to their min-size
    2) Distribute remaining space evenly, respecting max-size
    3) Place widgets one after the other, adding spacing in between

I've also added convenience helpers for setting a fixed size (which is
the same as setting min-size and max-size to the same value.)

This significantly reduces the verbosity of widget layout and makes GML
a bit more pleasant to write, too. :^)
2020-12-30 01:36:41 +01:00
Andreas Kling 881379e324 SystemMonitor: Use new-style widget size constraints
This is a lot more expressive in C++ as well, not just in GML. :^)
2020-12-30 01:28:28 +01:00
Linus Groh 356f11bc76 CrashReporter: Tweak width of spacer widget by 1px
This prevents the shadow of the close button on its right side being cut
off.

Fixes #4635.
2020-12-29 18:59:57 +01:00
Linus Groh b13b27b4d2 Applications: Add CrashReporter :^)
This is a simple application that can read a coredump file and display
information regarding the crash, like the application's name and icon
and a backtrace. It will be launched by CrashDaemon whenever a new
coredump is available.
Also, it's mostly written in GML! :^)

Closes #400, but note that, unlike mentioned in that issue, this
implementation doesn't ignore applications that "have been started in
the terminal". That's just overcomplicating things, IMO. When my js(1)
REPL segfaults, I want to see a backtrace!
2020-12-29 15:42:30 +01:00
Linus Groh 2939ad0110 LibCoreDump+CrashDaemon: Add and use CoreDump::Backtrace
Creating a backtrace from a crashdump already existed as a few
standalone functions in CrashDaemon. This patch refactors the code
required for this to make it generally usable and moves it to
CoreDump::Backtrace, which provides both raw data as well as
stringification.
2020-12-29 15:42:30 +01:00
Linus Groh 21bc8cfe8f LibCoreDump: Make for_each_thread_info() callback arg a reference
It's never nullptr, so it should be a reference.
2020-12-29 15:42:30 +01:00
Linus Groh 8ec1da2fca LibCoreDump: CoreDumpReader => CoreDump::Reader
As mentioned in 2d39da5 the usual pattern is that LibFoo provides a Foo
namespace - LibCoreDump doesn't, so this renames CoreDumpReader to
Reader and puts it in the CoreDump namespace. :^)
2020-12-29 15:42:30 +01:00
AnotherTest f606e78556 Spreadsheet: Show a small inline doc window for the "current" function
If the user is typing in the cell editor and has the cursor in a
function call, try to show a tip for the arguments of that function:
(cursor denoted by `|`)
```
sum(|
```
should show:
```
sum(cell names)
```
in a tooltip-like window below the editor.
2020-12-29 00:58:43 +01:00
AnotherTest aa5b43a2bc Spreadsheet: Highlight the source causing an exception in red
This commit makes the cell editor highlight the likely source of the
exception in red.
2020-12-29 00:58:43 +01:00
AnotherTest f17874ecd2 Spreadsheet: Add a 'contents' getter/setter to Position
This makes it possible to change the cells' contents programmatically!
2020-12-29 00:58:43 +01:00
Andreas Kling f7116bba43 LibGUI: Refactor AbstractView "multi select" mode into "selection mode"
There are three possible selection modes for a GUI::AbstractView.

- NoSelection
- SingleSelection
- MultiSelection

We don't enforce these modes fully yet, this patch mostly adds them in
place of the old "multi select" flag.
2020-12-28 21:28:40 +01:00
Idan Horowitz b4bb2b141c FileManager: Implement the cut file operation
This exploits the comment lines in the text/uri-list specification:
https://tools.ietf.org/rfc/rfc2483.txt (page 11), which might be a bit
hackish, but the specification suggests doing the same for other uses,
so it should be fine.
2020-12-28 19:13:45 +01:00
Idan Horowitz 7450f20b81 FileManager: Add a delete_path helper for singular paths
This is just the syscalls and error handling that was done for each
file in delete_paths.

This will be used to prevent the unneeded construction of vectors
when performing cut operations
2020-12-28 19:13:45 +01:00
Andreas Kling a35693915e LibGUI: Make syntax highlighter communicate boldness instead of font
Now that fonts know their own weight, we no longer need highlighters to
tell us which font to use. Instead, they can just say "this should be
bold" and we'll find the right font ourselves.
2020-12-28 15:53:10 +01:00
Andreas Kling ffa241250b LibGUI: Make GUI::FileIconProvider::icon_for_executable() a public API
This way we can use it instead of icon_for_path() in a bunch of places
and avoid loading the full FileIconProvider configuration.
2020-12-28 11:41:09 +01:00
Idan Horowitz a49fd0ff5e Terminal: Created a simple Find window for searching within the terminal
This is simply a gui wrapper around the pre-existing TerminalWidget
methods for finding and scrolling.
2020-12-28 11:40:35 +01:00
Idan Horowitz 6efdabfc6f Base: Rename maximize/minimize icons to a more generic name
This reduces naming confusion when the icons are used for other
use cases that require a triangle shape
2020-12-28 11:40:35 +01:00
Andreas Kling 26cb083c6e FileManager: Created desktop shortcuts should use full basename
A shortcut to ReadMe.md should be called "ReadMe.md", not "ReadMe".
2020-12-28 09:38:11 +01:00
Andreas Kling 327f595f63 Browser: Show destination URLs as tooltips in the bookmarks bar 2020-12-28 01:43:58 +01:00
Andreas Kling 27262b639d Browser: Use Core::Object::remove_all_children() in bookmarks bar 2020-12-28 01:42:41 +01:00
Linus Groh ddeb261bc2 Terminal+LibVT: Use GUI::AppFile 2020-12-27 22:46:52 +01:00
Rok Povsic c7911fdce9 HexEditor: Select first character by default
The first character was already selected (with the selection greyed-out),
and a selection span of 1 was shown, so it's natural than the selection
from/to numbers should be 0/0, not -1/-1.
2020-12-27 21:25:54 +01:00
Rok Povsic b2a6d2cea4 HexEditor: Don't update selection numbers when clicking the last+1 char
Clicking at the cell after the last one, where there's no character,
used to update the selection from/to numbers. Since there's no character
there, that shouldn't happen.
2020-12-27 21:25:54 +01:00
Rok Povsic 5e66eda688 HexEditor: Make single-character selection display proper start/end
Previously, -1 / -1 was displayed.

Fixes #3555
2020-12-27 21:25:54 +01:00
Andreas Kling 590fd45461 Terminal: Tweak settings window layout slightly
Make it a little taller so we can see the focus rect around the radio
buttons when they are focused.
2020-12-27 15:29:13 +01:00