Commit graph

1918 commits

Author SHA1 Message Date
Andreas Kling
f48751a739 LibJS: Remove hand-rolled Object is_foo() helpers in favor of RTTI 2021-01-01 17:46:39 +01:00
Andreas Kling
8333055c3d LibJS: Use RTTI for inheritance checks
This replaces the hand-rolled string-based inheritance check tech.
2021-01-01 17:00:20 +01:00
Andreas Kling
167906d02b PixelPaint: Remove hand-rolled type information in favor of RTTI 2021-01-01 16:08:49 +01:00
Jesse Buhagiar
ef5e9af6d3 DisplaySettings: Remove root_widget() from DisplaySettings
This fixes a weird dependency graph in DisplaySettings. The widget itself
(which is described in `gml` now), no longer contains `root_widget()`.

The widget itself has been moved into a tabbed pane, to get it ready
to add some more features and bring it more up to date with the current
UI code.
2021-01-01 15:55:08 +01:00
Andreas Kling
865f524d5b AK+LibGUI+LibWeb: Remove AK::TypeTraits in favor of RTTI-based helpers
Now that we have RTTI in userspace, we can do away with all this manual
hackery and use dynamic_cast.

We keep the is<T> and downcast<T> helpers since they still provide good
readability improvements. Note that unlike dynamic_cast<T>, downcast<T>
does not fail in a recoverable way, but will assert if the object being
casted is not a T.
2021-01-01 15:33:30 +01:00
Andrew Kaster
347bf6459d Applications+LibGUI: Convert all GML consumers to use the LibCore finder
Remove Widget::find_child_by_name and Widget::find_descendant_by_name,
and convert all users to using the type-safer version in Core::Object.
2021-01-01 14:45:09 +01:00
Andreas Kling
fc75421d50 Terminal: Tweak "Find" menu item -> "Find..."
The ellipsis (...) in a menu item traditionally means that the action
will require more input before executing. In this case, you need to
provide a search string. :^)
2021-01-01 02:19:45 +01:00
Andreas Kling
71663a9431 FileManager: Hide unnecessary scrollbars in DirectoryView 2021-01-01 02:12:39 +01:00
Andreas Kling
4ea4cd5ee3 FileManager: Defer setting FileSystemModel root path in DirectoryView
Otherwise we always load the root directory on startup before switching
to whatever directory we actually wanted to open.
2021-01-01 01:55:30 +01:00
Andreas Kling
f0482a4cab Terminal: Make the settings window modal 2021-01-01 00:08:32 +01:00
Stephan Unverwerth
bb27b212de LibGfx: Introduce provisional font interface
Old font functionality has been moved into BitmapFont
and an abstract Font interface has been introduced to
faciliate further development of TTF font integration.
2020-12-31 23:40:27 +01:00
Andreas Kling
ac50bc79e4 Terminal: Move the settings window to GML :^) 2020-12-31 23:38:39 +01:00
Andrew Kaster
084c296362 Piano: Quit the audio thread by checking Core::EventLoop for exit
The infinite loop here doesn't really work at all for an application
process that expects to be able to exit. Check against
Core::EventLoop::current() to see if it's time to
exit, and return 0 from the thread function if so.

The thread will be joined in its destructor, which doesn't assert
anymore now that Thread is a jthread.
2020-12-31 21:59:20 +01:00
Andrew Kaster
2b3993b008 LibThread: Hide Thread's constructor, as it is a Core::Object
Just constructing one of these guys on the stack willy nilly will leak
the first reference to them. There might be other C_OBJECTs that have
public constructors, seems like a good place for some static analysis
checks :).

Force users to call the construct() method for it.
2020-12-31 21:59:20 +01:00
Andreas Kling
47028c56c6 PixelPaint: Use GUI::OpacitySlider for layer opacity settings 2020-12-31 12:10:01 +01:00
Andreas Kling
0b55b0bdb8 Terminal: Use GUI::OpacitySlider in the settings window 2020-12-31 12:10:01 +01:00
Andreas Kling
34d458d111 PixelPaint: Don't focus toolbox buttons on click 2020-12-31 02:05:35 +01:00
Andreas Kling
412a91d58f LibGfx: Add Gfx::Font::bold_variant() that does a proper font lookup
We previously had a cached bold variant font in Gfx::Font that was very
haphazardly located by filename pattern. This patches replaces that
mechanism with a proper Gfx::FontDatabase lookup for the same font but
with bold weight (700).
2020-12-31 01:51:18 +01:00
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