Commit Graph

2009 Commits

Author SHA1 Message Date
u9g
6c35419236 Spreadsheet: Add Range(s).first() functions 2022-02-27 02:48:32 +03:30
thankyouverycool
76157594a9 TextEditor: Save wrapping mode settings 2022-02-26 22:54:25 +01:00
thankyouverycool
e5f7032fb8 TextEditor: Add missing syntax Alt-menu shortcuts 2022-02-26 22:54:25 +01:00
Filiph Sandström
3c01ef1c23 Spreadsheet: Disable cut/copy if no cell is selected
This resolves #12766 which occurred when the user tried to
use either the cut or copy action before selecting a cell.
2022-02-26 10:36:27 +01:00
Itamar
935d023967 Userland: Rename WindowServerConnection=>ConnectionToWindowServer
This was done with CLion's automatic rename feature.
2022-02-25 22:35:12 +01:00
Itamar
af132fdbd1 Userland: Rename WindowManagerServerConnection
Rename WindowManagerServerConnection=>ConnectionToWindowManagerServer.

This was done with CLion's automatic rename feature.
2022-02-25 22:35:12 +01:00
Itamar
3a71748e5d Userland: Rename IPC ClientConnection => ConnectionFromClient
This was done with CLion's automatic rename feature and with:
find . -name ClientConnection.h
    | rename 's/ClientConnection\.h/ConnectionFromClient.h/'

find . -name ClientConnection.cpp
    | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
2022-02-25 22:35:12 +01:00
thankyouverycool
f457e43885 Assistant+CommandPalette: Use FrameShape::Window for main widgets 2022-02-25 19:38:23 +01:00
networkException
9279dd783b Everywhere: Use title case for man section titles
In addition to the section headings on man.serenityos.org,
all occurances of man section titles are now formatted in title case.
2022-02-25 12:06:31 -05:00
thankyouverycool
b9f81b91a6 TextEditor: Update status bar to use clickable Segments
Adds two new Segments to TextEditor's status bar to quickly
change and display syntax highlighting and line and column info.
2022-02-24 19:09:41 +01:00
thankyouverycool
3aa95dd4d5 LibGUI+Apps: Convert Statusbar Labels to Segments
Segments inherit from Button and let us add clickable widgets
to status bars. This patch also adds proportional, fixed and
autosized modes for segments and lets the status bar consume
all non-clickable segments for override text.
2022-02-24 19:09:41 +01:00
thankyouverycool
653f01616c LibGUI+Apps: Adjust Splitter spacings
Different thread highlights between widgets lead to different
visual weights between splitters, even when they have the same
width or height. This means some splitters look best at odd
sizes while others even. This sets the default spacing to the
most commonly used, depending on orientation, and adjusts
spacing for a few apps based on the new paint rect.

The most consistent look across apps requires some manual
tweaking occassionally. Knurlheads, use your discretion!
2022-02-23 18:56:22 +02:00
thankyouverycool
fe864af0dc LibGUI+Apps: Prevent Splitter children from being unresizable
Splitters could be resized in such an order that all their remaining
children were fixed size, leading to unfillable gaps on resize events.

HackStudio and TextEditor already had logic to handle this edge case,
so this patch factors it into a general solution for all Splitters.
At least one widget is now guaranteed to be resizeable after a child
is removed.
2022-02-23 18:56:22 +02:00
thankyouverycool
c3ce562240 LibGUI+Apps: Let Splitters select which resizee to set fixed
This gives Splitters more versatility when the right resizee is
intended to remain fixed or be toggled on and off.
2022-02-23 18:56:22 +02:00
Ali Mohammad Pur
bed129a69f LibTest+Spreadsheet: Add some basic spreadsheet runtime behaviour tests
As there's a somewhat active development going on, let's keep the
expected behaviour under tests to make sure nothing blows up :^)
2022-02-23 03:17:12 +03:30
Idan Horowitz
e167cafa70 SystemMonitor: Add missing /boot/Kernel.debug unveil
When using the stack tab as root LibSymbolication uses this file to
provide Kernel symbols.
2022-02-21 23:30:46 +02:00
Karol Kosek
c9c55d86a4 Userland: Ask first for unsaved changes after clicking an "Open" action
Previously there was some inconsistency between the apps when clicking
the "Open" action while the file wasn't saved.

Some programs (Font Editor) immediately asked you if you wanted to save
the modified file, while others (Text Editor, Hex Editor and Playground)
would show the save dialog only *after* you selected a file.

I think it's better to ask a user right away if they want to save file,
because a dialog after selecting a file should be generally related to
that selected file, like an error opening a file, an import window etc.
2022-02-21 18:30:32 +01:00
Zack Penn
e41dfa6599 Spreadsheet: Add undo/redo implementation
The Spreadsheet application currently does not support undo/redo,
and with this update, we are starting the process of adding this feature
:-)

Additionally, the save dialog has been updated to use
GUI::MessageBox::ask_about_unsaved_changes() for system cohesity.

Spreadsheet: Add basic undo functinoality

The spreadsheet application now has basic support for undo. Testing of
this feature is limited, and may not work as intended yet.

Spreadsheet: Add callback when a cell's value is changed

In addition to the callback being added, this commit also exposes the
SheetModel class via a getter in SpreadSheetView.

Spreadsheet: Remove debug statements and use cell change callback

This commit uses the on_cell_data_change callback from within the
SheetModel class. This allows for us to push/pop changes to the undo
stack.

With this, we have basic Undo/Redo functionality :-)

Spreadsheet: Actually add window::set_modified

Spreadsheet: Const-correctness :-)

Spreadsheet: Reorder the edit menu actions
2022-02-21 16:04:48 +03:30
u9g
0d50ac1657 Spreadsheet: Remove Debug Statement 2022-02-20 20:05:31 +00:00
Liav A
6a998c1a8b HexEditor: Add support for handling PageUp and PageDown key events
In such case, move the cursor up or down the amount of bytes per row,
multiplied by the visible content rectangle height, if possible.
2022-02-20 15:44:36 +01:00
Liav A
c8e691f917 HexEditor: Reduce code duplication when handling key down events
Instead of having the same update block for each event we can use lambda
functions to help updating the cursor when handling key down events.
2022-02-20 15:44:36 +01:00
Karol Kosek
410254dbe2 Spreadsheet: Use the system-wide unsaved changes dialog 2022-02-20 08:40:26 -05:00
Karol Kosek
42d19977b3 HexEditor: Use the system-wide unsaved changes dialog 2022-02-20 08:40:26 -05:00
Karol Kosek
f18ae27fe9 HexEditor: Display dirty close icon when the file is changed 2022-02-20 00:06:14 -05:00
Simon Danner
0787571192 Filemanager: Only enable rename if available 2022-02-19 11:35:53 +01:00
Andreas Kling
c001e3f2fd BrowserSettings: Run gml-format on ContentFilterSettingsWidget.gml 2022-02-18 19:21:12 +01:00
Maciej
8aa1c7f5b0 Browser: Add option to open BrowserSettings from Browser :^) 2022-02-18 19:00:42 +01:00
Maciej
1606f70f0c BrowserSettings: Implement GUI for setting up content filters :^) 2022-02-18 19:00:42 +01:00
Maciej
4d1c28a23f Browser: Add support for disabling content filtering
Just for completeness.
2022-02-18 19:00:42 +01:00
Maciej
43e463748d Browser: Implement listener for most config options
The only option leaved as TODO is ColorScheme.
2022-02-18 19:00:42 +01:00
Maciej
d3fc3337ef Browser: Call url_from_user_input for home URL
This allows omitting HTTP scheme in home URLs.
2022-02-18 19:00:42 +01:00
Maciej
5d8cda59ae Browser: Update content filters if the config file changes 2022-02-18 19:00:42 +01:00
thankyouverycool
cd4c11ebaf FontEditor: Remove listener client
FontEditor was relying on a hack to get notified about i32 config
changes, and scale is not a setting we want updated across all
editor instances, nor do we have any settings that make sense to
monitor universally, so let's remove listener privileges for now.
2022-02-18 07:38:29 -05:00
thankyouverycool
0d29419ed4 FontEditor: Save settings for showing metadata and unicode blocks 2022-02-18 07:38:29 -05:00
thankyouverycool
0061af170f FontEditor: Add a search box to filter Unicode blocks 2022-02-18 07:38:29 -05:00
thankyouverycool
9e20d393ac SystemMonitor: Add proper icon to the ProcessState window 2022-02-18 13:10:37 +01:00
thankyouverycool
0e56dd4917 SystemMonitor: Don't invalidate ProcessStateModel on refresh
The model has a fixed number of rows based on the column enum
and shouldn't need to be invalidated every update.
2022-02-18 13:10:37 +01:00
stijndr
d01ca4e3e2 Userland: Dynamically update the MonitorSettingsWidget countdown timer
This causes the number of seconds in "Do you want to keep the new
settings? They will be reverted after 10 seconds." to be dynamically
updated.
2022-02-18 10:33:46 +01:00
martinfalisse
b6c3fad078 LibGUI: JsonArrayModel update without invalidating indices
Add function to update a JsonArrayModel without invalidating it. Now,
for example in the SystemMonitor in the Network tab, a selected line
will not be deselected whenever the data is updated.
2022-02-17 20:09:47 +01:00
Sam Atkins
cd0ffe5460 LibCore+Everywhere: Return ErrorOr from ConfigFile::sync()
Currently this method always succeeds, but that won't be true once we
switch to the Core::Stream API. :^)

Some of these places would ideally show an error message to the user,
since failure to save a file is significant, but let's not get
distracted right now.
2022-02-16 19:49:41 -05:00
Sam Atkins
8260135d4d LibCore+Everywhere: Return ErrorOr from ConfigFile factory methods
I've attempted to handle the errors gracefully where it was clear how to
do so, and simple, but a lot of this was just adding
`release_value_but_fixme_should_propagate_errors()` in places.
2022-02-16 19:49:41 -05:00
Idan Horowitz
a8e329461f Applications: Run gml-format 2022-02-15 19:33:46 +02:00
thankyouverycool
aefb2bcf43 FontEditor: Add a ListView to sort glyphs by their Unicode block 2022-02-15 10:13:19 -05:00
thankyouverycool
6704bc0072 CharacterMap: Add a ListView to sort glyphs by their Unicode block 2022-02-15 10:13:19 -05:00
electrikmilk
8fea7d9752 Spreadsheet: Improve 'Functions Help' button
Add icon and tooltip to 'Functions Help' button.
2022-02-15 12:16:23 +01:00
electrikmilk
ffa140c613 Spreadsheet: Insert missing icons
Add icons where they are missing.
2022-02-15 12:16:23 +01:00
electrikmilk
ba0a5a2cd3 Base+Piano: Insert missing icons into menubar
Inserts icons for 'Export', 'Add Track' and 'Next Track'.
2022-02-15 12:10:14 +01:00
ForLoveOfCats
5da3063a39 DisplaySettings: Include aspect ratio in resolution list text 2022-02-15 10:44:37 +01:00
electrikmilk
97ce19bc68 Base+PixelPaint: Use Merge Active Layer Up/Down Icons
The icons for these actions were added in a previous commit but never
used, now they are.
2022-02-15 10:40:49 +01:00
electrikmilk
7e5b3ce26b PixelPaint: Implement Merge Active Layer Up
Implements 'Merge Active Layer Up' and adds it to the 'Layer' menu.
2022-02-15 10:40:49 +01:00
Lenny Maiorani
160bda7228 Applications: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-14 22:06:55 +00:00
James Puleo
a0e7a4b9a8 WindowServer+Userland: Pass wallpapers as Gfx::Bitmap instead of path
The WindowServer _really_ does not need to know the filesystem path to
it's wallpaper, and allows setting arbitrary wallpapers (those outside
of `/res/wallpapers`).

The GUI::Desktop will keep track of the path to the wallpaper (if any),
and save it to config if desired (to be persisted).

This avoids the need to `unveil` paths to the wallpaper, fixing #11158
2022-02-14 16:38:42 +03:30
Mustafa Quraish
c3e4123ed7 PixelPaint: Change menu shortcut for "Fit Image to View"
This makes it consistent with `ImageViewer`, where `F` was unavailable
for use as a shortcut. A small change, but it's nice having the same
keyboard shortcuts where we can :^)
2022-02-14 11:49:21 +01:00
Mustafa Quraish
4556b8e943 ImageViewer: Add "Fit Image to View" action
This is analogous to PixelPaint, it resizes the image so that it fits
in the view (with some padding).
2022-02-14 11:49:21 +01:00
Mustafa Quraish
481ed1ca16 ImageViewer: Fix window resizing on first image
The logic in place for this no longer worked since we abstracted away
the logic for zooming / panning (which changed how scale is stored).
This commit fixes the behaviour so when the first image is opened, the
window resizes to fit it.
2022-02-14 11:49:21 +01:00
Mustafa Quraish
5c763e9832 LibGUI+PixelPaint: Move fit_image_to_view to AbstractZoomPanWidget
We often want to zoom and fit the content of the widget into the
visible frame (or some rect within the frame), and it makes sense to
move this functionality into the AbstractZoomPanWidget to minimize
the amount of coordinate math derived classes need to do.

This commit moves the code that implements this functionality from
`PixelPaint::ImageEditor` into `AbstractZoomPanWidget` so that we
can also use it for other applications (such as ImageViewer!)
2022-02-14 11:49:21 +01:00
Federico Guerinoni
334ed9225a HexEditor: Fix copy {text/hex} to clipboard
Now the copy action takes exactly the selected chars and not one more.
2022-02-14 11:42:04 +01:00
Federico Guerinoni
932ce93fd7 HexEditor: Fix crash of copy action when selection is empty
Closes: #11925
2022-02-14 11:42:04 +01:00
electrikmilk
62102e3130 Base+HexEditor: Add icons 2022-02-13 21:24:46 +00:00
electrikmilk
adf6be45fb Base+Calculator: Add icons
Adds icons for Pi and Euler's Constant to the Constants menu.
2022-02-13 22:09:18 +01:00
electrikmilk
91d27bd484 Magnifier: Add missing icons
Add icons for 'Next Frame' and 'Previous Frame'.
2022-02-13 15:17:09 -05:00
electrikmilk
8c32b42bdf Base+PixelPaint: Add more icons 2022-02-13 10:18:37 +01:00
Idan Horowitz
c8ab45e79f Userland: Run gml-format
This brings the existing GML files up to spec with the new requirements
2022-02-13 02:36:35 +02:00
Andreas Kling
3c108e20a7 PixelPaint: Run gml-format on FilterGallery.gml 2022-02-12 22:30:50 +01:00
Aatos Majava
c23d25d1de FileManager: Add F6 alternate shortcut to "location" action
This mirrors the behaviour in Browser.
2022-02-12 09:06:23 -05:00
snooze
e9d3f3793c PixelPaint: Add a preview in FilterGallery
Now FilterGallery shows the preview of the currently selected filter
applied on the currently active layer
2022-02-12 12:21:35 +01:00
electrikmilk
dece108f9a PixelPaint: Implement IconBag to organize icons
Implement IconBag method of organizing menubar icons from Browser.
2022-02-12 11:24:00 +01:00
Vitaly Dyachkov
32b8795091 LibConfig: Rename pledge_domains(String) => pledge_domain(String)
pledge_domains() that takes only one String argument was specifically
added as a shortcut for pledging a single domain. So, it makes sense to
use singular here.
2022-02-11 18:06:39 +01:00
Lenny Maiorani
2e87a5b7eb Applications: Port Spreadsheet to LibMain 2022-02-10 10:24:18 +00:00
Lenny Maiorani
4b18a25e22 Applications: Port SpaceAnalyzer to LibMain 2022-02-10 10:23:51 +00:00
Lenny Maiorani
ed971f1134 Applications: Port Debugger to LibMain 2022-02-10 10:23:26 +00:00
Lenny Maiorani
f0d2489254 Applications: Port Assistant to LibMain 2022-02-09 21:01:52 +00:00
electrikmilk
133a30c8b7 Base+Browser: Add browser icons
Add local storage and style sheet icons. I also noticed the name of the
DOM tree icon needed updated (tree => dom_tree).
2022-02-09 21:00:37 +00:00
Daste
a22323ecce Browser: Make underlined shortcuts in "Debug" menu unique 2022-02-09 19:33:51 +01:00
electrikmilk
1d8b213b5b Base+Browser: Add browser icons folder
Move browser specific icons to their own folder in /res/icons/
2022-02-09 19:33:28 +01:00
Andreas Kling
3f9fc0f690 Browser+LibWeb: Add "Dump Local Storage" item to Browser's Debug menu 2022-02-08 21:53:20 +01:00
davidot
4ef1e8f226 Spreadsheet: No longer use vm.exception() to signal exception state
Instead, use the completions which are returned directly. This means we
no longer have to worry about the global VM state when running code.
2022-02-08 09:12:42 +00:00
kleines Filmröllchen
6ee597369d Meta+Userland: Run the GML formatter on CI and pre-commit
Now that the GML formatter is both perserving comments and also mostly
agrees to the existing GML style, it can be used to auto-format all the
GML files in the system. This commit does not only contain the scripts
for running the formatting on CI and the pre-commit hook, but also
initially formats all the existing GML files so that the hook is
successfull.
2022-02-07 18:39:50 +01:00
kleines Filmröllchen
4931c88b13 LibGUI: Remove GML prefix in favor of proper namespace
Prefixes are very much a C thing which we don't need in C++. This commit
moves all GML-related classes in LibGUI into the GUI::GML namespace, a
change somewhat overdue.
2022-02-07 18:39:50 +01:00
thankyouverycool
f35a6c13ab LibGUI+TextEditor: Highlight the entire current line
And fix Line Highlighting's duplicate alt-menu shortcut.

Previously only text on the cursor's line was highlighted. This makes
discerning cursor focus on empty lines easier.
2022-02-07 15:05:22 +00:00
electrikmilk
4bfed6a5ed Base+Browser: Add Browser Icons
Add or insert some missing browser icons.
2022-02-07 12:35:05 +01:00
networkException
b28e861776 Browser: Better handle ports in user input to url conversion
Previously it was hard to enter a url with a port in browser:

"example.com:8080" -> Protocol not implemented: example.com

This patch makes an attempt at parsing the input as an url with http
first an validates if the url has a port.

"example.com:8080" -> "http://example.com:8080"
2022-02-07 10:52:55 +01:00
Hendiadyoin1
fbb798f98c AK: Move integral log2 and exp to IntegerMath.h 2022-02-06 17:52:33 +00:00
Hendiadyoin1
f6ddaef8bf Soundplayer: Use exp() instead of pow(E, n) 2022-02-06 17:52:33 +00:00
Hendiadyoin1
3e135f347f Userland: Use AK::pow<I> where applicable 2022-02-06 17:52:33 +00:00
Sviatoslav Peleshko
3caac65cc8 CrashReporter: Capture backtrace progress callback's arguments by value
Previously we captured them by reference, but when the deferred code
finally runs from an event loop, the references may be stale.
In that case, value and max of the progressbar are set with random
numbers.
If we were especially unlucky, the `frame_count` turned into a negative
int, and would crash at `VERIFY(min <= max)`.
2022-02-06 18:25:05 +03:30
Ali Mohammad Pur
aafc451016 Userland: Convert TLS::TLSv12 to a Core::Stream::Socket
This commit converts TLS::TLSv12 to a Core::Stream object, and in the
process allows TLS to now wrap other Core::Stream::Socket objects.
As a large part of LibHTTP and LibGemini depend on LibTLS's interface,
this also converts those to support Core::Stream, which leads to a
simplification of LibHTTP (as there's no need to care about the
underlying socket type anymore).
Note that RequestServer now controls the TLS socket options, which is a
better place anyway, as RS is the first receiver of the user-requested
options (though this is currently not particularly useful).
2022-02-06 13:10:10 +01:00
Matthias-Sleurink
032ffbcf64 PixelPaint: Don't overwrite images with project file on save
The ImageEditor tracks whether it was loaded from an image
(the alternative being a project file.) If it was loaded from an image
file we redirect save project actions to save as instead.
2022-02-06 07:22:57 +00:00
Andreas Kling
270aa9e5d0 Browser: Add Debug menu action for dumping the stacking context tree 2022-02-05 22:50:39 +01:00
Andreas Kling
23795738fb Browser: Don't log every content filter string when loaded 2022-02-05 22:50:39 +01:00
Jason
cdcf097aa8 FileManager: Add an animation for deleting files 2022-02-05 19:57:45 +00:00
Jagger De Leo
d5183cb7ac PixelPaint: Use Escape to clear rectangular selections
Now while dragging a new rectangular selection you can cancel it by
hitting Escape. Existing selections are cleared by Escape as well if the
RectangularSelectTool is active.
2022-02-04 16:11:48 +01:00
Jagger De Leo
a96b15d2bc PixelPaint: Remove conflicting action hotkey
The new CommandPalette feature conflicts with PixelPaint's Clear
Selection action keyboard shortcut (Ctrl + Shift + A).

Fixes: #12222
2022-02-04 16:11:48 +01:00
Sam Atkins
6b0c4908df FileManager: Don't show command palette for the desktop 2022-02-03 23:28:56 +01:00
Sam Atkins
a4cb6a49ae FileManager: Disable "View as..." actions for desktop DirectoryView
This stops these actions from being activated with Ctrl+[1,2,3] or the
command palette.. Switching to table or columns view would just hide
all the icons, so let's not make those options available.
2022-02-03 23:28:56 +01:00
Timothy Flynn
362e167239 ClockSettings: Display a text bubble with extra time zone information 2022-02-03 16:11:15 +01:00
Timothy Flynn
4d2ea773db ClockSettings: Display a map to show the current time zone's location 2022-02-03 16:11:15 +01:00
Brian Gianforcaro
e8857f9b2d CrashReporter: Stop attempting to lockdown the process veil
The idea of locking the process veil in CrashReproter is well
intentioned, but ultimately frought with issues.

The fundamental premise is a bit flawed, as we are using the crashing
program as input to dynamically add new paths to the process veil.
This means that an attacker can potentially produce a custom or
malformed binary to trick CrashReporter into allowing an arbitrary
path to be read.
2022-02-03 14:57:01 +01:00
Timur Sultanov
c7bd47c87c Base+WindowsServer+keymap: Store multiple keymaps in a config 2022-02-03 00:47:22 +01:00
Andreas Kling
a599f68cfe PixelPaint: Paint layer thumbnails with correct aspect ratio 2022-02-01 10:49:13 +01:00
thankyouverycool
a593b83189 LibGfx+Applications: Add human readable name helper for fonts
This returns a more comprehensible name than raw weight and slope
metrics and is intended for use in UIs. Now displays human readable
font names in FontSettings, TerminalSettings and CharacterMap.
2022-02-01 10:06:26 +01:00
Timothy Flynn
6efbafa6e0 Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2022-01-31 18:23:22 +00:00
Jelle Raaijmakers
48eecaad64 LibGUI: Remove Window background color
The `m_background_color` field was not used anywhere. Both `Terminal`
and the `ColorPicker` widget invoked `set_background_color()` to no
avail.
2022-01-31 00:38:15 +01:00
Dylan Katz
caecb6ba72 DisplaySettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
362df5b6dd MailSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
3ee32b6dbf MouseSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
90b371ef47 KeyboardSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Dylan Katz
ca912a87f1 BrowserSettings: Set icons from GML 2022-01-29 13:45:34 +01:00
Ali Mohammad Pur
e72521f286 LibCoredump: Copy out the FooInfo structs to an aligned address
We were handing out unaligned pointers to these, which made UBSAN super
mad, copy them out to avoid that.
2022-01-28 22:51:27 +00:00
Ali Mohammad Pur
6d64b13a1b LibDebug+Everywhere: Avoid void* -> FlatPtr -> void* dance
And limit the `void*` to the functions that interface the system (i.e.
ptrace wrappers).
This generally makes the code less riddled with casts.
2022-01-28 22:51:27 +00:00
kleines Filmröllchen
145eeb57ab Userland: Remove a bunch of unnecessary Vector imports
How silly :^)
2022-01-28 23:40:25 +01:00
kleines Filmröllchen
cab6384966 HexEditor: Use Array in FindDialog's options 2022-01-28 23:40:25 +01:00
Timothy Flynn
bd5662d6f2 CharacterMap: Move display name strings into the search results object
Now that we're passing the display name directly to the search results
structure, let's move() the string instead of copying it.
2022-01-28 15:26:58 +00:00
Timothy Flynn
54d89401df CharacterMap: Change the search widget to display results in a TableView
Code points that have a bidirectional attribute of right-to-left (e.g.
some Arabic and Hebrew code points) were causing the code point to
render at the end of the search result, rather than the beginning. To
keep the results consistent, split the search results into two columns:
the first for the code point, the second for its name.
2022-01-28 15:26:58 +00:00
Timothy Flynn
55d28a738e Revert "FileManager: Display times in the user's local time zone"
This reverts commit 080b054695.
2022-01-28 15:13:35 +00:00
Timothy Flynn
8599ee3049 Revert "Userland: Invoke tzset in apps that care about time zones"
This reverts most of commit ede5c9548e.
The one change not reverted is ClockWidget.h, so that the taskbar clock
can continue to notice time zone changes.
2022-01-28 15:13:35 +00:00
Timothy Flynn
080b054695 FileManager: Display times in the user's local time zone 2022-01-28 12:25:20 +00:00
Timothy Flynn
da2eb63652 BrowserSettings: Use standard text placement for check box text 2022-01-28 13:20:19 +01:00
Timothy Flynn
0a3b1f6bc8 MailSettings: Use standard text placement for check box text 2022-01-28 13:20:19 +01:00
Timothy Flynn
cfd1755910 MouseSettings: Use standard text placement for check box text 2022-01-28 13:20:19 +01:00
Timothy Flynn
a027ccad75 LibTimeZone+Userland: Rename current_time_zone to system_time_zone
This renames the current implementation of current_time_zone to
system_time_zone to more clearly indicate what it is. Then reimplements
current_time_zone to return whatever was set up by tzset, falling back
to UTC if something went awry, for convenience.
2022-01-25 18:39:36 +00:00
Timothy Flynn
ede5c9548e Userland: Invoke tzset in applications that care about time zones
In most applications, we invoke tzset once at startup for now. Most of
these are short lived and don't need to know about time zone changes.

The exception is the ClockWidget in the taskbar. Here, we invoke tzset
each time we update the system time. This way, any time zone changes can
take effect immediately.
2022-01-25 18:39:36 +00:00
Andreas Kling
58b5aede65 CrashReporter: Dispatch backtrace progress callbacks on the main thread
We can't fiddle with GUI widgets off the main thread, so let's use
Core::EventLoop::deferred_invoke() to dispatch the work.

The progress bar doesn't visibly update yet, but at least we're not
crashing anymore.
2022-01-25 09:13:40 +01:00
Sam Atkins
c388a879d7 AK+Userland: Make AK::decode_base64 return ErrorOr 2022-01-24 22:36:09 +01:00
Sam Atkins
f590cd1850 AK+Userland: Make AK::decode_hex() return ErrorOr
This lets us propagate the reason why it failed up to the caller. :^)
2022-01-24 22:36:09 +01:00
Sam Atkins
45cf40653a Everywhere: Convert ByteBuffer factory methods from Optional -> ErrorOr
Apologies for the enormous commit, but I don't see a way to split this
up nicely. In the vast majority of cases it's a simple change. A few
extra places can use TRY instead of manual error checking though. :^)
2022-01-24 22:36:09 +01:00
Sam Atkins
2b3790100a Browser: Convert file-downloading code to Core::Stream :^) 2022-01-24 17:10:01 +01:00
Sam Atkins
20b4bfc892 Browser: Convert ad-filter loading to Core::Stream :^) 2022-01-24 17:10:01 +01:00
Sam Atkins
ad1f24ecb9 Browser: Convert search-engines file loading to Core::Stream :^)
Wrapped it in a method so we can take advantage of TRY(). I chose not to
make failure here stop the Browser process, but just to cancel loading
any more search engines.
2022-01-24 17:10:01 +01:00
Tom
6565ec59fa DisplaySettings: Show display's manufacturer and size instead of device
Rather than displaying the path of the framebuffer, try and display
the manufacturer name and the size of the display. If no EDID data is
available, fall back to showing the device path.
2022-01-23 22:45:21 +00:00
Tom
ab1075e296 DisplaySettings: Show DPI for selected resolution
This uses the EDID provided by the connected display to show the pixel
density of a selected resolution.
2022-01-23 22:45:21 +00:00
mjz19910
1ef633472b Everywhere: Convert VM::call() to JS::call() 2022-01-23 15:24:45 +00:00
kleines Filmröllchen
69c1910037 LibCore: Allow EventLoops to run on multiple threads safely
The event loop system was previously very singletony to the point that
there's only a single event loop stack per process and only one event
loop (the topmost) can run at a time. This commit simply makes the event
loop stack and related structures thread-local so that each thread has
an isolated event loop system.

Some things are kept at a global level and synchronized with the new
MutexProtected: The main event loop needs to still be obtainable from
anywhere, as it closes down the application when it exits. The ID
allocator is global as IDs should not be shared even between threads.
And for the inspector server connection, the same as for the main loop
holds.

Note that currently, the wake pipe is only created by the main thread,
so notifications don't work on other threads.

This removes the temporary mutex fix for notifiers, introduced in
0631d3fed5 .
2022-01-23 15:21:10 +01:00
Timothy Flynn
d365559839 ClockSettings: Add a GUI application to set the system time zone
This application can be expanded with other clock-related options. For
an initial iteration, it has just an option to change the time zone.
2022-01-23 12:48:26 +00:00
Timothy Flynn
bcf4ec9c61 Userland: Add promises to programs that will read /etc/timezone
This will require unveiling /etc/timezone itself for reading, as well as
the rpath pledge promise.
2022-01-23 12:48:26 +00:00
Rummskartoffel
c93dfe8097 TextEditor: Fix crash on startup when file specified cannot be opened
Due to a bug introduced in f674102, TE would attempt to access the value
of an ErrorOr that didn't hold one, hitting an assertion.
2022-01-23 00:27:41 +00:00
davidot
2d4b345bb1 Spreadsheet: Enable dynamic import of javascript modules
This has some risks as it can (attempt to) load arbitrary files on the
filesystem but for now it can only load local files which do go through
normal file operations. But let's enable it for now to see what we can
do with it.
2022-01-22 01:21:18 +00:00
Luke Wilde
631bbcd00a LibJS: Refactor interpreter to use Script and Source Text Modules
This also refactors interpreter creation to follow
InitializeHostDefinedRealm, but I couldn't fit it in the title :^)

This allows us to follow the spec much more closely rather than being
completely ad-hoc with just the parse node instead of having all the
surrounding data such as the realm of the parse node.

The interpreter creation refactor creates the global execution context
once and doesn't take it off the stack. This allows LibWeb to take the
global execution context and manually handle it, following the HTML
spec. The HTML spec calls this the "realm execution context" of the
environment settings object.

It also allows us to specify the globalThis type, as it can be
different from the global object type. For example, on the web, Window
global objects use a WindowProxy global this value to enforce the same
origin policy on operations like [[GetOwnProperty]].

Finally, it allows us to directly call Program::execute in perform_eval
and perform_shadow_realm_eval as this moves
global_declaration_instantiation into Interpreter::run
(ScriptEvaluation) as per the spec.

Note that this doesn't evalulate Source Text Modules yet or refactor
the bytecode interpreter, that's work for future us :^)

This patch was originally build by Luke for the environment settings
object change but was also needed for modules. So I (davidot) have
modified it with the new completion changes and setup for that.

Co-authored-by: davidot <davidot@serenityos.org>
2022-01-22 01:21:18 +00:00
Dylan Katz
3919a1dcc0 Browser: Load icons at start of program
Previously, Browser loaded icons from the disk every time an icon
was set. In addition to making more calls to the disk and decoding
more images, this makes error propagation impossible. This change
moves all icon loading to the start of the program.
2022-01-21 22:14:13 +01:00
Mustafa Quraish
bba32de857 SpreadSheet: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
ca2c7dced5 3DFileViewer: Use FileSystemAccessClient::try_* APIs
This commit also removed the redundant `filename` parameter from
`GLContextWidget::load_file`, since the filename is already stored
within the file itself.
2022-01-20 10:39:12 +01:00
Mustafa Quraish
abb16683c9 ThemeEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
f674102447 TextEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
effb19f996 PDFViewer: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
1c3e93c6e0 PixelPaint: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
aae96af812 HexEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Sam Atkins
94f2508519 CrashReporter: Don't crash when investigating a HackStudio crash
Previously when opening a crash report for HackStudio, the
`unveil("/bin/HackStudio", "rx")` call was failing because of the
earlier `unveil(executable_path.characters(), "r")` call requesting only
"r" permissions for it. This patch handles this specific case, so you
can crash HackStudio to your heart's content. :^)

Also, we were unveiling the executable path twice, once manually and
once implicitly as part of the coredump's libraries, so we now check for
the latter and avoid it.

Thanks to Daniel for noticing what was right in front of me and I didn't
see!

Co-authored-by: Daniel Bertalan <dani@danielbertalan.dev>
2022-01-20 10:38:10 +01:00
Dmitry Petrov
1662213737 Userland: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
Undefine
9a28ef7aa9 SystemMonitor: Show unknown in PCI devices
In case when the PCI class, device or vendor is unknown, show
that it is unknown instead of just putting the ID
2022-01-19 21:47:40 -08:00
Timothy Flynn
d51d5f9591 FontEditor: Retrieve code point abbreviations from LibUnicode
Rather than using a hard-coded list from AK::UnicodeUtils, LibUnicode
contains the up-to-date official names and contains abbreviations for
more control code points.
2022-01-18 15:13:25 +00:00
Brian Gianforcaro
974e36e7a9 TextEditor: Hookup git commit message detection and highlighting 2022-01-18 09:01:16 +01:00
Jesse Buhagiar
865e7bbe5e LibGL+LibSoftGPU+3DFileViewer: Implement Specular highlighting :^) 2022-01-18 01:48:51 +02:00
thankyouverycool
c094bb60bc FontEditor: Set GlyphEditor glyph on initialization
Fixes GlyphEditor appearing blank on start and subsequent
re-initializations.
2022-01-16 21:36:39 +01:00
thankyouverycool
8f60ea4470 FontEditor: Disambiguate save function from save-as action 2022-01-16 21:36:39 +01:00
thankyouverycool
c2b7bbbb2c FontEditor: Update GlyphEditor and width widgets on paste and delete
Fixes unsynced state between widgets after paste and delete actions.
2022-01-16 21:36:39 +01:00
thankyouverycool
7d7f683715 FontEditor: Correct GroupBox height
Font Metadata's GroupBox height was off by an _unsightly_ 2 pixels.
Now we make heights explicit for all child widgets and let shrink_to_fit
automatically calculate things.
2022-01-16 21:36:39 +01:00
thankyouverycool
24bd2a427c FontEditor: Calculate GlyphEditor toolbar widths more precisely
Fixes pixel imperfect toolbar widths when editing small fonts.
2022-01-16 21:36:39 +01:00
thankyouverycool
2e849250eb FontEditor: Remove unnecessary call during GlyphEditor init
GlyphEditor's relative rect is automatically set during layout.
2022-01-16 21:36:39 +01:00
thankyouverycool
ff42ad88ee FontEditor: Remove .gitignore artifact from old build system 2022-01-16 21:36:39 +01:00
Marcus Nilsson
8b39ec7c18 SystemMonitor: Don't display empty CPU graphs when number of CPUs < 4
When we have less than 4 CPUs we don't need to display a whole row of
CPU graphs.
2022-01-16 15:04:40 +01:00
Sam Atkins
53cd87cc1d CharacterMap+Base: Give Character Map an icon 2022-01-16 11:17:03 +01:00
Sam Atkins
83a9661c04 CharacterMap+Base: Add man page for Character Map :^) 2022-01-16 11:17:03 +01:00
Sam Atkins
2a7c638cd9 CharacterMap: Add a find-by-name window
This works the same way as the command-line usage, searching against the
display name as provided by LibUnicode.

I've modified the search loop to cover every possible unicode
code-point, since my previous logic was flawed. Code-points are not
dense, there are gaps, so simply iterating up to the count of them will
skip ones with higher values. Surprisingly, iterating all 1,114,112 of
them still runs in a third of a second. Computers are fast!
2022-01-16 11:17:03 +01:00
Sam Atkins
2bf7abcb28 CharacterMap: Add previous, next, and go-to glyph buttons
These work the same as in FontEditor, where I shamelessly stole them
from. :^)
2022-01-16 11:17:03 +01:00
Sam Atkins
e975db23c0 LibGUI+FontEditor: Move seek-prev/next-glyph logic into GlyphMapWidget 2022-01-16 11:17:03 +01:00
Sam Atkins
9ca8428238 CharacterMap: Add output box for copying arbitrary character sequences
This adds a TextBox along the bottom of the window. Double-clicking on a
character will append it to this box, which you can edit as any other
TextBox, or click the copy button to copy the output to the clipboard.
2022-01-16 11:17:03 +01:00
Sam Atkins
2327ea8970 CharacterMap: Add new Character Map application :^) 2022-01-16 11:17:03 +01:00
Sam Atkins
21a24c36a8 LibGUI: Make GlyphMapWidget work with vector fonts
This basically just meant replacing the `m_font` field with the one
inherited from Widget.
2022-01-16 11:17:03 +01:00
Sam Atkins
8175cd0a28 LibGUI+FontEditor: Move GlyphMapWidget to LibGUI
This will allow us to use this in other apps, such as the upcoming
Character Map. :^)
2022-01-16 11:17:03 +01:00
Olivier De Cannière
d3dfb957a6 PixelPaint: Add delete selection behavior
The delete key can now be used to erase the pixels on the active layer
contained within the selection rectangle.

Closes #11861
2022-01-15 23:38:00 +01:00
creator1creeper1
19d9d5bfe1 Everywhere: Mark Vector of mutable references as mutable
The point of a reference type is to behave just like the referred-to
type. So, a Foo& should behave just like a Foo.

In these cases, we had a const Vector. If it was a const Vector of Foo,
iterating over the Vector would only permit taking const references to
the individual Foos.

However, we had a const Vector of Foo&. The behavior should not
change. We should still only be permitted to take const references to
the individual Foos. Otherwise, we would be allowed to mutate the
individual Foos, which would mutate the elements of the const Vector.
This wouldn't modify the stored pointers, but it would modify the
objects that the references refer to. Since references should be
transparent, this should not be legal.

So it should be impossible to get mutable references into a const
Vector. Since we need mutable references in these cases to call the
mutating member functions, we need to mark the Vector as mutable as
well.
2022-01-16 00:38:21 +03:30
Mateusz Krajewski
ae71d2b70e PixelPaint: Restrict "crop to selection" to image boundaries 2022-01-15 21:55:41 +01:00
Rummskartoffel
a610d9a3d1 Assistant: Fix crash in FileProvider background thread upon exit
If the Threading::BackgroundAction for filesystem indexing in
FileProvider hadn't finished by the time the main thread exited, it
would still try to access the FileProvider object that lived in the main
thread, thereby causing a segfault and crashing. This commit prevents
FileProvider from being destroyed while the background thread is still
running by giving the background thread a strong reference to its
FileProvider.
2022-01-15 21:45:03 +01:00
Rummskartoffel
ada1d4906e Assistant: Make Provider ref-counted 2022-01-15 21:45:03 +01:00
Glenford Williams
c55dfabdd5 Spreadsheet: Use FileSystemAccessClient for the reading of files 2022-01-15 22:20:15 +03:30
Brian Gianforcaro
ef2fd31288 Terminal: Add config listeners for controlling scrollbar visibility 2022-01-15 11:03:23 +01:00
Brian Gianforcaro
ab4035e227 TerminalSettings: Expose a CheckBox controlling scrollbar visibility 2022-01-15 11:03:23 +01:00
sin-ack
2e1bbcb0fa LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer
This change unfortunately cannot be atomically made without a single
commit changing everything.

Most of the important changes are in LibIPC/Connection.cpp,
LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp.

The notable changes are:
- IPCCompiler now generates the decode and decode_message functions such
  that they take a Core::Stream::LocalSocket instead of the socket fd.
- IPC::Decoder now uses the receive_fd method of LocalSocket instead of
  doing system calls directly on the fd.
- IPC::ConnectionBase and related classes now use the Stream API
  functions.
- IPC::ServerConnection no longer constructs the socket itself; instead,
  a convenience macro, IPC_CLIENT_CONNECTION, is used in place of
  C_OBJECT and will generate a static try_create factory function for
  the ServerConnection subclass. The subclass is now responsible for
  passing the socket constructed in this function to its
  ServerConnection base; the socket is passed as the first argument to
  the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before
  any other arguments.
- The functionality regarding taking over sockets from SystemServer has
  been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket
  implementation of this functionality hasn't been deleted due to my
  intention of removing this class in the near future and to reduce
  noise on this (already quite noisy) PR.
2022-01-15 13:29:48 +03:30
Colin
dc89ac1463 PixelPaint: Update SelectedColorWidget::m_color consistently 2022-01-14 21:33:32 +01:00
kleines Filmröllchen
be6418cc50 Everywhere: Use my new serenityos.org e-mail :^) 2022-01-14 11:54:09 +01:00
Idan Horowitz
d55c130df5 SystemMonitor: Split multi-core CPU usage graphs into multiple rows
This looks much nicer than the current cramped single-row solution.
2022-01-14 01:02:50 +01:00
Mustafa Quraish
7974fee800 PixelPaint: Inherit from AbstractZoomPanWidget 2022-01-14 01:02:34 +01:00
Mustafa Quraish
b21d128075 ImageViewer: Inherit from AbstractZoomPanWidget 2022-01-14 01:02:34 +01:00
sin-ack
aedb013ee3 LibIMAP+Userland: Convert LibIMAP::Client to the Serenity Stream APIs
You now cannot get an unconnected LibIMAP::Client, but you can still
close it. This makes for a nicer API where we don't have a Client object
in a limbo state between being constructed and being connected.

This code still isn't as nice as it should be, as TLS::TLSv12 is still
not a Core::Stream::Socket subclass, which would allow for consolidating
most of the TLS/non-TLS code into a single implementation.
2022-01-13 15:16:12 +03:30
sin-ack
dbd25916a3 LibCore+Userland+Tests: Convert Stream APIs to construct on heap
As per previous discussion, it was decided that the Stream classes
should be constructed on the heap.

While I don't personally agree with this change, it does have the
benefit of avoiding Function object reconstructions due to the lambda
passed to Notifier pointing to a stale object reference. This also has
the benefit of not having to "box" objects for virtual usage, as the
objects come pre-boxed.

However, it means that we now hit the heap everytime we construct a
TCPSocket for instance, which might not be desirable.
2022-01-13 15:16:12 +03:30
Lady Gegga
10a52c0b32 FontEditor: Add Klingon phrase to Preview Font 2022-01-12 22:54:59 +01:00
Idan Horowitz
f9528f1882 Kernel: Rename ProcessorInfo::{m_brandstr => m_brand}
There's no need to specify the type of the member in it's name,
especially not in shorthand format.
2022-01-12 16:09:09 +02:00
Jesse Buhagiar
b397db9948 3DFileViewer: Replace lambertian lighting with GL Lighting 2022-01-12 13:36:56 +01:00
electrikmilk
34c5d33eb0 Base+Userland: Add various icons
Add new icons to menus, add existing icons that could be used in menus.
2022-01-12 10:55:20 +01:00
electrikmilk
64ae8eac0e Base+PixelPaint: Add more menu icons
Adding icons missing from Pixel Paint menus.
2022-01-12 10:55:13 +01:00
electrikmilk
10e473bf26 Base+Browser: Add Browser icons
Add some missing icons to the brower.
2022-01-12 10:54:54 +01:00
kleines Filmröllchen
98c0c5e9e6 Help+Base: Add help://man URLs for links between man pages
The URLs of the form `help://man/<section>/<page>` link to another help
page inside the help application. All previous relative page links are
replaced by this new form. This doesn't change any behavior but it looks
much nicer :^)

Note that man doesn't handle these new links, but the previous relative
links didn't work either.
2022-01-11 00:24:57 +01:00
kleines Filmröllchen
984bae9038 Help: Refactor link handling
Link handling is now split up between open_page and open_url. While
open_page can handle any sort of input and is responsible for handling
history UI, open_url deals in URLs and takes one of a few different
actions depending on the exact URL given. Currently, only file:// URLs
are handled but this will change in the next few commits.

Note that this commit breaks relative URLs on purpose. After the new
help:// URLs, they won't be needed anyways. The reasoning is that many
URLs not specifically pointing to man page directories will cause a
(non-deadly) unveil violation in `real_path_for`. This specifically
concerns the new application launch URLs that are added in the next
commit.
2022-01-11 00:24:57 +01:00
Glenford Williams
f5ff011c1b Spreadsheet: Properly pass parent window to Workbook
Change the parent of the WizardDialog to that of the Spreadsheet window.
Previously the WizardDialog was using the open file dialog as the
parent resulting in the csv import dialog
2022-01-09 20:38:55 +01:00
Marcus Nilsson
876424923a PixelPaint: Verify that we have an ImageEditor instead of returning
We should never be in a state where an action requiring an ImageEditor
is enabled if all tabs are closed.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
ae958d97b2 PixelPaint: Disable actions when no ImageEditor is open
Disable all actions when the last tab is closed and enable them when a
new ImageEditor is created.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
18e6da6d4d PixelPaint: Keep a RefPtr to layer in LayerPropertiesWidget
Using a WeakPtr to keep a reference to the active layer caused it to
be destroyed when the last tab was closed, which made the
m_layer == layer check in set_layer() return early since it was
already null. Because of this the LayerPropertiesWidget was never
disabled.
2022-01-09 20:24:02 +01:00
Marcus Nilsson
7ca4d045bd PixelPaint: Make PaletteWidget::set_image_editor take a ImageEditor*
After closing the last open ImageEditor, selecting a color would try to
dereference it causing a crash. Instead make set_image_editor() take a
pointer to it and set it to nullptr when closing the last tab like we
do with LayerListWidget and LayerPropertiesWidget.
2022-01-09 20:24:02 +01:00
sholm
d54a3f4520 Help: Scroll to the top of page when opening a new link
Previously the scroll position would not reset when loading a new
page. This caused various problems such as opening the page at the
previous pages scroll position and in some instances not even
showing the new page at all.
2022-01-09 20:21:02 +01:00
Mustafa Quraish
0e6576b376 PixelPaint: Move out common logic from Filters into base class
Now, each new filter only has to describe how to actually change
the bitmaps, and the common logic of pulling out the bitmap from the
layer, and marking the action as done, etc is all handled in the
`Filter` base class.

This also makes it possible to apply filters to external bitmaps,
which are not embedded in a `Layer` (which we can use to preview
filters in the future!)
2022-01-09 12:26:07 +01:00
creator1creeper1
45e68b2aa4 PixelPaint: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
6f283a8e60 Piano: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
1b42aff9b5 Welcome: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
f17bd66ecc Mail: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
a76e97df64 PDFViewer: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
77ad98ab7c Calculator: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
20a7cb3004 VideoPlayer: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
c1dc5ef9d7 KeyboardMapper: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
26eee2c02d SystemMonitor: Propagate errors using try_set_main_widget
build_process_window now uses try_set_main_widget and might return an
error. process_properties_action handles a possible error by simply
not updating the process window if an error occured while building it.
2022-01-09 00:56:11 +01:00
creator1creeper1
c60f05b28e 3DFileViewer: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
deed6388ef FontEditor: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
creator1creeper1
de82901d4c TextEditor: Propagate errors using try_set_main_widget in main 2022-01-09 00:56:11 +01:00
Leonardo Nicolas
9aa0cf3265 FileManager: Do not allow rename files that cannot be modified
Pressing the F2 key on files that the user doesn't have permission was
opening the file name for editing.

This patch fixes the issue disabling the file name editing when the user
doesn't have permission to do it.

To reproduce the issue:

1) Open the File Manager
2) Click on the /etc directory
3) Select any file
4) Press the F2 key
5) Update the file name
2022-01-09 00:47:48 +01:00
Mustafa Quraish
c5fb55725e PixelPaint: Only clear LayerListWidget if there are no editors left
Previously, we would clear it if there was still an editor open. This
was not obvious because it was only visible when an inactive tab was
closed, since closing an active tab would trigger an editor change
which would re-fill the layers widget.
2022-01-09 00:19:47 +01:00
Mustafa Quraish
6c60bf7537 PixelPaint: Move request_close_editor() logic inside ImageEditor
This allows us to request any specific editor to close itself. Earlier,
this could only be done for the currently active editor, so trying to
close inactive tabs would not work properly.
2022-01-09 00:19:47 +01:00
Mustafa Quraish
c2b3bab984 PixelPaint: Move save and save_as logic inside ImageEditor
Previously the save logic was hardcoded to only work for the active
editor, so closing editors in the background would not properly
handle the unsaved changes. This patch brings us closer to be able
to fix that problem.
2022-01-09 00:19:47 +01:00
Maciej
1d98499234 FontEditor: Support selection ranges
This makes editing much easier, e.g. you don't need longer to copy
hundreds of glyphs one by one.

It has some flaws, e.g. it's not integrated with undo stack,
but we need to start with something!
2022-01-09 00:18:46 +01:00
Maciej
22b3c25f10 FontEditor: Save scale to config file 2022-01-09 00:18:46 +01:00
Maciej
4d4764e0fb FontEditor: Display something for emoji glyphs
This commit makes FontEditor displaying emojis in GlyphMapWidget. They
are not editable, what is marked by red background of a glyph.

Additionally, a proper information is displayed in statusbar.

Fixes #10900.
2022-01-09 00:18:46 +01:00
Linus Groh
eb60d16549 LibJS: Convert Interpreter::run() to ThrowCompletionOr<Value>
Instead of making it a void function, checking for an exception, and
then receiving the relevant result via VM::last_value(), we can
consolidate all of this by using completions.

This allows us to remove more uses of VM::exception(), and all uses of
VM::last_value().
2022-01-08 23:43:03 +01:00
Xavier Defrang
b1a15b02f1 PixelPaint+LibGfx: Add sepia color filter 2022-01-08 12:31:11 +01:00
Jean-Paul Balabanian
a69598a670 KeyboardMapper: Add support for dynamic keyboard visualization 2022-01-08 11:50:26 +01:00
mjz19910
10ec98dd38 Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
Marcus Nilsson
eb97617ff0 PDFViewer: Add actions to rotate the displayed PDF
This implements the rotate cw/ccw actions in PDFViewer.
Since the rendered pages are stored in a HashMap for caching,
the bitmap is wrapped in a struct with the current rotation.
This way the caching works as expected while zooming, and a new bitmap
is rendered when the page is rotated.
2022-01-06 21:25:02 +01:00
Marcus Nilsson
cecbed467b LibGUI: Move rotate cw/ccw to CommonActions
The rotate clockwise/rotate counterclockwise actions can be added to
CommonActions since they are repeated in FontEditor, ImageViewer and
PixelPaint. This keeps the shortcuts and icons consistent across
applications.
2022-01-06 21:25:02 +01:00
Marcus Nilsson
56bec4968c PDFViewer: Enable panning with middle mouse button
Enable the use of the middle mouse button for panning in PDFViewer.
2022-01-06 21:25:02 +01:00
Marcus Nilsson
3af71c406d PDFViewer: Add zoom in/out/reset menu actions
Make PDFViewer::zoom_in() & ::zoom_out() public and add menu and toolbar
actions. Also add an action for zoom reset.
2022-01-06 21:25:02 +01:00
Marcus Nilsson
45085122ee PDFViewer: Fix sidebar toggle logic
The open_outline_action logic was backwards resulting in it
being closed on the first click and opened on the second,
and opposite if document->outline() was true.

There was also a collision with the Ctrl+O shortcut for opening a
document, this changes it to Ctrl+S instead.

This commit also changes the wording to 'Toogle' instead of 'Open/Close'
since the text wasn't updated as expected, and lastly, add a View menu
with the action.
2022-01-06 21:25:02 +01:00
Junior Rantila
e114e2e66d ImageViewer: Show error if wallpaper could not be set 2022-01-06 18:20:07 +01:00
Junior Rantila
9a2aad9eca ImageViewer: TRY all the things 2022-01-06 18:20:07 +01:00
Junior Rantila
9a38d1de07 LibCore+ImageViewer: Add unlink() wrapper, use it 2022-01-06 18:20:07 +01:00
RasmusNylander
c00014fa54 KeyboardMapper: Port to Core::Stream
Port KeyboardMapperWidget to use the new Core::Stream instead of the old
IODevice.

If you can't beat 'em, join 'em.
2022-01-06 17:54:03 +01:00
RasmusNylander
9678ff15a8 KeyboardMapper: Propagate errors using ErrorOr and TRY
KeyboardMapperWidget's load_map_from_file, load_map_from_system, save,
and save_to_file now all return ErrorOr<void> and no longer handles
alerting the user to potential errors.

main is now responsible for handling errors originating from its calls
to these four functions; it will simply alert the user using the new
method KeyboardMapperWidget::show_error_to_user(Error), which simply
creates a MassageBox displaying the error's string_literal.

This makes the whole program slight more clean feeling :^).
2022-01-06 17:54:03 +01:00
RasmusNylander
017135b44e KeyboardMapper: Port to LibMain 2022-01-06 17:54:03 +01:00
RasmusNylander
64684cbd5d KeyboardMapper: Fix discrepancy between cursor and button clickability
KeyButton now only responds to clicks on the key-cap's face. This
corresponds to when the cursor switches from the default arrow to a
hand.
2022-01-06 17:54:03 +01:00
RasmusNylander
35afd32a51 KeyboardMapper: Fix displaying null characters
Fixes a bug where KeyButtons would display null characters. A single
null character should be handled as an empty string.
2022-01-06 17:54:03 +01:00
RasmusNylander
41b0795f99 KeyboardMapper: Name formerly inlined variables
Renames some variables in KeyButton.cpp to increase clarity and grants
some slightly opaque inline variables names.
2022-01-06 17:54:03 +01:00
RasmusNylander
c4b2efd95e KeyboardMapper: Show multiple pressed keys at once
When depressing a key, KeyboardMapperWidget::keydown_event() will now
update only the pressed state of the button associated with the specific
key, instead of also setting the pressed state of the all the buttons to
false.

This makes it possible to highlight multiple pressed keys at once and
makes the code more consistent; the implementation of keyup_event
implied that this was a feature of the program.
2022-01-06 17:54:03 +01:00
RasmusNylander
a1531dba91 KeyboardMapper: Extract method map_from_name
Extract the mapping of a name to a character map into its own method.
This only slightly reduces the number of lines, going from 24 to 17
lines, but makes the code somewhat more readable and reduces repetition.
2022-01-06 17:54:03 +01:00
RasmusNylander
b2a6c9e5ea KeyboardMapper: Extract creation of map-selection buttons
Extract the creation of map-selection radio buttons from create_frame
into the new private method add_map_radio_button(map_name, button_text)
turning 24 lines into 4 + 6 lines. This makes create_frame a little
easier to read. :^)
2022-01-06 17:54:03 +01:00
Tobias Christiansen
923979ca93 PixelPaint: Unveil FileIconProvider.ini
This is used by the Filter Gallery and previously complained in the
debug log that it was not unveiled.
2022-01-06 15:13:05 +01:00
Lucas CHOLLET
75d1840cfc FileManager: Show Dotfiles when passing a Dotfile as an argument
Before this patch, FileManager was failing to open the directory and
open `/` instead.
2022-01-05 15:20:54 -08:00
Lucas CHOLLET
693ae73606 FileManager: Use String const& instead of String
Change ErrorOr<int> run_in_windowed_mode(String, String)
to ErrorOr<int> run_in_windowed_mode(String const&, String const&)
2022-01-05 15:20:54 -08:00
Mustafa Quraish
7c69830169 PixelPaint: Add new icon for New Image from Clipboard
This is just a slight variation of `/res/icons/16x16/paste.png`, I've
removed the lines on the paper to make it look consistent with the
"New Image" icon, which is an empty piece of paper.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
e2c73a114d PixelPaint: Use 'save' action in toolbar instead of 'save as'
I think this is likely the more common operation and makes more sense
in the toolbar. It calls the 'save as' action internally anyway if there
is no associated file.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
c03f271bbf PixelPaint: Ask about unsaved changes for all tabs on close
Now, when trying to close the application, there is a separate prompt
for each open tab with unsaved changes. Each tab is closed after it is
handled appropriately (assuming the user didn't Cancel), this makes it
so that the message box is always asking about the currently active tab,
allowing the user to see that the image contains.

If at any point the user presses "Cancel", all remaining tabs are kept
open.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
915211252d PixelPaint: Mark editor as unmodified when creating a default image
This is similar to opening an empty text file in TextEditor, the user
is only asked to saved changes if they have made any changes to it.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
fc5c327751 PixelPaint: Mark editor as unmodified when opening an image
Previously a newly opened (and unedited) project was considered
modified, even though there was no need to actually re-save the
contents.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
8c4579bced PixelPaint: Only prompt for unsaved changes if there any
Previously MainWidget::request_close() would always put up the
message box asking to save unsaved changes, even if there aren't any.
This patch makes it so that the message box is only shown if the
undo stack is in a modified state.
2022-01-05 12:08:20 +01:00
Mustafa Quraish
2440d2c2fe PixelPaint: Move title and path from Image to ImageEditor
As noted in the latest hacking video, it doesn't seem to make much
sense to store the title and path in the image itself. These fields
have now been moved to the actual ImageEditor itself.

This allows some nice simplicfications, including getting rid of the
`image_did_change_title` hook of ImageClient (which was just a way to
report back to the editor that the title had changed).
2022-01-05 12:08:20 +01:00