Commit graph

1751 commits

Author SHA1 Message Date
Luke
4dfe797263 SystemMonitor: Add a Processors tab 2020-08-21 12:01:36 +02:00
Jake Wilson
0f6de0c45a Browser: add urls to browser history on load start
urls were previously added to history in the Tab::load()
function, which excluded the setter on window.location.href.
This commit adds all urls to browser history when the page loads,
as long as the load_type is not LoadType::HistoryNavigation.
Closes #3148
2020-08-19 21:11:10 +02:00
Abu Sakib
8abf5048b8 Calendar: Add help menuitem 2020-08-18 17:24:14 +02:00
Andreas Kling
d1e83b4f6e FileManager: Make DirectoryView vend indexes from view model
Instead of translating between the sorting proxy and the underlying
file system model at all the DirectoryView API boundaries, just hand
out indexes into the sorting proxy model.

The only thing those indexes are used for on the outside is to
retrieve a GUI::FileSystemModel::Node for an index, so add a nice
helper on DirectoryView that turns a ModelIndex into a Node&.
2020-08-17 22:49:52 +02:00
Andreas Kling
f0349323c4 LibGUI: Don't require passing model to FileSystemModel::Node APIs
The Node API was obnoxiously requiring you to pass the model into it
all the time, simply because nodes could not find their way back to
the containing model. This patch adds a back-reference to the model
and simplifies the API.
2020-08-17 22:02:21 +02:00
Andreas Kling
38d8426f32 FileManager: Move the "create new file" action into DirectoryView
This makes it available in both desktop and windowed modes. :^)
2020-08-17 21:34:14 +02:00
Andreas Kling
be48f58d41 FileManager: Move "create new directory" action into DirectoryView
This makes it available in both desktop and windowed mode. :^)
2020-08-17 21:34:14 +02:00
Andreas Kling
0ffd319bda FileManager: Partially bring back the desktop context menu 2020-08-17 21:34:14 +02:00
Andreas Kling
66cedfa13b FileManager: Don't pass DirectoryView subview to hooks that don't care 2020-08-17 21:34:14 +02:00
Andreas Kling
0083fe0118 FileManager: Use DirectoryView for both windowed and desktop mode
This patch begins the process of converting FileManager's desktop mode
to using the DirectoryView class.

This will allow us to share most of the code between the two different
runtime modes of FileManager.

We lose a bit of functionality in this patch, but we'll bring it back!
2020-08-17 21:34:14 +02:00
Andreas Kling
b6e18133ae LibWeb: Rename WebContentView => OutOfProcessWebView 2020-08-17 18:05:35 +02:00
Andreas Kling
56c3748dcc LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
Luke
c434a91c91 FileManager: Apply wallpaper on startup
I noticed that nothing actually applies the wallpaper on startup.
I wasn't sure where to put the responsibility, so I gave it to
the desktop mode file manager.

Also adds a save_config option to set_wallpaper so it doesn't
needlessly save the config.
2020-08-17 17:47:14 +02:00
Andreas Kling
a27d782dd6 FileManager: Don't close() twice when copying a file 2020-08-17 13:12:46 +02:00
Brian Gianforcaro
73ab030f88 FileManager: Fix descriptor leak in copy_file, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
e43d5d5eaa FileManger: Fix file descriptor leak in copy_file_or_directory, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
f7b1591a5c SystemMonitor: Uninitialized struct member in ProcessModel, found by Coverity
This is really a nop, as the cpu_percent is computed later. Zero the
value just to keep things sane.
2020-08-17 09:17:57 +02:00
Brian Gianforcaro
3ee0917dcb SoundPlayer: Uninitialized variable in SoundPlayerWidget, found by Coverity 2020-08-17 09:17:57 +02:00
Brian Gianforcaro
e160181a73 Piano: Uninitialized member variables in RollWidet, found by Coverity
This seem like they wouldn't cause any problems in reality,
but it's nice to fix them to avoid any future misuse.
2020-08-17 09:17:57 +02:00
Andreas Kling
154a184c1b Browser: Add a debug menu action for triggering a JS garbage collection
Triggering a GC this way will print a report afterwards so you can see
how much memory is currently used by the JS heap. :^)
2020-08-16 20:35:03 +02:00
thankyouverycool
15cb4207fc TextEditor: Put fonts in exclusive action group 2020-08-16 19:39:06 +02:00
thankyouverycool
5558b2cf9f Base: Rename Pebbleton to reflect actual height
And update programs loading it from file.
2020-08-16 19:38:21 +02:00
Andreas Kling
9102b624ac LibGUI+DevTools+Applications: Use ModelIndex::data() in many places
This way you don't have to keep track of which model it came from.
2020-08-16 16:44:09 +02:00
Andreas Kling
96f98b1fc9 LibGUI: Simplify TableCellPaintingDelegate API slightly
No need to pass the Model *and* a ModelIndex, the index knows which
model it belongs to anyway.
2020-08-16 16:44:09 +02:00
Andreas Kling
a1e381a0f8 LibGUI: Move GUI::Model::Role to GUI::ModelRole
This is preparation for using ModelRole in the ModelIndex API.
2020-08-16 16:44:09 +02:00
Andreas Kling
b9ae937279 SystemMonitor: Invalidate ProcessModel indexes when necessary
If the process table grows or shrinks, we need to invalidate all the
ProcessModel indexes. This is not great, but it's the most precise
invalidation we can do at the moment.
2020-08-16 16:44:09 +02:00
Andreas Kling
e1ed71ef9e LibGUI: Make model sorting imperative and move order to AbstractView
Instead of SortingProxyModel having a column+order, we move that state
to AbstractView. When you click on a column header, the view tells the
model to resort the relevant column with the new order.

This is implemented in SortingProxyModel by simply walking all the
reified source/proxy mappings and resorting their row indexes.
2020-08-16 16:44:09 +02:00
Andreas Kling
7b110fad56 FileManager: Use one SortingProxyModel for all DirectoryView subviews
This removes one major source of confusion in DirectoryView. It's still
weird that we mix sorting model indexes with filesystem model indexes
a bit willy-nilly but we'll improve that separately.
2020-08-16 16:44:09 +02:00
Nico Weber
af96cfe9ef SystemMonitor: Move memory graph caption from KB to KiB
This changes the graph caption from KB to KiB, but it keeps just "K"
instead of "KiB" for all the numbers in columns in the table, since "K"
is fairly well-established as abbreviation of "KiB" (the SI prefix is
lower-case), and space is at a premium here.
2020-08-16 16:33:28 +02:00
Nico Weber
aa97166739 Everywhere: Consolidate human_readable_size() implementations
Let's use the one in AK/NumberFormat.h everywhere.

It has slightly different behavior than some of the copies this
removes, but it's probably nice to have uniform human readable
size outputs across the system.
2020-08-16 16:33:28 +02:00
Nico Weber
430b265cd4 AK: Rename KB, MB, GB to KiB, MiB, GiB
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9".
The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30".

Let's use the correct name, at least in code.

Only changes the name of the constants, no other behavior change.
2020-08-16 16:33:28 +02:00
Linus Groh
2e5c434e22 Misc: Use automatic window positioning in more applications
This is a follow up to #2936 / d3e3b4ae56aa79d9bde12ca1f143dcf116f89a4c.

Affected programs:
- Applications: Browser (Download, View source, Inspect DOM tree, JS
  console), Terminal (Settings)
- Demos: Cube, Eyes, Fire, HelloWorld, LibGfxDemo, WebView,
  WidgetGallery
- DevTools: HackStudio, Inspector, Profiler
- Games: 2048, Minesweeper, Snake, Solitaire
- Userland: test-web

A few have been left out where manual positioning is done on purpose,
e.g. ClipboardManager (to be close to the menu bar) or VisualBuilder (to
preserve alignment of the multiple application windows).
2020-08-15 17:38:19 +02:00
Linus Groh
0cab3bca2f LibGUI: Add and use Window::center_on_screen()
Various applications were using the same slightly verbose code to center
themselves on the screen/desktop:

Gfx::IntRect window_rect { 0, 0, width, height };
window_rect.center_within(GUI::Desktop::the().rect());
window->set_rect(window_rect);

Which now becomes:

window->resize(width, height);
window->center_on_screen();
2020-08-15 17:38:19 +02:00
Ben Wiederhake
cebf8ae3b7 SystemMonitor: ProcessStack is now ThreadStack
This is a follow-up to #3095. In particular:
    https://github.com/SerenityOS/serenity/pull/3095#discussion_r469113354
2020-08-15 13:38:24 +02:00
Andreas Kling
75b8f4e4e6 LibGUI: Make focus events more aware of why focus is changing
This patch adds GUI::FocusEvent which has a GUI::FocusSource.
The focus source is one of three things:

- Programmatic
- Mouse
- Keyboard

This allows receivers of focus events to implement different behaviors
depending on how they receive/lose focus.
2020-08-15 00:05:45 +02:00
Andreas Kling
b97e42dcaa LibGUI: Make ModelSelection non-copyable and non-movable
These are meant to be attached to an AbstractView at all times.
2020-08-14 12:15:11 +02:00
Andreas Kling
686ee2bf04 LibGUI: Rename ModelClient::on_model_update() => model_did_update()
This follows the typical client callback naming scheme used elsewhere
and doesn't collide with the "on_foo" Function hook convention.
2020-08-13 20:18:11 +02:00
Andreas Kling
4088beb8eb LibGUI: Remove Model::sibling() since it's the same as index()
... I'm not sure what the idea was here, but since these functions do
the same thing, let's only have index().
2020-08-13 20:18:11 +02:00
Andreas Kling
82e949aa7c LibGUI: Rename SortingProxyModel "target" to "source" instead 2020-08-13 20:18:11 +02:00
Andreas Kling
6caaa2bfdb FileManager: Remove one direct call to FileSystemModel from outside
We should stop accessing the FileSystemModel outside DirectoryView.
This whole app is pretty badly factored, due to LibGUI being in its
infancy while it first developed.
2020-08-12 20:41:13 +02:00
Andreas Kling
aae296ef08 FileManager: Use FileIconProvider in the properties dialog
This removes the need for the properties dialog to access the internal
data model used by the directory view.
2020-08-12 20:41:13 +02:00
Ben Wiederhake
ef9a3b8e46 Applications: Mark compilation-unit-only functions as static
This enables a nice warning in case a function becomes dead code.
2020-08-12 20:40:59 +02:00
Ben Wiederhake
84e112be6b Browser: Avoid ninja-import of global variable 2020-08-12 20:40:59 +02:00
Linus Groh
7072806234 Meta: Replace remaining LibM/math.h includes with math.h 2020-08-12 16:18:33 +02:00
Ben Wiederhake
81b491a7a4 SystemMonitor: Show PPID, PGID, SID
With this information, it's a bit easier to intuit the current 'process tree'.
If you're reading this, can I convince you to implement a nice process tree for
SystemMonitor? It could be via PPID (unbounded depth), or SID+PGID (depth 3).
Or something else entirely :D
2020-08-12 11:28:45 +02:00
Ben Wiederhake
dbbdb39c1f SystemMonitor: Display the stack of only the selected thread
This uses the new ProcFS interface at /proc/<pid>/stacks/<tid>
2020-08-12 11:28:45 +02:00
Linus Groh
faab8a82cb TextEditor: Show pageview URLs in statusbar on hover 2020-08-11 15:45:02 +02:00
Linus Groh
1353edd090 TextEditor: Open links from Web::PageView using Desktop::Launcher
So far, clicking on a link from the Markdown/HTML preview Web::PageView did
nothing - now we pass that link to Desktop::Launcher, which will then
open it in Browser, FileManager, another TextEditor instance etc.
2020-08-11 15:23:10 +02:00
Andreas Kling
c3b6df60b7 Help: Spruce up the UI with some tasteful layout margins 2020-08-10 21:20:28 +02:00
Andreas Kling
d777583e28 FileManager: Make the desktop process show as "FileManager (Desktop)" 2020-08-10 20:29:08 +02:00
Valtteri Koskivuori
b0ab6b9e3f KeyboardSettings: Preselect the current keymap in the dropdown menu.
This is the little omission that I originally set out to fix, and
sure enough, I got to delve into Kernel land and back to implement
it. Lots of fun!
2020-08-07 09:11:04 +02:00
Nico Weber
ce95628b7f Unicode: Try s/codepoint/code_point/g again
This time, without trailing 's'. Ran:

    git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
2020-08-05 22:33:42 +02:00
Nico Weber
19ac1f6368 Revert "Unicode: s/codepoint/code_point/g"
This reverts commit ea9ac3155d.
It replaced "codepoint" with "code_points", not "code_point".
2020-08-05 22:33:42 +02:00
Andreas Kling
ad2e84b71a Browser: Move bookmarks.json to ~/.config 2020-08-05 17:40:47 +02:00
Andreas Kling
984683cf34 Revert "LibM: Always include <math.h> instead of <LibM/math.h>"
This reverts commit dc12cbca41.

Sadly this broke the build due to some confusion about <new>.
Reverting until this can be solved fully.
2020-08-04 21:17:43 +02:00
Andreas Kling
90dcab381a SystemMonitor: Replace custom ProcessTableView with just GUI::TableView
This class was added in the very early days of LibGUI, when I wasn't
quite sure if subclassing table views made sense or not.
2020-08-04 21:03:53 +02:00
Andreas Kling
dc12cbca41 LibM: Always include <math.h> instead of <LibM/math.h>
This makes Lagom pick up the host math.h, which is what we want.
2020-08-04 19:06:27 +02:00
Andreas Kling
cf624550e5 Terminal: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
256ad7b122 SystemMonitor: Disown child processes after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
27d3971ba6 QuickShow: Disown child process after spawning 2020-08-04 18:17:16 +02:00
Andreas Kling
46ab006c58 FileManager: Disown spawned processes 2020-08-04 18:17:16 +02:00
Andreas Kling
ea9ac3155d Unicode: s/codepoint/code_point/g
Unicode calls them "code points" so let's follow their style.
2020-08-03 19:06:41 +02:00
Ben Wiederhake
64a82100bd SystemMonitor: Provide new 'Inspect' action 2020-08-03 13:02:49 +02:00
Ben Wiederhake
b1f7632610 SystemMonitor: Use icon for 'Profile' action 2020-08-03 13:02:49 +02:00
Ben Wiederhake
45632986a4 SystemMonitor: Try to keep focus in 'Stacks' 2020-08-03 13:02:49 +02:00
Ben Wiederhake
cd39eea7a9 SystemMonitor: Split up kmalloc labels
Otherwise, the numbers overflow the space after a while.
2020-08-03 13:02:49 +02:00
AnotherTest
d366ad8232 PixelPaint: Make GenericConvolutionFilterInputDialog cancellable
Also tweaks the GUI to look a bit less...bad.
2020-08-01 17:44:40 +02:00
AnotherTest
3455876976 Help: Optionally take an argument to search for 2020-08-01 08:39:26 +02:00
AnotherTest
21094b4725 Help: Add a search mode
This closes #2685, and brings some much needed nostalgia :^)
2020-08-01 08:39:26 +02:00
Peter Elliott
4bf4a071a6 Applications: Stop setting initial window location
This will let the WindowManager choose the location of the window
2020-08-01 08:06:48 +02:00
Till Mayer
040848a2af FileManager: Build new path of renamed files correctly
Fixes #2932.
2020-08-01 07:57:15 +02:00
Andreas Kling
ef711f501e LibWeb: Move the Page/Frame/EventHandler classes into Page/ 2020-07-28 19:28:29 +02:00
Andreas Kling
7daeddb9e9 LibWeb: Move the CSS parser into CSS/Parser/ 2020-07-28 19:23:18 +02:00
asynts
21de20825a LibCore: Change the signature of Socket::send() to use Span. 2020-07-27 19:58:09 +02:00
Matthew Olsson
335916d8db LibGfx: Templatize Point, Size, and Rect 2020-07-27 01:06:26 +02:00
Andreas Kling
1f008c95b6 LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
Andreas Kling
11ff9d0f17 LibWeb: Move DOM classes into the Web::DOM namespace
LibWeb keeps growing and the Web namespace is filling up fast.
Let's put DOM stuff into Web::DOM, just like we already started doing
with SVG stuff in Web::SVG.
2020-07-26 20:05:15 +02:00
Andreas Kling
e0b8b4ac67 LibCore+LibGUI: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
Andreas Kling
a565121793 LibWeb: Move HTML object model stuff into LibWeb/HTML/
Take a hint from SVG and more all the HTML classes into HTML instead of
mixing them with the DOM classes.
2020-07-26 17:51:00 +02:00
AnotherTest
9685080bd4 PixelPaint: Add a bunch of spatial filters
This patchset adds a generic convolution matrix spatial filter, and a
few named derivatives such as BoxBlur, Laplacian, Sharpen and
GaussianBlur.
2020-07-25 02:13:43 +02:00
Nico Weber
c4d9d5cc54 Browser: Escape JS source operators for HTML display in console
Console inputs to try before and after this patch:
- `0xffff & 0xff`
- `"a & b"`
- `"<div>"`
- `a &` (to see the escaping in the error hint)
2020-07-23 23:01:16 +02:00
Andreas Kling
65ec655b0d PixelPaint: Add GUI for editing layer names :^) 2020-07-23 20:48:28 +02:00
Andreas Kling
955d3c22c7 PixelPaint: Tidy up the LayerPropertiesWidget GUI layout a bit :^) 2020-07-23 20:43:52 +02:00
Andreas Kling
3a4351b2b5 PixelPaint: Don't hit test non-visible layers 2020-07-23 20:36:07 +02:00
Andreas Kling
b560445c84 PixelPaint: Add a GUI for editing opacity and visibility of layers
Also, make the layer stack rendering respect opacity and visibility.
2020-07-23 20:33:38 +02:00
Andreas Kling
7973f76790 PixelPaint: Scope tool actions to the containing window
We achieve this by deferring the construction of the tool buttons until
the toolbox widget has been added to a window.
2020-07-23 19:53:48 +02:00
Andreas Kling
299824de73 LibGUI: Rename GUI::Image => GUI::ImageWidget
"Image" was a bit too vague, "ImageWidget" is obviously a widget of
some sort.
2020-07-23 17:31:08 +02:00
Nico Weber
107db38a51 Browser: Focus input text field in JS console by default 2020-07-23 13:07:30 +02:00
Sahan Fernando
ccc929dcf9 TextEditor: Preserve preview scroll position across page refreshes 2020-07-20 21:04:19 +02:00
Andreas Kling
f286eb7fcd FileManager: Show a special icon for the home directory
The home-directory icon now shows up in the FileManager title bar,
and alongside the path in the location textbox. Very nice. :^)
2020-07-19 21:37:25 +02:00
Andreas Kling
9710c9742c LibGUI+FileManager: Add setting for showing/hiding dotfiles
GUI::FileSystemModel can now be told to display (or not display) files
whose name start with a dot (other than . and ..)
2020-07-19 21:15:00 +02:00
Andreas Kling
ad57a2f18b FileManager: Use new TextBox::DisplayOnly mode in the properties dialog
Use this instead of disabling the name TextBox. This looks a little bit
nicer than the grayed-out appearance. :^)
2020-07-19 21:15:00 +02:00
Nico Weber
b5565b478f System Monitor: Sort Address column in memory map numerically 2020-07-18 15:52:08 +02:00
Nico Weber
629410b3d6 TextEditor: Auto-select C++ syntax highlighting for more extensions 2020-07-18 15:19:58 +02:00
Tom
65a11fb5f9 LibGUI: Add InputBox::show with required parent window argument
Similar to MessageBox::show, this encourages passing in a window.
2020-07-16 16:10:21 +02:00
Tom
27bd2eab22 LibWeb: Require parent window argument for MessageBox
Since the vast majority of message boxes should be modal, require
the parent window to be passed in, which can be nullptr for the
rare case that they don't. By it being the first argument, the
default arguments also don't need to be explicitly stated in most
cases, and it encourages passing in a parent window handle.

Fix up several message boxes that should have been modal.
2020-07-16 16:10:21 +02:00
Tom
6568765e8f LibGUI: Add parent window argument to FilePicker functions
Since FilePicker almost always should be modal, add the parent
window as mandatory first argument.
2020-07-16 16:10:21 +02:00
Nico Weber
6e0af349a2 FileManager: Make Ctrl-L focus location bar, and change shortcuts for changing view
Ctrl-L focuses the location bar in all file managers I know of,
and does so in SerenityOS's browser too. It should work in
SerenityOS's file manager as well.

Unfortunately, Ctrl-L was already "View List", so change the
shortcuts of all the view modes to Ctrl-1/2/3 which is what
several other file managers use. (I tried Ctrl-Shift-1/2/3
which is what Windows Explorer uses after 8.1, but it didn't
Just Work, and Ctrl-1/2/3 are currently free anyways. If
we ever want to use them for tabs or whatever, we can
change the view shortcuts then.)
2020-07-15 18:30:26 +02:00
Sergey Bugaev
5fd8dbacb1 LibGUI+FileManager: Fix forgetting to map sorting proxy model indexes
Also assert indexes are valid in a few more places.

Finally fixes https://github.com/SerenityOS/serenity/issues/1440 and
https://github.com/SerenityOS/serenity/issues/2787 :^)
2020-07-15 13:41:46 +02:00
Stijn
633301323b FileManager: Add a new file action to FileManager GUI
This action was already present when running FileManager in desktop mode, but now it's also available in windowed mode. :)
2020-07-15 13:26:38 +02:00
thankyouverycool
b2783a234a LibGUI: Use enum for TextEditor modes & add new DisplayOnly mode
Adds a new, more restrictive read-only state to TextEditor which
forbids copying, selecting, editor cursors, and context menus.
Provides a unique appearance on focus which accomodates ComboBox
widgets. All TextEditor modes are now accessed by enum and
set_mode() which sets the editor to Editable, ReadOnly or
DisplayOnly. Updates applications still using set_readonly().
2020-07-15 13:19:44 +02:00
Tom
7739497e34 FileManager: Allow double-clicking applications again
By adding a special LauncherType::Application we can still
get meta data for the application, but also know that we should
consider executing that binary as the default action. LaunchServer
will not do this for us, as it should probably not be allowed to
run arbitrary binaries that haven't been registered as handlers.
2020-07-15 00:11:30 +02:00
Tom
50903fd88c FileManager: Add "Open with" menu if alternative applications are available 2020-07-15 00:11:30 +02:00
Tom
b778804d20 LibGUI: Add ModelClient abstract class and allow registering clients
This solves a problem where the SortingProxyModel doesn't
receive the on_update call because other code overwrote
the handler later on.
2020-07-13 19:49:34 +02:00
Nico Weber
ac2470e66e FontEditor: Don't add duplicate extension in Save As dialog 2020-07-13 15:00:14 +02:00
Andreas Kling
7f394435da Debugger: Add some pledges required by LibLine
These are a bit unfortunate. We should reorganize LibLine so it sets
up the RPC server earlier, then we can drop these pledges later on.
2020-07-12 01:36:45 +02:00
Linus Groh
858f6dc1d1 SystemMonitor: Parse /proc/cpuinfo as JSON 2020-07-11 23:16:16 +02:00
Linus Groh
caa11503b1 DisplaySettings: Fix a typo 2020-07-11 20:24:02 +02:00
Peter Elliott
e650be98a1 Piano: Fix cliping of bottom notes when scrolling in RollWidget
fixes #2577
2020-07-11 18:51:41 +02:00
Peter Elliott
b8cf07166f Piano: Handle octave slider jumps of greater than 1
The previous slider handler relied on the new value being 1 different
than the previous.

fixes #1163.
2020-07-11 18:51:41 +02:00
Tom
8d5fde440a FileManager: Specify "Open in Text Editor" action as default in context menu
Since double-clicking the item would trigger the "Open in Text Editor"
action, specify it as the default action when displaying the
context menu.
2020-07-11 11:45:49 +02:00
Nico Weber
97aaf95265 FontEditor: Add a "Save" menu item 2020-07-11 11:34:38 +02:00
Nico Weber
315dc8d81b FontEditor: Add a "Save as..." menu item 2020-07-11 11:34:38 +02:00
Nico Weber
03e722f664 FontEditor: Add an "Open..." menu item 2020-07-11 11:34:38 +02:00
thankyouverycool
deceb91c48 FileManager: Show an open folder icon for the selected directory
The currently selected directory now displays an open folder icon
in the directory tree.
2020-07-10 19:44:18 +02:00
Nico Weber
2dd40aac4d Piano: Make menu bar consistent with other apps
"Help" should be after "Edit".

The "Quit" menu item should be at the end of the app menu, and
after a separator.
2020-07-07 23:11:08 +02:00
Linus Groh
87465f7c54 Help: Handle external links
Links which do not have the "file" protocol (most commonly links to
external websites - http and https) are now not treated as file paths
anymore but instead handled by Desktop::Launcher.

The same applies to files outside of /usr/share/man.

Fixes #2727.
2020-07-07 17:42:50 +02:00
Andreas Kling
1493dd9dc6 Browser: Simplify the History class and fix back/forward history push
This code was previously relying on the PageView::on_load_start hook
firing synchronously when calling PageView::load(). This was not
happening with WebContentView, so it broke the back/forward history.

Instead, we now differentiate between history navigations and normal
loads in Tab::load(). History navigations don't push new entries into
history, but instead just move the history pointer.
2020-07-07 15:09:26 +02:00
thankyouverycool
d86dbfe9e8 Help: Make section books open and close when toggled
Much more satisfying!
2020-07-07 13:38:35 +02:00
thankyouverycool
27109c3467 Base+Help: Add new Help app icons
This adds a new 32x32 Help application icon, a new open book icon,
copies the current book icon as Help's 16x16 icon, and updates
the Help application file to reflect these changes.
2020-07-07 13:38:35 +02:00
AnotherTest
a163ee8b3b TextEditor: Use ArgsParser and allow the user to specify preview mode
This makes looking at HTML files that somehow fail a little less
painful by allowing the user to actually _see_ the html.
2020-07-06 22:40:38 +02:00
Andreas Kling
a94ef9e021 Browser: Add a way to start Browser in multi-process mode :^)
You can enable the new multi-process mode by using "Browser -m".
2020-07-06 21:50:45 +02:00
Andreas Kling
d8be535579 Browser+LibWeb: Pave the way for using WebContentView in Browser
This commit sets everything up, but we still always instantiate a plain
Web::PageView in Browser::Tab..
2020-07-06 21:46:37 +02:00
Andreas Kling
49b9a0a665 LibWeb: Add a shared WebViewHooks base class for both web view widgets
This will make it easier for Browser to share code between both views.
2020-07-06 21:19:03 +02:00
Andreas Kling
fd65a24834 LibWeb: Make the link context menu hook include the destination URL 2020-07-06 20:00:56 +02:00
Andreas Kling
02c5e22f06 LibWeb: Make the link click hooks include the destination URL
We have all the context needed for relative URL resolution inside the
engine, so let's not make embedders worry about this.
2020-07-06 19:41:10 +02:00
Andreas Kling
0c4b0c0312 Terminal+LibVT: Add "clear including history" action (Ctrl+Shift+K) :^)
Sometimes you just want to get rid of all your scrollback history in
the terminal, and now there's a way to do that.
2020-07-05 23:34:02 +02:00
Andreas Kling
e8a59ef842 DisplaySettings: Fix crash on exit (due to Core::Object on the stack) 2020-07-05 21:17:14 +02:00
Andreas Kling
63d796312d LibWeb: Tweak PageView::on_link_hover hook
Change: on_link_hover(String) -> on_link_hover(URL)

Also, we now fire the hook when a link is unhovered as well, allowing
the embedder to react to nothing being hovered anymore.
2020-07-05 17:02:44 +02:00
Andreas Kling
56d14d5701 LibWeb: Move fragment link handling to Frame
Activating a "#foo" fragment link will now be handled internally by
the Frame instead of involving the widget layer.

If the viewport needs to be scrolled as a result, we will simply ask
the PageClient to scroll a new rect into view.
2020-07-05 15:57:07 +02:00
Andreas Kling
efc335c457 TextEditor: Allow turning off the preview mode
This patch adds a PreviewMode enum with the following values:

- None
- Markdown
- HTML

This makes it a bit more logical to implement exclusive behavior.
2020-07-04 21:21:04 +02:00
Andreas Kling
8476e3933b SystemMonitor: Change default update frequency to 3 seconds
1 second is just too annoyingly jumpy when you're trying to grab
something in the list.
2020-07-04 20:45:37 +02:00
Andreas Kling
bc1ec588f0 TextEditor: Tweak 16x16 icon
In keeping with the slightly-higher-contrast theme.
2020-07-04 19:44:27 +02:00
Andreas Kling
d851863704 Userspace: Remove a bunch of unnecessary Kernel/API/KeyCode.h includes 2020-07-04 17:25:31 +02:00
Andreas Kling
11c4a28660 Kernel: Move headers intended for userspace use into Kernel/API/ 2020-07-04 17:22:23 +02:00
Andreas Kling
ca93c22ae2 LibGUI: Turn GUI::Application::the() into a pointer
During app teardown, the Application object may be destroyed before
something else, and so having Application::the() return a reference was
obscuring the truth about its lifetime.

This patch makes the API more honest by returning a pointer. While
this makes call sites look a bit more sketchy, do note that the global
Application pointer only becomes null during app teardown.
2020-07-04 16:54:55 +02:00
Andreas Kling
1dd1595043 LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it
into a Core::Object allows anyone who needs it to extends its lifetime.
2020-07-04 14:05:57 +02:00
Andreas Kling
8001a85fc7 Browser: Don't crash when inspecting an anonymous LayoutNode
Not all LayoutNodes have a corresponding DOM node.
2020-07-03 21:34:12 +02:00
Linus Groh
1bc326f63b FileManager: Add "Open Terminal here..." action to menu and toolbar
Currently it's only available in the context menu, which isn't quite
obvious.
2020-07-03 12:29:18 +02:00
Nico Weber
526ca68786 SystemMonitor: Correctly check error of posix_spawn()
posix_spawn() has a bit of a whacky API in that it doens't return
0 on success and -1 on failure while writing the error code to
errno -- it instead returns 0 on success and the error code on
error.

So assign the return value to errno so that perror() does the
right thing.
2020-07-02 20:34:06 +02:00
Andreas Kling
a44e52cc14 SystemMonitor: Add "profile process" menu action :^)
You can now start profiling a process directly from SystemMonitor!
This is really neat.
2020-07-01 21:08:16 +02:00
Tom
cdc78515b6 SystemMonitor: Add a utilization graph for each processor 2020-07-01 12:07:01 +02:00
Linus Groh
1cffa28f95 Browser: Unset location bar icon on load start
This avoids having a stale icon from a previous page load in the
location box if a subsequently visited page doesn't trigger an icon
change.
2020-06-30 23:11:01 +02:00
Benoît Lormeau
310fbe48e5 LibVT/Terminal: add a scroll length to the TerminalWidget
The scroll length is the number of lines by which the terminal will go
up/down when scrolling the mouse wheel once.
2020-06-30 18:24:00 +02:00
Andreas Kling
167da1fa84 Browser: Show website favicons in the location bar :^) 2020-06-29 20:35:53 +02:00
Andreas Kling
b8a50e9d89 FileManager: Show a folder icon in the location text box :^) 2020-06-29 20:35:39 +02:00
Nico Weber
12cbc4ad0d Everywhere: Replace some uses of fork/exec with posix_spawn
It's less code, and it's potentially more efficient once
posix_spawn is a real syscall.
2020-06-29 12:04:27 +02:00
devashish
9f58624802 DisplaySettings: Allow setting wallpapers from outside /res/wallpapers
Ideally, we would copy the file to `/res/wallpapers`, add an entry to
`ComboBox` model and set the index to this entry. I didn't want to
touch anything outside of `DisplaySettings`, so this is more of a
workaround :^)
2020-06-28 00:06:09 +02:00
Andrew Kaster
3a4e121904 Browser: Add right-click context menu to tabs
Right clicking on a position in the PageView of a tab will open a
context menu with common actions like back, forward, reload, view
source and inspect DOM. :^)
2020-06-28 00:05:08 +02:00
Hüseyin ASLITÜRK
d28a824d4c
QuickShow: Fix for zooming with mouse wheel (#2650)
Fixes #2648.
2020-06-28 00:04:11 +02:00
Andreas Kling
85ac7dc1b1 TextEditor: Add live preview for HTML documents :^)
This allows you to edit HTML and see the changes live. This feature is
possibly my favorite feature in the world right now.
2020-06-26 22:47:29 +02:00
Andreas Kling
981f403287 IRCClient: Remove duplicate <div> wrapper around colored messages 2020-06-26 11:59:04 +02:00
Andreas Kling
6293d1a13c LibWeb+Browser: Remove old HTML parser :^)
The new parser is now used everywhere and it's working pretty well!
2020-06-26 00:53:25 +02:00
Andreas Kling
6c783dbf62 IRCClient: Use Web::Element::set_inner_html()
Instead of invoking the (old) fragment parser directly.
2020-06-26 00:53:25 +02:00
Andreas Kling
10255bc5c6 LibWeb+Browser: Decode non-animated images out-of-process :^)
We now use the ImageDecoder service in LibWeb for everything except
GIF images (we'll have to deal with them later, ofc.)

This has a little bit of overhead but we should be able to optimize
it until it becomes negligible.
2020-06-22 21:47:01 +02:00
Andreas Kling
1f97897b40 TextEditor: Use Web::PageView::load_html() for the markdown preview 2020-06-21 21:54:30 +02:00
Andreas Kling
1c54272b41 Help: Use Web::PageView::load_html()
Instead of invoking the HTML parser directly.
2020-06-21 21:54:30 +02:00
Hüseyin ASLITÜRK
0001bbf182 QuickShow:If image is larger then window size resize it to fit the image 2020-06-18 23:18:11 +02:00
Hüseyin ASLITÜRK
79de1a33cf QuickShow: Add a new "Set as desktop wallpaper" action under Image menu 2020-06-18 23:18:11 +02:00
Till Mayer
5bd0015583 FileManager: Small improvements to PropertyDialog's apply button logic
The apply button used to be enabled directly after opening the dialog.
Changes in the permissions now enable/disable the apply button as well.
2020-06-18 23:14:13 +02:00
Andreas Kling
fe458f81ec KeyboardSettings: Call out to /bin/keymap to actually set the keymap
Now that KeyboardSettings is no longer setuid-root, we have to call out
to a helper program to actually set the keymap.

This is a very nice improvement to system security. :^)
2020-06-18 22:29:09 +02:00
Andreas Kling
6e78279614 keymap: Add back a tiny utility for setting the system keyboard layout
This patch removes the setuid-root flag from the KeyboardSettings GUI
application and adds back the old "keymap" program.

It doesn't feel very safe and sound to have a GUI program runnable
as setuid-root, so in the next patch I'll be making KeyboardSettings
call out to the "keymap" program to do its bidding.
2020-06-18 22:19:57 +02:00
William McPherson
34ee76984c Piano: Expose multi-track functionality
This commit adds some actions for creating and cycling through tracks.

set_octave_and_ensure_note_change() was refactored to allow switching
tracks to implement the same behaviour.

KnobsWidget is getting pretty bad.
2020-06-18 16:42:37 +02:00
William McPherson
ee52572ca1 Piano: Allow multiple tracks internally
This commit adds multi-track functionality without exposing it to the
user.

All I really did was rename AudioEngine to Track and allow more than one
Track in TrackManager. A lot of the changes are just changing widgets to
take a TrackManager and use current_track().

The TrackManager creates Tracks and gives them a read-only reference to
the global time value. When the TrackManager wants to fill a sample in
the buffer (in fill_buffer()), it calls fill_sample() on each Track.

The delay code is slightly different - a Track will fill its
m_delay_buffer with the sample it just created rather than the most
recent sample in the buffer (which used to be the same thing).

TrackManager manages the current octave.

Other than those few things, this is a pretty basic separation of
concerns.
2020-06-18 16:42:37 +02:00
Hüseyin ASLITÜRK
db5b28b78e DownloadWidget: Use GUI::Image instead of Label to show image 2020-06-18 16:35:57 +02:00
Hüseyin ASLITÜRK
d139df706a Welcome: Replace Label with Image component to show banner and app icon 2020-06-18 16:35:57 +02:00
Hüseyin ASLITÜRK
02eb268c3e FileManager: Replace Label with Image component to show icons 2020-06-18 16:35:57 +02:00
Sergey Bugaev
363b7351b8 FileManager: Use Core::File::read_link() 2020-06-17 15:02:03 +02:00
Hüseyin ASLITÜRK
ea1ebe8662 QuickShow: Add reset zoom action to toolbar
When zoom reset also reset pan origin
2020-06-16 14:42:18 +02:00
Hüseyin ASLITÜRK
bf3d98012a QuickShow: Switch to full screen mode on double click
More respect to user behavior on image viewers :)
2020-06-16 14:42:18 +02:00
Hüseyin ASLITÜRK
1887e35dc8 KeyboardMapper: Replace char data type to u32 for code point 2020-06-16 13:15:17 +02:00
Hüseyin ASLITÜRK
3a903babee QuickShow: Use new Bitmap::is_path_a_supported_image_format method 2020-06-15 22:42:23 +02:00
Andreas Kling
1678aaa555 ProtocolServer+LibProtocol: Propagate HTTP status codes to clients
Clients now receive HTTP status codes like 200, 404, etc.
Note that a 404 with content is still considered a "successful"
download from ProtocolServer's perspective. It's up to the client
to interpret the status code.

I'm not sure if this is the best API, but it'll work for now.
2020-06-13 22:20:37 +02:00
Matthew Olsson
e8e728454c AK: JsonParser improvements
- Parsing invalid JSON no longer asserts
    Instead of asserting when coming across malformed JSON,
    JsonParser::parse now returns an Optional<JsonValue>.
- Disallow trailing commas in JSON objects and arrays
- No longer parse 'undefined', as that is a purely JS thing
- No longer allow non-whitespace after anything consumed by the initial
  parse() call. Examples of things that were valid and no longer are:
    - undefineddfz
    - {"foo": 1}abcd
    - [1,2,3]4
- JsonObject.for_each_member now iterates in original insertion order
2020-06-13 12:43:22 +02:00
Hüseyin ASLITÜRK
3ebdb5ea30 Application: KeyboardMapper, make button to like a real key
Change key paint to more like a real key :)
2020-06-13 12:36:30 +02:00
Andreas Kling
6f19067c9a LibWeb+Browser: Add a barebones LayoutTreeModel to the inspector window
This allows you to inspect the layout tree, along side the DOM tree.
It will need more functionality to be truly useful, but it's a start.
2020-06-12 22:30:11 +02:00
Andreas Kling
68ae1de463 Browser: Be a little bit smarter about interpretering command line URLs
If the (optional) URL specified on the command line is an existing file
we now resolve its real path before turning into a URL. This makes
relative URLs inside the loaded document work correctly.

Also interpret all other specified URLs the same way we would if you
had typed them into the location bar.
2020-06-12 21:29:27 +02:00
Andreas Kling
fdfda6dec2 AK: Make string-to-number conversion helpers return Optional
Get rid of the weird old signature:

- int StringType::to_int(bool& ok) const

And replace it with sensible new signature:

- Optional<int> StringType::to_int() const
2020-06-12 21:28:55 +02:00
Sergey Bugaev
eb3700c565 Calendar: Fix using OwnPtr<> with RefCounted types 2020-06-12 16:08:45 +02:00
Andreas Kling
116cf92156 LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
2020-06-10 10:59:04 +02:00
Andreas Kling
5042e560ef LibJS: Make more Interpreter functions take a GlobalObject& 2020-06-08 21:25:16 +02:00
Andreas Kling
92392398a2 LibWeb: Add Page abstraction between PageView and main Frame
* A PageView is a view onto a Page object.
* A Page always has a main Frame (root of Frame tree.)
* Page has a PageClient. PageView is a PageClient.

The goal here is to allow building another kind of view onto
a Page while keeping the rest of LibWeb intact.
2020-06-08 21:12:20 +02:00
Hüseyin ASLITÜRK
ddeb0ab1ad Applications: Add new KeyboardSettings application
GUI application to manage Keyboard settings.
2020-06-08 09:28:18 +02:00
Andreas Kling
896db187e5 LibWeb: Move Frame.{cpp,h} into a new Frame/ directory 2020-06-07 10:14:41 +02:00
Andreas Kling
d127492f0e TextEditor: Allow "TextEditor foo.txt" to create a new file
Attempting to open a non-existent file from the command line should not
fail, it should just open a new text document with that name. Note that
the file is not created until you actually save it.
2020-06-04 22:15:10 +02:00
Andreas Kling
959de19418 LibWeb: Process style sheets in document order
Until now we would simply apply stylesheets in the order they finished
loading. This patch adds a StyleSheetList object that hangs off of each
Document and contains all the style sheets in document order.

There's still a lot of work to do for a proper cascade, but at least
this makes us consistently wrong every time. :^)
2020-06-04 16:06:32 +02:00
Hüseyin ASLITÜRK
d315281d56 PixelPaint: Use new app-pixel-paint.png for app icon 2020-06-04 12:34:31 +02:00
Andreas Kling
6c09420571 KeyboardMapper: Add missing #pragma once 2020-06-03 22:06:08 +02:00
Hüseyin ASLITÜRK
d3578fdf9b Applications: Add new KeyboardMapper application
New editing app for keymap files.
2020-06-03 21:52:40 +02:00
Sergey Bugaev
e651af21f8 Calculator: Set text color through the palette
Unfortunately, this means the Calculator won't pick up system theme changes
dynamically.

Fixes https://github.com/SerenityOS/serenity/issues/1077
2020-06-02 21:49:47 +02:00
Linus Groh
a48080f62d LibJS: Move Interpreter::get_trace() to ConsoleClient
Having it globally on the interpreter is confusing as the last call frame
is skipped, which is specific to console.trace().
2020-06-02 15:22:34 +02:00
Linus Groh
871d88cd91 FontEditor: Fix typo in comment
s/Ediyor/Editor/
2020-06-02 14:38:17 +02:00
Andreas Kling
6ed11f1d1c LibWeb: Move ResourceLoader into a new Loader/ directory 2020-06-01 20:42:50 +02:00
Andreas Kling
8766e49a7c LibWeb+Browser: Use the new HTML parser by default
You can still run the old parser with "br -O", but the new one is good
enough to be the default parser now. We'll fix issues as we go and
eventually remove the old one completely. :^)
2020-06-01 19:08:31 +02:00
Andreas Kling
1a15ca2de4 Browser: Show download progress in the taskbar if available 2020-05-30 23:00:35 +02:00
FalseHonesty
20faa93cb0 LibMarkdown: Change internal MD API to return OwnPtrs
Previously, all Markdown blocks had a virtual parse method which has
been swapped out for a static parse method returning an OwnPtr of
that block's type.

The Text class also now has a static parse method that will return an
Optional<Text>.
2020-05-30 00:32:12 +02:00
FalseHonesty
7ca562b200 LibMarkdown: Change MD Document parse API to return a RefPtr
Markdown documents are now obtained via the static Document::parse
method, which returns a RefPtr<Document>, or nullptr on failure.
2020-05-30 00:32:12 +02:00
FalseHonesty
9a2177437b Browser: Add clear output button to the console 2020-05-29 22:14:45 +02:00
Emanuele Torre
937d0be762 Meta: Add a script check the presence of "#pragma once" in header files
.. and make travis run it.

I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.

It also checks the presence of a (single) blank line above and below the
"#pragma once" line.

I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.

I also ran clang-format on the files I modified.
2020-05-29 07:59:45 +02:00
Gabriel Mihalache
8e151ff33e
PixelPaint: Set active layer to nullptr after its removal (#2433)
This prevents a crash if removal was called twice, without setting a
new active layer in the meanwhile.
2020-05-29 07:58:22 +02:00
Sergey Bugaev
4b300e085d Userland+SystemMonitor: Recognize the MS_RDONLY mount flag 2020-05-29 07:53:30 +02:00
Andreas Kling
42243d2e06 LibWeb: Rename Web::HtmlView => Web::PageView
This widget doesn't just view HTML, it views a web page. :^)
2020-05-28 18:22:54 +02:00
Andreas Kling
e026a50777 Browser: Switch focus to the web page after pressing return in URL bar
Instead of dropping focus entirely, which felt weird.
2020-05-28 18:18:20 +02:00
Emanuele Torre
97b5fbda7f IRCClient: remove some unused headers and replace tabs with spaces 2020-05-28 17:01:31 +02:00
FalseHonesty
112b4de430 IRCClient: Enable history on the message box 2020-05-28 10:33:20 +02:00
Andreas Kling
2cb50f6750 LibWeb+Browser: Add ability to run Browser with the new HTML parser
You can now pass "-n" to the browser to use the new HTML parser.
It's not turned on by default since it's still very immature, but this
is a huge step towards bringing it into maturity. :^)
2020-05-27 21:57:30 +02:00
FalseHonesty
08e2907210 Browser: Add console history to re-send old commands
The console has now enabled history in its input text box. Pretty
nice to not have to retype things all the time :^)
2020-05-27 20:04:52 +02:00
Nick Vella
e53fa97cfb LibGUI, About: Implement system-wide W2k-esque About dialog
The new About dialog reads version information from /res/version.ini,
which is generated at build time.
2020-05-27 11:44:19 +02:00
AnotherTest
70a213a6ec LibLine: Use Core::EventLoop for outer read loop
This commit changes LibLine's internal structure to work in an event
loop, and as a result, also switches it to being a Core::Object.
2020-05-27 11:13:02 +02:00
FalseHonesty
e4760e5b42 Browser: Add option in DownloadWidget to open download's in folder
When a download has completed, instead of graying out the cancel
option, replace it with an option to open your download in the file
manager.
2020-05-26 21:09:45 +02:00
Linus Groh
0f2b3cd280 Browser: Show a "source location hint" for syntax errors :^) 2020-05-26 14:36:30 +02:00
Sergey Bugaev
602c3fdb3a AK: Rename FileSystemPath -> LexicalPath
And move canonicalized_path() to a static method on LexicalPath.

This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
2020-05-26 14:35:10 +02:00
Sergey Bugaev
4139838a93 Userland et al: Pledge sigaction when needed
* In some cases, we can first call sigaction()/signal(), then *not* pledge
  sigaction.
* In other cases, we pledge sigaction at first, call sigaction()/signal()
  second, then pledge again, this time without sigaction.
* In yet other cases, we keep the sigaction pledge. I suppose these could all be
  migrated to drop it or not pledge it at all, if somebody is interested in
  doing that.
2020-05-26 14:35:10 +02:00
Andreas Kling
b5788594f9 PixelPaint: Let Layer track whether it's selected or not
This will simplify a lot of code that keeps getting more confusing.
2020-05-26 10:18:03 +02:00
Andreas Kling
18d68c8c94 PixelPaint: Add selection functionality to the LayerListWidget
Now we can get rid of the old table view and with it the LayerModel.
2020-05-26 10:18:03 +02:00
Andreas Kling
e4b11a23b7 PixelPaint: Allow reordering layer by dragging them in LayerListWidget
This is rather cool! :^)
2020-05-26 10:18:03 +02:00
Andreas Kling
dc3de47b03 PixelPaint: Have layers and images send out notifications on changes
We use this to automatically update the thumbnail in LayerListWidget
when you draw into a layer. We also use it to repaint the ImageEditor
when the image changes somehow. :^)
2020-05-26 10:18:03 +02:00
Andreas Kling
de85cd0907 PixelPaint: Start working on a custom layer list widget
Instead of using a TableView to show the layer stack, let's build a new
custom widget for this purpose and give it some neat features!

This patch also introduces an ImageClient interface for Image to notify
interested parties about things happening. The LayerListWidget is the
first ImageClient and listens for "layer added" and "layer removed"
notifications. :^)
2020-05-26 10:18:03 +02:00
FalseHonesty
d2b493b74e Browser: Add output styles to JS source printed in the console
This patch uses the new JS::MarkupGenerator to stylize all of the
source code and runtime values printed in the console's output panel.
This also does away with the Console's global style sheet, as all
styling is handled by the MarkupGenerator and the System Palette.
2020-05-26 10:17:50 +02:00
FalseHonesty
941b028ca3 LibJS: Create JS to HTML markup generator
The new JS::MarkupGenerator class can convert both a JS source string
and a JS Runtime Value into properly formatted HTML using the new
LibWeb System Palette css color values.

It makes more sense for this JS -> HTML process to occur in LibJS
so that it can be used elsewhere, namely Markdown code block syntax
highlighting. It also means the Browser can worry less about LibJS
implementation details.
2020-05-26 10:17:50 +02:00
AnotherTest
2814b5a918 Terminal: Handle fork error by whining about it 2020-05-25 21:36:51 +02:00
AnotherTest
bc9013f706 LibLine: Change get_line to return a Result<String, Error>
This fixes a bunch of FIXME's in LibLine.
Also handles the case where read() would read zero bytes in vt_dsr() and
effectively block forever by erroring out.

Fixes #2370
2020-05-25 21:36:51 +02:00
Linus Groh
c378a1c730 HexEditor: Fix "Selected Bytes" count for backwards selection 2020-05-25 18:14:25 +02:00
FalseHonesty
2c2ce5be64 Browser: Add output styles to values printed in the console
This patch adds spans around most of the console's output, allowing
for a global document stylesheet to customize the highlighting of
the console's output. It also adds some basic styling for values
like strings, numbers, and arrays using the system Palette.

Note: This patch simply adds support for highlighting output values,
the lines of JS code printed to console are still unformatted.
2020-05-25 11:33:52 +02:00
Andreas Kling
bdc19563ef Browser: Add new icons for the add/remove bookmark toolbar button
Here's a freshly drawn icon without antialiasing so it fits better with
the system visual style. :^)
2020-05-24 18:46:48 +02:00
Itamar
bedce69b23 Debugger: Use Core::ArgsParser 2020-05-24 10:42:21 +02:00
FalseHonesty
20df82c983 Browser: Set the console's interpreter when a tab's document changes
Previously, once a console was opened for a tab, its interpreter
would never change, leaving it with a stale interpreter. Now, when
the tab's HtmlView loads a new document, the console will receive
that document's interpreter.
2020-05-24 02:20:08 +02:00
FalseHonesty
391237a8e1 Browser: Add JS Console
The JavaScript console can be opened with Control+I, or using
the menu option. The console is currently a text box with JS
syntax highlighting which will send commands to the document's
interpreter. All output is printed to an HTML view in the console.
The output is an HtmlView to easily allow complex output, such
as expandable views for JS Objects in the long run.
2020-05-24 02:20:08 +02:00
FalseHonesty
78412ee76d Browser: An anchor link should open in a new tab when required
Previously, clicking on an anchor link (href="#section1")
would always scroll to it on the current page, even if control was
held or the target="_blank" attribute was set. This fixes that
behaviour, and the link will always open in a new tab if required.
2020-05-23 11:53:25 +02:00
FalseHonesty
d32889b19d Browser: Add "Paste & Go" action to the location box 2020-05-23 01:30:20 +02:00
FalseHonesty
5431e81bc3 Browser: Pop up a context menu when requested on a bookmark button
This right click context menu currently allows for the removal of
bookmarks as well as opening them in a new tab.
2020-05-22 18:23:02 +02:00
Andreas Kling
9fc4ad2a52 PixelPaint: Make the EllipseTool previews work while zoomed in 2020-05-22 15:57:04 +02:00
Andreas Kling
d12cce76a7 PixelPaint: Make the RectangleTool previews work while zoomed in 2020-05-22 14:57:10 +02:00
Andreas Kling
f57df29724 PixelPaint: Make the LineTool previews work while zoomed in 2020-05-22 14:45:14 +02:00
Andreas Kling
84b508befa PixelPaint: Rename original_event => image_event
These events are in image coordinates, not really original coordinates.
2020-05-21 22:56:32 +02:00
FalseHonesty
9241c3a957 Browser: Pop up a context menu when one is requested on a tab
Currently, the tab's context menu only has options to reload and
close, but this patch allows for those options to be quickly
expanded!
2020-05-21 21:53:17 +02:00
Andreas Kling
2adb0a07e5 LibGUI: Get rid of Model::ColumnMetadata and always use auto-sizing
Auto-sizing of view columns is now enabled by default. This removes the
last remaining need for ColumnMetadata, so this patch gets rid of it.
2020-05-21 19:55:44 +02:00
Andreas Kling
2e03bded43 LibGUI: Add Model::Role::TextAlignment and remove from ColumnMetadata 2020-05-21 19:55:44 +02:00
Andreas Kling
3c819b8ff4 Applications: Sort CMakeLists.txt alphabetically :^) 2020-05-21 19:55:44 +02:00
Hüseyin ASLITÜRK
ef49309807 Applications: Convert 256 char font to 384 char font 2020-05-21 01:19:42 +02:00
Andreas Kling
bf9e190533 PixelPaint: Support panning and scaling the image we're working on :^)
ImageEditor now supports panning (Ctrl+MiddleMouse) and scaling (Wheel)
the image. This took a lot of unpleasant coordinate math, but now it
actually kinda works and feels awesome! :^)
2020-05-20 22:30:42 +02:00
Andreas Kling
58fa9c6e89 PixelPaint: Rename from PaintBrush :^) 2020-05-20 20:35:35 +02:00
Andreas Kling
250c3b363d Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem"
This reverts commit c1eb744ff0.
2020-05-20 16:24:26 +02:00
Andrew Kaster
c1eb744ff0 Build: Include headers from LibC, LibM, and LibPthread with -isystem
Make sure that userspace is always referencing "system" headers in a way
that would build on target :). This means removing the explicit
include_directories of Libraries/LibC in favor of having it export its
headers as SYSTEM. Also remove a redundant include_directories of
Libraries in the 'serenity build' part of the build script. It's already
set at the top.

This causes issues for the Kernel, and for crt0.o. These special cases
are handled individually.
2020-05-20 08:37:50 +02:00
Linus Groh
0edfd45451 FileManager: Remove empty public access modifier from DesktopWidget 2020-05-19 19:25:41 +02:00
Linus Groh
e5ea243842 Browser: Hide tab bar if there's only one tab 2020-05-19 17:42:48 +02:00
Linus Groh
f4a941a5d7 Browser: Support fullscreen view 2020-05-19 17:42:48 +02:00
Andreas Kling
3d5233ae40 FileManager: Make the location box 2px taller 2020-05-18 17:51:09 +02:00
Andreas Kling
9895405b7c Browser: Make the location box 2px taller 2020-05-18 17:50:44 +02:00
Andreas Kling
22cd861c7e Calculator: Set a fixed-width font on the text box
GUI::TextEditor does not yet support right-aligned variable-width fonts
so just switch this to a fixed-width font for now.
2020-05-18 16:48:54 +02:00