Commit graph

1563 commits

Author SHA1 Message Date
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
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
Andreas Kling
3331098aee WindowServer+LibGUI+Taskbar: Don't include frameless windows in lists
Frameless windows don't need to show up in the taskbar or the switcher.
2020-05-02 12:24:23 +02:00
AnotherTest
7670e5ccf0 LibCore+LibHTTP: Move out the HTTP handler and add HTTPS 2020-05-02 12:24:10 +02:00
Hüseyin ASLITÜRK
8551c10918 Applications: TextEditor INI file syntax highlighter 2020-05-01 16:58:18 +02:00
Andreas Kling
88f7f9712d TextEditor: Use document path as base URL for markdown preview HTML 2020-04-30 23:43:17 +02:00
Andreas Kling
68513abf39 Terminal: Tweak default prompt color slightly :^) 2020-04-30 22:38:40 +02:00
Andreas Kling
06c478852a FileManager: Realize the initial path when opened from the command line 2020-04-30 22:38:28 +02:00
Andreas Kling
a40aa80df1 Debugger: Add missing newline in "help" output 2020-04-30 22:15:16 +02:00
Andreas Kling
5bdd05024f DisplaySettings: Tweak label "Color Name" => "Color" 2020-04-30 22:15:16 +02:00
Andreas Kling
6c0fed3866 TextEditor: Pledge "unix" so we can load images in Markdown preview
We should think a bit more about how we want preview content to
interact with the outside world, but for now let's just make it run.
2020-04-30 12:32:41 +02:00
Dylan Katz
47f413c47f Browser: Add missing tooltip to bookmark button
The tip will say "Add Bookmark" if not a bookmark and "Remove
Bookmark" if it is.
2020-04-30 08:52:21 +02:00
Andreas Kling
85fd0d2187 FileManager: Fix crash when file properties has unnamed UID or GID
It's perfectly valid for a file to be owned by a UID or GID with no
corresponding entry in /etc/passwd or /etc/group respectively.

Fixes #1988.
2020-04-29 19:35:20 +02:00
Andreas Kling
bf727eb44c DisplaySettings: Arrange buttons in "OK, Cancel, Apply" order 2020-04-29 16:25:02 +02:00
Andreas Kling
e8a044390e DisplaySettings: Don't allow desktop background color with alpha 2020-04-29 16:22:29 +02:00
Andreas Kling
51df4bdbfc DisplaySettings: Rename from DisplayProperties 2020-04-29 15:53:51 +02:00