Commit Graph

705 Commits

Author SHA1 Message Date
Andreas Kling
3e4b48f68e PixelPaint: Avoid unnecessary temporary layer bitmaps during PP load
When opening a PP file, we were creating a layer first with an empty
bitmap, and then replacing it with the loaded bitmap from the file.

This patch reorders things so we never create the empty bitmap in
between, saving time and avoiding a memory spike.
2021-06-15 10:05:50 +02:00
Andreas Kling
398bf045c6 PixelPaint: Increase default size of new images from 1x1 to 480x360 2021-06-15 10:05:16 +02:00
Andreas Kling
eb76b18ee3 PixelPaint: Don't allow creating empty layers or images 2021-06-15 10:05:16 +02:00
Andreas Kling
8731bc9ead PixelPaint: Display an error message if opening a file fails 2021-06-15 10:05:16 +02:00
Andreas Kling
c333aec9f3 PixelPaint: Display an error message if saving to PP file fails 2021-06-15 01:16:34 +02:00
Andreas Kling
fa7bb98b1e PixelPaint: No need to pass ImageEditor& to Selection::paint()
It already has a reference to the editor in m_editor.
2021-06-15 01:16:34 +02:00
LepkoQQ
e6f27cec39 PixelPaint: Add actions to swap colors or reset them to default values 2021-06-15 00:13:03 +02:00
LepkoQQ
db99e0917c PixelPaint: Add menu items for Select All and Clear Selection
We also need to update the image editor when clearing selection
otherwise the last state of the selection will be displayed until an
update happens.
2021-06-15 00:13:03 +02:00
Andreas Kling
068ca3a394 PixelPaint: Always animate marching ants during interactive selection
The Selection object now tracks whether there is an ongoing interactive
selection (originating from one of the selection tools). If so it makes
sure to pump the marching ants animation.
2021-06-14 18:25:17 +02:00
Andreas Kling
f54164e8ae PixelPaint: Make new pasted layer active immediately
Also clear any selection that existed before pasting. This feels a bit
more intuitive. We may also want to consider switching to the "Move"
tool automatically on paste, but I'm less sure about that.
2021-06-14 18:25:17 +02:00
Andreas Kling
765286f691 PixelPaint: Add copy action (copies the selection from active layer)
You can now select a part of a layer, copy it, and then paste it as
a new layer. Very cool :^)
2021-06-14 18:25:17 +02:00
Andreas Kling
4cecd79000 PixelPaint: Draw the current editor selection as marching ants
This patch moves the marching ants painting code to Selection and
unifies the timer mechanism so that all marching ants are synchronized
which looks neat. :^)
2021-06-14 18:25:17 +02:00
Andreas Kling
1b897ec561 PixelPaint: Add a Selection class (ImageEditor has a Selection)
This will represent a complex, region-based selection in the future.
For now though, it's just a simple rectangle. :^)
2021-06-14 18:25:17 +02:00
Andreas Kling
96b52f13e4 PixelPaint: Implement basic rectangular selection (preview only)
Using the rectangle select tool, you can now drag out a selection which
will be drawn in the form of "marching ants" :^)
2021-06-14 18:25:17 +02:00
Andreas Kling
4bd905de0e PixelPaint: Add a new "Rectangle Select" tool :^)
This patch only adds the tool along with a toolbar icon for it.
It doesn't do anything yet.
2021-06-14 18:25:17 +02:00
Andreas Kling
3ed6a3fea8 Calculator: Fix offensive button misalignment
The UI of this application is still quite bad/uneven, but this at
least fixes the most egregious button misalignment.
2021-06-13 21:48:15 +02:00
Andreas Kling
7d90455fad Browser: Fix build breakage from 29cce65 2021-06-13 21:22:11 +02:00
Marcus Nilsson
4faff69974 Browser: Add download finished graphics to download widget
Not the prettiest, but visually indicates that the download has finished
successfully.
2021-06-13 20:55:58 +02:00
Marcus Nilsson
29cce65d2f Browser: Add close on finished checkbox to download widget
Let the user choose if they want the download widget to close when
finished, also save the users choice for future downloads.
2021-06-13 20:55:58 +02:00
Jelle Raaijmakers
c247d7a662 Utilities: Change unzip -o option to -d
Other `unzip` implementations universally use `-d` to indicate the
output directory, so let's follow this convention.
2021-06-13 17:05:48 +01:00
sinmineryt
2e1a01a499
TextEditor: Don't allow opening directories
Previously it was possible to open a directory in the TextEditor
application. Like device files, these are now rejected with an error
message.
2021-06-13 12:38:07 +01:00
FalseHonesty
fa101d6bf6 VideoPlayer: Create application to parse (and eventually play) videos
This application will eventually be able to actually play videos, but
for now it is used to parse and dump decoded data from the VP9 decoder.
2021-06-12 22:48:28 +04:30
Matthew Olsson
69410d7f4e PDFViewer: Switch back to up/down page icons
This time I remembered to actually commit the image files, oops :^)
2021-06-12 22:45:01 +04:30
Matthew Olsson
e7b70a1435 PDFViewer: Display error dialog if necessary instead of crashing 2021-06-12 22:45:01 +04:30
Matthew Olsson
1ef5071d1b LibPDF: Harden the document/parser against errors 2021-06-12 22:45:01 +04:30
Andreas Kling
dc65f54c06 AK: Rename Vector::append(Vector) => Vector::extend(Vector)
Let's make it a bit more clear when we're appending the elements from
one vector to the end of another vector.
2021-06-12 13:24:45 +02:00
Andreas Kling
de77946a8c Terminal: Don't show window until we've added menubar to it
This removes the janky-looking window growth during startup.
2021-06-12 12:01:54 +02:00
Andreas Kling
68a307be4e PixelPaint: Use ImageDecoder to load images out-of-process
This sandboxes the image decoding work done by PixelPaint to prevent
bugs in the decoding framework from compromising PixelPaint itself. :^)
2021-06-12 11:19:29 +02:00
Andreas Kling
92203c9821 PixelPaint: Don't allow Image::try_create_from_bitmap(nullptr)
This is not a valid use-case so let's prevent it at compile time.
2021-06-12 11:19:29 +02:00
Andreas Kling
9038bc675f PixelPaint: Guarantee that constructed Layer always has a Gfx::Bitmap
Hoist any allocation failures so that layer factories never return a
bitmap-less layer.
2021-06-12 11:19:29 +02:00
Andreas Kling
c7f7c1f7f0 PixelPaint: Use move semantics around Layer construction and accessors 2021-06-12 11:19:29 +02:00
Andreas Kling
9c5de113b1 PixelPaint: Rename Layer::create_foo() => Layer::try_create_foo() 2021-06-11 23:06:46 +02:00
Andreas Kling
a9e98bad8a PixelPaint: Rename Image::create_foo() => Image::try_create_foo()
Factory functions that may fail should be called try_create().
2021-06-11 22:51:10 +02:00
Andreas Kling
29e80178a8 PixelPaint: Convert to east-const style 2021-06-11 22:51:10 +02:00
Marcus Nilsson
d5fa0ea60f FileManager: Save maximized window state on exit
When exiting FileManager in maximized state, save it and start in
maximized state on next launch.
2021-06-09 22:58:10 +02:00
Timothy
e9bafd768d Browser: Fix crash on download
This will unveil the portal for RequestServer which is used to
download files in the Browser.
2021-06-09 18:10:27 +01:00
Ali Mohammad Pur
7ac196974d Everywhere: Replace Vector<T*> with nonnull entries with Vector<T&> 2021-06-08 19:14:24 +02:00
Nick Miller
17c78be334 SoundPlayer: Enable stop button when play button clicked
Previously, if you play a file, then stop, then play again, the stop
button will be permanently disabled until you open a file again.

The stop button should be enabled whenever a file is loaded.

This commit fixes the GUI bug by enabling the stop button whenever the
play button is clicked (if a file is currently loaded).
2021-06-08 00:54:07 +04:30
Nick Miller
c3a60a5dcd LibGUI+SoundPlayer: Add Slider option to jump to cursor
When the cursor is clicked outside of the slider knob,
the current behavior is that it will step up or down by the
Slider page step amount.

This commit adds an option to jump the slider knob
directly to the where the mouse cursor is on mouse down events.

This behavior is disabled by default. It must be enabled with
`Slider::set_jump_to_cursor()`.

Jump to cursor is enabled in SoundPlayer since most music players
have this behavior.
2021-06-08 00:10:54 +04:30
Ali Mohammad Pur
71b4433b0d LibWeb+LibSyntax: Implement nested syntax highlighters
And use them to highlight javascript in HTML source.
This commit also changes how TextDocumentSpan::data is interpreted,
as it used to be an opaque pointer, but everyone stuffed an enum value
inside it, which made the values not unique to each highlighter;
that field is now a u64 serial id.
The syntax highlighters don't need to change their ways of stuffing
token types into that field, but a highlighter that calls another
nested highlighter needs to register the nested types for use with
token pairs.
2021-06-07 14:45:49 +04:30
Andreas Kling
cb295ab644 WindowServer+Magnifier: Make Magnifier buttery smooth :^)
This patch moves the magnifier rect computation over to the server side
to ensure that the mouse cursor position and the screen image never get
out of sync.
2021-06-07 10:22:25 +02:00
Andreas Kling
0ea1fd2d54 Magnifier: Use a GUI::DisplayLink to drive the screen captures
This ensures that we don't try to update more often than the screen
is updated. It also avoids doing synchronous IPC in paint_event().
2021-06-07 10:22:25 +02:00
Max Wipfli
30cdebfa9e LibProtocol: Use URL class in RequestClient::start_request argument
This changes the RequestClient::start_request() method to take a URL
object instead of a URL string as argument. All callers of the method
already had a URL object anyway, and start_request() in turn parses the
URL string back into a URL object. This removes this unnecessary
conversion.
2021-06-06 16:00:11 +02:00
Eugene Barnett
cab2ee5ea2 Magnifier: Add desktop display scale awareness
Continues to magnify correctly at the most current
desktop scale.
2021-06-06 15:56:43 +02:00
NonStdModel
484ec94624 KeyboardMapper: Add GUI alert in case load from file fails
Previously there was no visual clue letting the user know that loading
from file failed.
2021-06-06 00:21:12 +01:00
Ali Mohammad Pur
51c2c69357 AK+Everywhere: Disallow constructing Functions from incompatible types
Previously, AK::Function would accept _any_ callable type, and try to
call it when called, first with the given set of arguments, then with
zero arguments, and if all of those failed, it would simply not call the
function and **return a value-constructed Out type**.
This lead to many, many, many hard to debug situations when someone
forgot a `const` in their lambda argument types, and many cases of
people taking zero arguments in their lambdas to ignore them.
This commit reworks the Function interface to not include any such
surprising behaviour, if your function instance is not callable with
the declared argument set of the Function, it can simply not be
assigned to that Function instance, end of story.
2021-06-06 00:27:30 +04:30
Daniel Bertalan
acbd1d14d0 LibVT+Terminal: Add color scheme support
This commit introduces color scheme support to Terminal. These are found
in `/res/terminal_colors` and the default color scheme can be set in
`~/.config/Terminal.ini`. Furthermore, a combo box is added for
setting the color scheme at runtime.

The previously used default color scheme has been added to
`/res/terminal-colors/Default.ini`.

To make the implementation more compatible with other color schemes,
`TerminalWidget` now supports overriding the default foreground and
background colors.
2021-06-04 09:02:43 +01:00
Andreas Kling
bf8fd4c193 Everywhere: Remove accidental '\n' from various outln() invocations
Also convert outln(stderr, ...) to warnln(...)
2021-06-03 22:50:21 +02:00
NonStandardModel
5bbca2fa8b
KeyboardMapper: Fix crash upon loading an invalid JSON file
This fixes #7699.
It would be nice to also show a GUI alert informing about the failure,
but I will leave that for the future.
2021-06-03 16:19:07 +01:00
Brian Gianforcaro
c2d556be3d TextEditor: Remove unused header includes 2021-06-03 11:21:38 +01:00
Matthew Jones
9720261540 TextEditor/GMLPlayground: Don't close app if user aborts save on exit 2021-06-02 18:15:19 +02:00
NonStandardModel
a7d3709e1c KeyboardMapper: Add default path to keymaps 2021-06-02 18:10:06 +02:00
Marcus Nilsson
11fa3e4f92 Terminal/LibGUI::TextEditor: Add shift+return to search forwards
This adds support for shift+return key combo in single line TextEditor
fields. Used in this case for searching backwards/forwards in the
Terminal find window.
2021-06-02 18:08:56 +02:00
Marcus Nilsson
9550564767 Terminal: Remove unused includes 2021-06-02 18:08:56 +02:00
Marcus Nilsson
734bd9841a Terminal: Close find & settings windows on application exit
Since the find & settings windows are not children of the main window,
they stayed open after exiting the application.
2021-06-02 18:08:56 +02:00
Marco Cutecchia
ea03b43fff PixelPaint: Update Image.{cpp, h} to use east const 2021-06-02 18:07:14 +02:00
Marco Cutecchia
76adac103e PixelPaint: Support opening more image file formats
Previously we could only open .pp files, now we can open all formats
supported by Gfx::Bitmap::load_from_file
2021-06-02 18:07:14 +02:00
Nick Miller
f02d976ed7 SoundPlayer: Fix playback slider page stepping
Fixes a bug that was preventing the playback slider from changing
value when clicking ahead/behind the current position.
2021-06-02 09:39:30 +02:00
Brendan Coles
996f69a1b2 HexEditor: Fix off-by-one bugs in selected text length calculations
find_and_highlight() selected +1 too many bytes.

'Select All' selected +1 too many bytes past the end of
the buffer.

Status bar 'Selected Bytes' count was off by -1 when more
than zero bytes were selected.
2021-06-01 12:23:43 +02:00
Max Wipfli
915cce5b74 Spreadsheet: Remove usage of URL::set_path()
This replaces a call to URL::set_path() with URL::set_paths(), as
set_path() will be deprecated and removed.
2021-06-01 09:28:05 +02:00
Max Wipfli
0d41a7d39a AK: Remove URLParser
This removes URLParser, because its two exposed functions, urlencode()
and urldecode(), have been superseded by URL::percent_encode() and
URL::percent_decode(). This is in preparation for the introduction of a
new URL parser.
2021-06-01 09:28:05 +02:00
Max Wipfli
a603e69599 AK+Everywhere: Replace usages of URLParser::urlencode() and urldecode()
This replaces all occurrences of those functions with the newly
implemented functions URL::percent_encode() and URL::percent_decode().
The old functions will be removed in a further commit.
2021-06-01 09:28:05 +02:00
Linus Groh
16d51d78c0 Userland: Avoid a bunch of JsonObject copies
JsonValue::as_object() returns a reference.
2021-05-31 17:59:02 +01:00
Linus Groh
a6248101e2 SpaceAnalyzer: Replace fprintf(stderr) with warnln() 2021-05-31 17:44:01 +01:00
Linus Groh
8625f089bf Debugger: Replace printf() with outln() 2021-05-31 17:44:01 +01:00
Brandon Hamilton
6219c3ec3c Spreadsheet: Keep value when clicking out of a cell 2021-05-31 16:57:18 +04:30
Andreas Kling
4190fd2199 LibWeb: Rename Web::Frame to Web::BrowsingContext
Our "frame" concept very closely matches what the web specs call a
"browsing context", so let's rename it to that. :^)

The "main frame" becomes the "top-level browsing context",
and "sub-frames" are now "nested browsing contexts".
2021-05-30 12:39:53 +02:00
Stephan Unverwerth
755393e684 LibGL: Implement glBindTexture()
Textures are now initialized with a nullptr upon generation.
They are only actually created once they are bound to a target.
Currently only the GL_TEXTURE_2D target is supported.
The software rasterizer now allows rendering with or without
a bound TEXTURE_2D.
2021-05-30 00:32:37 +01:00
Jesse Buhagiar
e2989424c7 DisplaySettings: Set monitor widget color if no image is selected
The monitor widget now displays the selected colour if no background
image has been selected.

Resolves #7491
2021-05-29 13:30:19 +01:00
Brendan Coles
90e9d1a0a1 HexEditor: Add find_all_strings() function 2021-05-29 16:26:12 +04:30
Marcus Nilsson
0aa0e00dd5 Browser: Add title to go back/forward context menu
Adds page title to the context menu for go back/forward.
2021-05-29 12:03:41 +01:00
Linus Groh
94a56c3aee Browser: Pass Tab::on_title_change title argument as const reference 2021-05-29 01:14:04 +01:00
Linus Groh
507c5b6248 Browser: Remove redundant parameter names from Tab::on_{g,s}et_cookie 2021-05-29 01:12:24 +01:00
Marcus Nilsson
b06d01f040 SystemMonitor: Disable menu items for inaccessible process
Disable the context menu items if user cannot access the process.

Fixes #7486
2021-05-28 18:45:57 +01:00
Jesse Buhagiar
2753505962 SystemMonitor: Use u64 for disk sizes
This fixes #7288, which was being caused by unsigned 32-bit integer
overflow
2021-05-28 16:37:25 +01:00
Brendan Coles
6aa766f8ca HexEditor: Add 'Find All' option to Find Dialog to find all matches 2021-05-27 22:57:17 +02:00
Linus Groh
d2149c153c PDFViewer: Reset current page number to 1 when opening a file
Also use set_current_number() instead of set_text(), so we don't have to
create a string from the number ourselves.
2021-05-27 18:49:49 +01:00
Linus Groh
a8d47d648c PDFViewer: Enable previous/next buttons conditionally
Instead of having both always enabled once a document is loaded, update
them on each page change and disable if appropriate.
2021-05-27 18:47:44 +01:00
Linus Groh
dbb0ee0704 PDFViewer: Fix previous/next page toolbar button icons
go-up.png and go-down.png don't exist (and would look silly here, with
the buttons being next to each other horizontally). Use go-back.png and
go-forward.png instead.
2021-05-27 18:43:23 +01:00
Linus Groh
ffad5b1706 3DFileViewer: Add separator before quit menu action 2021-05-27 18:11:03 +01:00
Linus Groh
6b0c2d5de6 PDFViewer: Add a Help menu 2021-05-27 18:10:34 +01:00
Linus Groh
cde5107f3d PDFViewer: Add separator before quit menu action 2021-05-27 18:09:37 +01:00
Linus Groh
209bfbaaa4 PDFViewer: Show app name as "PDF Viewer" when a file is loaded 2021-05-27 18:08:49 +01:00
Linus Groh
f930837ed7 SoundPlayer: Show app name as "Sound Player" when a file is loaded 2021-05-27 18:07:52 +01:00
ry-sev
8146543a43 LibGUI+TextEditor: Add the calculation of selected words
This moves the calculation of selected words that was originally
in the TextEditor application to TextEditor in LibGUI.
This allows all applications with text editors to get
this number without having to calculating it themselves.
2021-05-27 09:05:39 +01:00
Erik Biederstadt
3ea256b1c6 3DFileViewer: Add view menu
The view menu contains:
1. A fullscreen option (also accessed by pressing F11).
2. Rotation axis controls (x, y, z, or any combination)
3. Rotation speed controls (No rotation, slow, normal, or fast)
2021-05-27 08:57:13 +01:00
Andreas Kling
c739b3cafa Help: Tweak splitter spacing in main UI layout
This doesn't look perfect, but it's slightly better than unmodified.
2021-05-26 22:41:26 +02:00
Jelle Raaijmakers
2c772d1848 LibGUI/AbstractView: Remove on_selection
Since the introduction of multi-select, we have had both `on_selection`
and `on_selection_change`, the latter of which was only invoked when a
change in selection came in through the model.

This removes `AbstractView::on_selection` and replaces it usage with
the more explicit `on_selection_change` everywhere.
2021-05-26 17:39:13 +04:30
Jesse Buhagiar
343e66b816 3DFileViewer: Support textured models
Models that contain UV co-ordinates are now supported,
and will display with a texture wrapped around it, provided
a `bmp` with the same name as the object is in the same
directory as the 3D Model.
2021-05-26 16:36:53 +04:30
Brendan Coles
16094baffc HexEditor: Construct Find dialog from GML 2021-05-25 13:17:28 +01:00
Matthew Olsson
cf3eb27108 PDFViewer: Add a toolbar
The toolbar has an option to toggle the sidebar, a number input to
set the current page, and two buttons to go up and down by one page
2021-05-25 00:24:09 +04:30
Matthew Olsson
cea7dbce42 PDFViewer: Add a tab bar with outlines and thumbnails
Outlines are in theory implemented (though I'm having trouble finding
a simple PDF with outlines to test it on), and thumbnails are not.
2021-05-25 00:24:09 +04:30
Brendan Coles
7982f9aa70 HexEditor: Store UI layout preferences in config file 2021-05-24 20:11:41 +01:00
Thomas Keppler
7dfc804d7d FontSettingsWidget: Reduce duplication in Label setup code
Pull out the Label updating code into its own function.
Ideally, we should probably transform this code to use its own widget
rather than doing this all in-line.
I.e., having a `FontSettingWidget` that that ties the FontPicker, Label
and Button into its own little widget, so that we can stay extendible in
the main widget and reduce duplication some more!
2021-05-24 09:08:23 +01:00
Thomas Keppler
a1f8c10fe5 FontSettingsWidget: Promote Labels as instance members
In order to not resolve the widgets twice, we capture them in ivars.
2021-05-24 09:08:23 +01:00
Thomas Keppler
883d0d2466 FontSettingsWidget: Display the default (fixed-width) font's name
Previously, the font was applied to the Labels but the name wasn't
updated on initial startup.
This meant that the Label's content was only correct in the default
state but not if the user changed the defaults.
2021-05-24 09:08:23 +01:00
Marcus Nilsson
6b85c7647c
Browser: Add context menu with history for back/forward button
Right clicking on back or forward will now show a context menu with
URLs to navigate to. Also added an optional argument for the number of
steps in go_back() and go_forward().
2021-05-23 23:58:00 +01:00
Max Wipfli
6837634f31 Calculator: Remove unused headers 2021-05-23 23:18:54 +01:00
Max Wipfli
bb38328d39 Calculator: Fix behavior when entering number starting with decimal
This fixes a bug where entering a number like ".15" would result in "15"
instead of "0.15"
2021-05-23 23:18:54 +01:00
Max Wipfli
7b53ca5309 Calculator: Use Checked to ensure entered values do not overflow
This replaces the types of m_int_value and m_frac_value with
Checked<u64> which makes it possible to check if the value overflowed
when entering a digit. If that happens, the digit will just be ignored.

This fixes #1263.
2021-05-23 23:18:54 +01:00
Max Wipfli
7a5407982f Calculator: Show decimal point immediately when typed 2021-05-23 23:18:54 +01:00
Max Wipfli
2675d25453 Calculator: Handle keydown events correctly with all keyboard layouts
This changes the keydown_event handler to use codepoints instead of key
codes for comparison if possible. This is so the functionality still
works as intended with keyboard layouts where e.g. typing '+' actually
results in KeyCode::Key_ExclamationPoint rather than KeyCode::Key_Plus.

This also removes the unnecessary call to atoi().
2021-05-23 23:18:54 +01:00
Brendan Coles
efef77a154 HexEditor: Add 'Go to Offset...' dialog 2021-05-23 18:13:49 +02:00
Andreas Kling
a1e133cc6b LibCore: Make ProcessStatisticsReader return results in a Vector
The HashMap API was overkill and made using this less ergonomic than
it should be.
2021-05-23 11:10:15 +02:00
Andreas Kling
c1c252ddb2 LibIPC: Remove unnecessary IPC::ServerConnection::handshake()
This is no longer used by any of our IPC pairs.
2021-05-23 09:53:55 +02:00
Andreas Kling
786f6841b3 SystemMonitor: Remove "Inspect Process" action from context menu
Since everyone opts out of being inspectable by default now, let's not
offer inspection from the menu since it will fail in a default setup.
2021-05-22 23:30:40 +02:00
Andreas Kling
9676548800 SystemMonitor: Symbolicate process stacks in a background thread
Use a Threading::BackgroundAction to symbolicate stacks. This avoids
blocking the main thread and keeps the GUI running (mostly.)
2021-05-22 19:57:19 +02:00
Andreas Kling
b5d73c834f Userland: Rename LibThread => LibThreading
Also rename the "LibThread" namespace to "Threading"
2021-05-22 18:54:22 +02:00
Andreas Kling
5729b4e9a5 SystemMonitor: Don't unveil /tmp/portal/symbol
This portal doesn't exist after SymbolServer has been removed.
2021-05-22 18:54:22 +02:00
Andreas Kling
5d6252b29e LibSymbolication: Rename Client.{cpp,h} => Symbolication.{cpp,h} 2021-05-22 18:54:22 +02:00
Andreas Kling
252cb54310 LibSymbolication+SystemMonitor+bt: Move symbolication back in-process
Process-separated symbolication was cute, but ultimately the threat
model is kinda silly. We're already *running* the binary, but we're
afraid to parse its symbol table? :^)

This commit makes SystemMonitor and bt do symbolication in-process.
SymbolServer and the symbol user will be removed separately.
2021-05-22 18:54:22 +02:00
Andreas Kling
d783076a30 Userland: Rename LibSymbolClient => LibSymbolication 2021-05-22 18:54:22 +02:00
Brendan Coles
e5e00bec8f HexEditor: Construct user interface from GML 2021-05-22 15:41:58 +01:00
Brendan Coles
cdea9f5339 HexEditor: Fix typo: ASCII 2021-05-22 14:24:07 +01:00
Brendan Coles
d1623350b5 HexEditor: Add 'Select All' action 2021-05-22 13:13:49 +04:30
Andreas Kling
be3f4c86de DisplaySettings: Restrict selection of fixed-width fonts
Only allow fixed-width fonts to be the system fixed-width font. :^)
2021-05-21 20:15:51 +02:00
Andreas Kling
8ac0d4abe1 DisplaySettings: Add "Fonts" tab
This allows you to view, edit, and apply changes to the system fonts.
2021-05-21 20:15:51 +02:00
Max Wipfli
229414b002 Applications: Use titlecase and distinct underlined characters in menus
This changes (context) menus across the system to conform to titlecase
capitalization and to not underline the same character twice (for
accessing actions with Alt).
2021-05-21 18:41:28 +01:00
Linus Groh
95a11d5737 FileManager: Change shortcut of Display Settings desktop option
'D' is already used by 'New Directory', let's use 'S'.

Fixes #7350.
2021-05-21 17:56:10 +01:00
Jagger De Leo
1d959a7b81 DisplaySettings: Allow deselection of background image
Previously, if you selected a background image you could not revert to a
solid color background.
2021-05-21 21:17:30 +04:30
Andreas Kling
6048e245ee 3DFileViewer: Make the main widget a GUI::Frame 2021-05-21 16:14:40 +02:00
Andreas Kling
8a3e622538 Browser: Stop leaking popup windows
We were leaking the "view source" and "downloading file" windows for
some reason, presumably it was necessary when these were first added.
Since they are owned by the spawning browser window, there's no need
to leak them.
2021-05-21 15:32:53 +02:00
Linus Groh
d60ebbbba6 Revert "Userland: static vs non-static constexpr variables"
This reverts commit 800ea8ea96.

Booting the system no longer worked after these changes.
2021-05-21 10:30:52 +01:00
Lenny Maiorani
68f76b9e37 Userland: Change typedef to using directive
Problem:
- `typedef`s are read backwards making it confusing.
- `using` statements can be used in template aliases.
- `using` provides similarity to most other C++ syntax.

- C++ core guidelines say to prefer `using` over `typedef`:
  https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rt-using

Solution:
- Switch these where appropriate.
2021-05-21 10:07:22 +01:00
Lenny Maiorani
800ea8ea96 Userland: static vs non-static constexpr variables
Problem:
- `static` variables consume memory and sometimes are less
  optimizable.
- `static const` variables can be `constexpr`, usually.
- `static` function-local variables require an initialization check
  every time the function is run.

Solution:
- If a global `static` variable is only used in a single function then
  move it into the function and make it non-`static` and `constexpr`.
- Make all global `static` variables `constexpr` instead of `const`.
- Change function-local `static const[expr]` variables to be just
  `constexpr`.
2021-05-21 10:07:06 +01:00
Linus Groh
9dd3203cc6 LibGfx: Add missing TextAlignment::BottomLeft 2021-05-21 08:04:31 +02:00
Gunnar Beutner
2a16c8bdb8 3DFileViewer: Clean up file handling
This unifies how 3DFileViewer handles the initial file when starting
the application and when opening files later on via the menu.

Errors are shown both for the initial load as well as when loading
files later on. An error during file load no longer clears the
existing model.

It also adds support for specifying the filename as a command-line
argument.

The opened file's name is shown in the titlebar.
2021-05-20 22:22:56 +02:00
Gunnar Beutner
728e6dad73 3DFileViewer: Move the example model into the home directory 2021-05-20 22:22:56 +02:00
Andreas Kling
1e0d855fdf TextEditor: Don't launch a WebContent process until it's needed
The HTML and Markdown preview modes both use an OutOfProcessWebView to
render the preview pane, and we were instantiating this view from GML.
This caused us to always spawn a WebContent process alongside every
TextEditor instance.

Fix this by deferring the OOPWV construction until we actually need it.
This makes launching TextEditor on a text file quite a bit faster. :^)
2021-05-20 22:12:42 +02:00
Max Wipfli
4cd8ca07e3 FontEditor: Make statusbar text generation more robust
This makes a few modifications to the statusbar text generation:
* Use the canonical U+XXXX representation of unicode characters.
* For control characters, display their alias instead of whitespace.
* Substitute RTL codepoints with U+FFFD so the text paints correctly.
* Only show the glyph's dimensions if it actually exists in the font.

This fixes #7286.
2021-05-20 22:10:45 +02:00
Max Wipfli
621a4008e6 FontEditor: Add tooltip to "Move Glyph" button
This adds a simple tooltip to the "Move Glyph" button to indicate its
functionality.
2021-05-20 22:10:45 +02:00
Ali Mohammad Pur
dc388297eb TextEditor+Browser: Enable HTML syntax highlighting on HTML documents 2021-05-20 22:06:45 +02:00
Andreas Kling
6a012ad79f LibGfx: Remove Gfx::FontDatabase::default_bold_font()
Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
2021-05-20 20:55:29 +02:00
Brendan Coles
3bbae6c18b HexEditor: find_and_highlight: Limit search to remaining buffer size 2021-05-20 18:40:18 +02:00
Andreas Kling
93ef661914 WindowServer+DisplaySettings: Remove the weird "simple" wallpaper mode
Painting the wallpaper at 100% scale in the top left corner is a weird
mode and I don't think we need it. :^)
2021-05-20 17:52:38 +02:00
Andreas Kling
3046b3467c DisplaySettings: Improve wallpaper preview code
Previously, this code would create a bitmap with the size of the screen
resolution, draw the new wallpaper into it, and then scale it down for
display inside the MonitorWidget.

This was done on every paint event, which made the code quite slow and
allocation-happy.

Instead of this, we now scale down the new wallpaper to a miniature
of the same scale as the little MonitorWidget screen. The miniature is
then used for tiling, etc. The miniature is cached and reused across
paint events if nothing else changes.
2021-05-20 17:52:38 +02:00
Andreas Kling
df5f382b50 3DFileViewer: Remove unveil() calls and add "thread" pledge
An application that allows opening arbitrary files from the filesystem
needs to allow itself to access the filesystem, otherwise there's no
point in supporting the feature. :^)

And the "thread" pledge is needed for background thumbnail generation.
2021-05-20 17:52:38 +02:00
Andreas Kling
0a70e1728a DisplaySettings: Fix broken path to MonitorSettingsWidget's GML 2021-05-20 00:25:15 +02:00
Andreas Kling
6394ea00d8 DisplaySettings: Remove icon from browse-for-wallpaper button
The icon on this button looked out of place.
2021-05-20 00:13:56 +02:00
Andreas Kling
7f206ca6de DisplaySettings: Select the currently used wallpaper on startup 2021-05-20 00:03:30 +02:00
Andreas Kling
bb9e955ef8 DisplaySettings: Make MonitorWidget update itself on property changes 2021-05-20 00:03:30 +02:00
Andreas Kling
c79e33d00c DisplaySettings: Rename DisplaySettingsWidget => MonitorSettingsWidget 2021-05-20 00:03:30 +02:00
Andreas Kling
540acc1a32 DisplaySettings: Give the UI a facelift :^)
- Split the main UI into two tabs: "Background" and "Monitor".
- Use a GUI::IconView for selecting background pictures.
- Tweak layout, spacing, etc.
2021-05-20 00:03:30 +02:00
Andreas Kling
c14ffdef00 DisplaySettings: Tweak main window layout & setup code
Get rid of the menu and put some padding around the main tab widget.
2021-05-20 00:03:30 +02:00
Andreas Kling
83f43b6464 DisplaySettings: Replace the monitor image with something more thematic
This is a drawing of my own monitor in a familiar style. :^)
2021-05-20 00:03:30 +02:00
Maciej Zygmanowski
4aaf8df865 Browser: Do not use AK::Format for search engine formatting
It is too complex because it supports many options that are not
used by the search engine. It just makes format validation more
complicated.

Additionaly, now it's possible to have { } characters in search
engine URL (although they are not valid URL characters) :)
2021-05-19 20:51:51 +01:00
Maciej Zygmanowski
78bc6c09ba Browser: Add support for custom search engines 2021-05-19 20:51:51 +01:00
Gunnar Beutner
d954c11f66 Everywhere: Add missing includes for <AK/OwnPtr.h>
Previously <AK/Function.h> also included <AK/OwnPtr.h>. That's about to
change though. This patch fixes a few build problems that will occur
when that change happens.
2021-05-19 21:36:57 +02:00
Erik Biederstadt
585e7890cd 3DFileViewer: Move Demos/GLTeapot to Applications/3DFileViewer
Also changes the category to `Graphics`
2021-05-19 19:34:12 +01:00
Marcus Nilsson
7aaef8fd4b Browser: Don't add multiple page reloads to history
When reloading a page multiple times, it was also added multiple
times to the history. This commit prohibits an url to be added
twice in a row.

Fixes #7264

Co-authored-by: Linus Groh <mail@linusgroh.de>
2021-05-18 23:14:37 +01:00