Commit graph

1377 commits

Author SHA1 Message Date
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
Sergey Bugaev
acc107a44f FileManager+LibGUI+Userland: Switch clipboard to MIME types
We will now actually use MIME types for clipboard. The default type is now
"text/plain" (instead of just "text").

This also fixes some issues in copy(1) and paste(1).
2020-05-16 09:11:46 +02:00
Andreas Kling
244efe050a Clipboard: Move the system clipboard to a dedicated service process :^)
This commit moves the clipboard from WindowServer into a new Clipboard
service program. Clipboard runs as the unprivileged "clipboard" user
and with a much tighter pledge than WindowServer.

To keep things working as before, all GUI::Application users now make
a connection to Clipboard after making the connection to WindowServer.
It could be interesting to connect to Clipboard on demand, but right
now that would necessitate expanding every GUI app's pledge to include
"unix" and also unveiling the clipboard portal, which I prefer not to.
2020-05-14 22:53:58 +02:00
Sergey Bugaev
450a2a0f9c Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
2020-05-14 20:15:18 +02:00
Pierre
49727ffee4 PaintBrush: Added 'Move active layer up/down' to the Menu
This allowes the active layer to be moved up or down.
2020-05-14 14:44:27 +02:00
Pierre
80a360683f PaintBrush: Add 'Remove active layer' to the Menu
This allows the active Layer to be removed through the Menu or by using
the shortcut Ctrl+D.
2020-05-14 14:44:27 +02:00
Andreas Kling
31c178b9b5 PaintBrush: Start the app with an "empty" single layer image :^) 2020-05-13 22:28:33 +02:00
Andreas Kling
40a72883ff PaintBrush: Add "Delete layer" action to move tool context menu 2020-05-13 22:12:14 +02:00
Andreas Kling
b25c6ab884 PaintBrush: Tweak initial main window size 2020-05-13 22:12:03 +02:00
Andreas Kling
720ebee1be PaintBrush: Add move tool context menu with "move to back/front"
Tools can now have an in-image context menu which you get when right-
clicking inside the image editing area. Our first use of this is to
provide the ability to move layers to the back/front. :^)
2020-05-13 22:03:29 +02:00
Andreas Kling
02d9cf2039 PaintBrush: Tool::on_contextmenu() => on_tool_button_context_menu() 2020-05-13 21:51:43 +02:00
Andreas Kling
72e57561a1 PaintBrush: Activate tool properly when right-clicking tool button
If we don't go via the action, the tool button becomes checked which
can bypass the exclusivity mechanism. That should probably also be
fixed but it's far outside the scope of where I am right now. :^)
2020-05-13 21:50:13 +02:00
Andreas Kling
410cdba5a9 PaintBrush: Switch the active layer when clicking one with move tool
This feels very intuitive and nice, although maybe we need some way to
override this behavior for the scenario where you're intending to move
something currently behind something else.
2020-05-13 21:46:19 +02:00
Andreas Kling
0f77be046f PaintBrush: Draw an outline around the image boundaries 2020-05-13 21:29:50 +02:00
Andreas Kling
a95ed3fdcc PaintBrush: Add keyboard shortcuts for selecting different layers 2020-05-13 21:25:13 +02:00
Andreas Kling
4cf3f00bab PaintBrush: Add "Create new layer..." action
This action pops up a dialog asking for a name + dimensions. If OK is
clicked, you get a new layer with those specifications. :^)
2020-05-13 21:16:55 +02:00
Andreas Kling
0f3e58ffe0 PaintBrush: Clip layer contents outside the image rect when compositing 2020-05-13 21:12:32 +02:00
Andreas Kling
7ca9259ffd PaintBrush: Don't paint over the nice GUI::Frame around ImageEditor 2020-05-13 19:49:38 +02:00
Andreas Kling
98cb442edf PaintBrush: Add a "Tool" menu and put all the tools in it 2020-05-13 19:49:38 +02:00
Andreas Kling
2c45076e68 PaintBrush: Let's have a tool (pen) checked on startup 2020-05-13 15:06:11 +02:00
Andreas Kling
1631077b74 PaintBrush: Put all the tool buttons into an action group
This allows us to easily make them exclusive and uncheckable. :^)
2020-05-13 14:48:17 +02:00
Andreas Kling
0de3b1c4bf PaintBrush: Oops, fix typo in ImageEditor::keyup_event() 2020-05-13 14:37:12 +02:00
Andreas Kling
d045972559 PaintBrush: Add keyboard shortcuts for all tools
I've used the shortcuts from GIMP for the most part, since that's what
I'm used to. We can definitely iterate on these to find better options
as the app develops. :^)
2020-05-13 14:23:08 +02:00
Andreas Kling
24f9406784 PaintBrush: Most tools still care about mousemoves outside layer
This allows you to do things like start a line outside the layer,
or spray a little outside but still partly hitting the layer. :^)
2020-05-13 13:50:35 +02:00
Andreas Kling
96d03546ef PaintBrush: Make the line, rectangle and ellipsis preview work again
You can now see what you're drawing before committing to it. This works
by passing the second_paint_event from the ImageEditor to the tool.
We also pass the active layer which makes it easier for the tool to
keep his logic in layer-relative coordinates even while drawing preview
states directly into the ImageEditor backing bitmap.
2020-05-13 13:43:20 +02:00
Andreas Kling
8318842c7e PaintBrush: Make the move tool handle arrow key events
You can now nudge layers around with the arrow keys. :^)
2020-05-13 13:21:49 +02:00
Andreas Kling
06405e83d7 PaintBrush: Make ImageEditor forward keydown and keyup events to tool 2020-05-13 13:21:49 +02:00
Andreas Kling
55d96715ff PaintBrush: Make the ImageEditor accept focus 2020-05-13 13:21:49 +02:00
Andreas Kling
8882b6bd9a PaintBrush: Remove the PaintableWidget
Moved the current colors to ImageEditor for now, although I don't think
that will be their final home.
2020-05-13 13:21:47 +02:00
Andreas Kling
fbeaf76f96 PaintBrush: Update the LayerModel when moving layers around
This ensures that the layer table view always shows the correct
coordinates for the layer.
2020-05-13 00:21:13 +02:00
Andreas Kling
40ffa8c626 PaintBrush: Switch to the "move" cursor while moving layers around 2020-05-13 00:16:54 +02:00
Andreas Kling
3d50f40396 PaintBrush: Add a "Move" tool for moving layers around :^)
Tool mouse event handlers now receive both a layer-relative mouse event
and the original event. This is needed for the move tool since it moves
the layer and thereby changes the origin of future events every time it
moves.
2020-05-13 00:09:04 +02:00
Andreas Kling
58ee75c87a PaintBrush: Silence debug spam in Image compositing 2020-05-13 00:00:24 +02:00
Andreas Kling
9566f6c8b3 PaintBrush: Let's have Layer::rect() and Layer::relative_rect()
These two have the same semantics as GUI::Widget. The rect() is always
at location { 0, 0 }, while the relative_rect()'s location is relative
to the "parent", which in this case is the Layer's Image.
2020-05-12 23:49:52 +02:00
Andreas Kling
83d24dcb1d PaintBrush: Port all the existing toolbox tools to the Layer world :^)
Many tools are not working perfectly right yet, but we'll fix them!
2020-05-12 23:44:46 +02:00
Andreas Kling
35c2d389f5 PaintBrush: Show the layer stack in a table view on the right hand side 2020-05-12 23:00:23 +02:00
Andreas Kling
985c2550c1 PaintBrush: Start refactoring to support layer-based images
The main editing widget is now the new ImageEditor widget, which works
on an Image object, which internally has a stack of Layer objects.

Layers are composited back-to-front when painting the Image inside an
ImageEditor.
2020-05-12 22:22:45 +02:00
Andreas Kling
a87f5e4154 Browser: Allow Ctrl+clicking on bookmark bar buttons :^) 2020-05-12 20:35:45 +02:00
Andreas Kling
977863ea07 LibGUI: Include keyboard modifier state with button on_click calls
This will allow you us to implement special behavior when Ctrl+clicking
a button.
2020-05-12 20:31:16 +02:00
Andreas Kling
3a905aed06 SystemMonitor: Remove the toolbar above the process table
This was looking a bit too whimsical and didn't really fit with the
overall look of the window anymore. The actions are available via
the context menu still.
2020-05-12 19:51:36 +02:00
Andreas Kling
388ae07960 Browser: Some action fixes
- Use the same reload action in menu and toolbar
- Scope more actions inside Browser::Tab
2020-05-12 17:07:20 +02:00
Andreas Kling
20f50f9133 LibProtocol: Pass response headers in a case insensitive HashMap
HTTP headers are case-insensitive, so just add CaseInsensitiveTraits
to the HashMap and we're good to go! :^)
2020-05-10 22:32:12 +02:00
Andreas Kling
aef5d28828 Browser: Allow opening URLs by dropping them on the HtmlView :^) 2020-05-10 22:32:12 +02:00
Andreas Kling
f1708b3832 LibWeb: Teach HtmlView how to render Markdown files :^) 2020-05-10 22:32:12 +02:00
Andreas Kling
5fcd25e8f6 Browser: Use "about:blank" as the default home page
This can be overridden in Browser.ini, but if there's no value there,
we now use "about:blank"
2020-05-10 11:18:47 +02:00
Andreas Kling
fe0de26277 LibWeb+Browser: Support about: URL protocol so "about:blank" works :^)
For now, we simply load an empty resource from any about: URL.
2020-05-10 11:14:30 +02:00
FalseHonesty
60024ab574 Browser: Close tabs when middle clicked 2020-05-09 23:54:20 +02:00
Linus Groh
e92e919724 Browser: Add missing copyright header to WindowActions.{cpp,h} 2020-05-09 23:45:16 +02:00
Andreas Kling
f41cd808de TextEditor: Use JS syntax highlighting for .json files :^) 2020-05-09 16:48:28 +02:00
Andreas Kling
f596b12a04 LibVT+Terminal: Support hyperlinks in the terminal :^)
We now support basic hyperlinking in the terminal with <OSC>;8;;URL<ST>
Links are opened via LaunchServer on Ctrl+LeftMouse.
2020-05-09 16:16:16 +02:00
Nicholas Hollett
b7810a31c3 LibDesktop: Switch to LaunchServer for DesktopServices::open
Moves DirectoryServices out of LibCore (because we need to link with
LibIPC), renames it Desktop::Launcher (because Desktop::DesktopServices
doesn't scan right) and ports it to use the LaunchServer which is now
responsible for starting programs for a file.
2020-05-09 15:13:32 +02:00
Hüseyin ASLITÜRK
3874664752 Applications: FontEditor, relocate form items by fonts size
FontEditor widget rewritten for respect to the font size and added fixed width and height header values.
2020-05-09 10:00:13 +02:00
Andreas Kling
239fd33405 Services: Move Taskbar and SystemMenu from Applications to Services 2020-05-08 22:00:41 +02:00
Andreas Kling
cf3b58fbe8 Services: Renamed from Servers
It didn't feel right to have a "DHCPClient" in a "Servers" directory.
Rename this to Services to better reflect the type of programs we'll
be putting in there.
2020-05-08 21:57:44 +02:00
Andreas Kling
788293ead8 Browser: Move InspectorWidget into the Browser namespace 2020-05-08 21:38:30 +02:00
Hüseyin ASLITÜRK
39a8db936a Applications: Replace SystemMenu name to hi voltage emoji 2020-05-08 09:49:41 +02:00
Nick Tiberi
9d0c6a32bd Browser: Show line numbers when viewing page source 2020-05-07 22:59:40 +02:00
Linus Groh
85b69e54e4 Browser: Escape percent sign in download progress format string
Otherwise the following is printed:

printf_internal: Unimplemented format specifier   (fmt: 0% of %s)
2020-05-07 16:01:03 +02:00
Maciej Sobaczewski
8989300851
Browser: Assume http:// when no protocol is provided in the location bar (#2142) 2020-05-07 11:57:53 +02:00
FalseHonesty
8182a709e3 Browser: Open links in a new tab when middle clicked 2020-05-06 21:59:29 +02:00
Linus Groh
9dbab2d05e Misc: Replace "String(string_view)" with "string_view.to_string()"
StringView::to_string() was added in 917ccb1 but not actually used
anywhere yet.
2020-05-06 19:28:59 +02:00
Linus Groh
2c14714ee0 Browser: Add dedicated "view source" window
Basically a window containing a read-only GUI::TextEditor containing the
source code of the current webpage. No temporary file needed :^)

Fixes #1103.
2020-05-06 17:14:51 +02:00
modmuss50
3142c4a4fd Browser: Add "Copy link" context menu item 2020-05-06 12:14:54 +02:00
Yonatan Goldschmidt
83eb31bb2e Taskbar: Remove checkable property from taskbar buttons
If a button is checkable, its "checked" state is inversed in
Button::click. It's not needed for taskbar buttons - their checked
state is updated in TaskbarWindow::wm_event, based on the
current state of their window.

Fixes: #1878.
2020-05-06 12:14:07 +02:00
Andreas Kling
d6ab9e6790 Browser: Add a basic GUI download feature
We now allow you to download files by right-clicking a link and then
choosing "Download".

All files are currently saved to the standard downloads location that
we get from Core::StandardPaths::downloads_directory().

In the future, we'll probably want to come up with a more restrictive
way of doing the "write to disk" portion of this.
We should also improve the ProtocolServer to allow streaming of data
instead of writing everything in one big go.

At the moment, I'm just pretty happy with this GUI. :^)
2020-05-05 23:58:22 +02:00
Andreas Kling
588e18721d Browser: Add a simple context menu for hyperlinks
This only has "Open" and "Open in new tab" for now. :^)
2020-05-05 22:42:50 +02:00
DexesTTP
d1a9afa7cd Help: Clicking on link changes the treeview selection
Fixes #1259
2020-05-05 14:27:51 +02:00
DexesTTP
f3cff4c677 SystemMonitor: Replace details with message when process isn't accessible
In addition to being less surprising, this sets up some groundwork for #1676
2020-05-05 12:49:18 +02:00
Andreas Kling
e09b83c60c LibTextCodec: Start fleshing out a simple text codec library
We're starting with a very basic decoding API and only ISO-8859-1 and
UTF-8 decoding (and UTF-8 decoding is really a no-op since String is
expected to be UTF-8.)
2020-05-03 23:01:58 +02:00
Ben Wiederhake
da837fe46e Meta: Fix Makefile permissions (not executable) 2020-05-03 14:24:08 +02:00
AnotherTest
c6825a96c7 AK+FileManager: Move out human_readable_size to AK::NumberFormat 2020-05-03 12:59:26 +02:00
Andres Vieira
ad309d4eca Terminal: Write an empty string instead of (null) on Command key
This prevents a Terminal to create a configuration file with
 Command=(null)

That would make it try to execute the command "(null)" on the next run.
2020-05-02 15:41:27 +02:00
Shannon Booth
0e403a43a4 Terminal: Add config for startup command
This is useful when working on a program as you can put the command into
the config file, instead of having to type it up each time on boot.
2020-05-02 14:12:57 +02:00
Ben Wiederhake
5d3ac4ec9e DisplaySettings: Don't crash after 'pape'
Running 'pape' without arguments (or just editing the WindowServer.ini by hand)
can confuse DisplaySettings. Specifically, if the 'Wallpaper' is set to
'/res/wallpapers/', then DisplaySettings used to crash because 'name_parts'
wouldn't contain any trailing element.

It's hard to define desired behavior, but this is better than crashing
and confusing the user.
2020-05-02 14:12:36 +02:00
Ben Wiederhake
ef433cb367 LibGUI: The UI calls it 'Icon view', fix the name in the code 2020-05-02 14:12:36 +02:00