Commit Graph

2404 Commits

Author SHA1 Message Date
thankyouverycool
930e5c27df ClockSettings: Increase max visible items for time zone ComboBox 2022-09-22 21:37:26 +02:00
Sam Atkins
7a2da4cabf Browser+WebContent+LibJS: Support %c specifiers in Console.log()
...and the other Console methods.

This lets you apply styling to a log message or any other text that
passes through the Console `Formatter` operation.

We store the CSS on the ConsoleClient instead of passing it along with
the rest of the message, since I couldn't figure out a nice way of
doing that, as Formatter has to return JS::Values. This way isn't nice,
and has a risk of forgetting to clear the style and having it apply to
subsequent messages, but it works.

This is only supported in the Browser for now. REPL support would
require parsing the CSS and figuring out the relevant ANSI codes. We
also don't filter this styling at all, so you can `position: absolute`
and `transform: translate(...)` all you want, which is less than
ideal.
2022-09-21 20:03:49 +01:00
Sam Atkins
a875713f2e Browser: Ignore whitespace-only input in the JS console 2022-09-21 20:03:49 +01:00
Andreas Kling
4814e1bd65 Browser: Ignore title updates when history has no current item
The Browser::History class is oblivious to the state of the browsing
context's session history over on the LibWeb side. We need to hook a lot
more thing up here, but for now just ignore updates when there's no
current history item. This fixes a VERIFY() error on startup.
2022-09-21 13:06:17 +02:00
Orel
d8474805e8 SystemMonitor: Save configuration of columns
Save the columns configuration from the last run in the respective
config file, and add a function to check whether a column should be
visible by default.
2022-09-21 10:14:40 +01:00
Olivier De Cannière
d3601aedc5 Calendar: Add Settings button to configure the Calendar 2022-09-20 13:12:00 -04:00
Olivier De Cannière
6f69f4bb5e Calendar: Update month view on first_day_of_week setting change
Now when the user changes their preferred first day of the week in the
Calendar Settings, the Calendar application and applet views are update
accordingly without needing to restart them.
2022-09-20 13:12:00 -04:00
Olivier De Cannière
a1d98b825d Calendar: Add setting to choose default view
This commit adds an entry to the Calendar Settings to allow the user to
select between the month and year views as the startup default.
2022-09-20 13:12:00 -04:00
Olivier De Cannière
0eceed4fd7 Calendar: Add a Calendar settings dialog for the first day of the week
This commit adds a new settings dialog for the Calendar application and
applet. It allows the user to specify their preferred first day of the
week.
2022-09-20 13:12:00 -04:00
Sam Atkins
183b054695 SoundPlayer: Port M3UParser to Core::Stream
Also make the path parameter a StringView, since that's what gets passed
in.
2022-09-20 07:48:45 -04:00
Sam Atkins
2dea636f33 Run: Use Core::Stream API for command history file 2022-09-20 07:48:45 -04:00
Sam Atkins
aee52a458b PixelPaint: Remove unused Image::write_to_file() method
This seems to be a remnant from before FileSystemAccessClient was used.
2022-09-20 07:48:45 -04:00
Andreas Kling
d4acdac317 LibWeb+WebContent+Browser: Plumb visibility state from GUI to web pages
OOPWV now reacts to show/hide events and informs LibWeb about the state
change. This makes visibilitychange events fire when switching tabs. :^)
2022-09-20 10:32:14 +02:00
ne0ndrag0n
b16704d4db GamesSettings: Always ensure last card back selected is saved 2022-09-20 07:59:13 +01:00
Tommaso Peduzzi
f547b9be7b PixelPaint: Scale layer and preserve aspect ratio
This patch adds the ability to scale a layer and
preserve the aspect ratio.
When the Shift key is pressed, the aspect ratio is preserved.
2022-09-16 22:53:07 +02:00
Tommaso Peduzzi
293ab2cdc9 PixelPaint: Add scaling function to move tool
This patch adds scaling function to the move tool.
When the cursor is over the lower right corner of the layer, it changes.
This is to signify that the layer can be scaled by dragging the mouse.

There is currently no preview of the scaling.
Doing a resize every time the mouse moves leads to unexpected behavior.
2022-09-16 22:53:07 +02:00
Andrew Kaster
8ed5ed3ec0 LibGL: Make GL::create_context fallible
Propagate errors in places that are already set up to handle them, like
WebGLRenderingContext and the Tubes demo, and convert other callers
to using MUST.
2022-09-16 15:32:38 +02:00
Lucas CHOLLET
53eb35caba Calculator: Change internal representation to support perfect division
The purpose of this patch is to support addition, subtraction,
multiplication and division without using conversion to double. To this
end, we use the BigFraction class of LibCrypto. With this solution, we
can store values without any losses and forward rounding as the last
step before displaying.
2022-09-15 14:08:21 +01:00
Brian Gianforcaro
d0a1775369 Everywhere: Fix a variety of typos
Spelling fixes found by `codespell`.
2022-09-14 04:46:49 +00:00
networkException
802cf9bc69 Everywhere: Use my very shiny serenityos.org email :^) 2022-09-12 15:13:12 +01:00
networkException
45aeba15c8 CharacterMap: Allow resizing the unicode block list
Previously we would constrain the unicode block list to a width of 175,
causing it to stick to the splitter when manually resizing.

This patch allows resizing the list properly while retaining the new
width when resizing the window.
2022-09-11 23:25:08 +01:00
thankyouverycool
b70e4e9909 Spreadsheet+LibGUI: Set EmojiInputDialog as a CaptureInput modal
This has two advantages: First the picker no longer changes the active
window state of its parent. Visually this is an additional hint that the
dialog is "fragile" and will close on loss of focus. Second, because
it contains a search box, its own input won't be preempted by global
application shortcuts when typing (pending #15129). This is a problem
in apps like PixelPaint which use shortcuts without modifiers.
2022-09-09 11:27:38 -04:00
electrikmilk
fff79379d4 Spreadsheet: Add Insert Emoji action
This adds the Insert Emoji action to Spreadsheet.
2022-09-08 23:08:54 +01:00
electrikmilk
44a5deff40 TextEditor: Add Insert Emoji action
This adds the Insert Emoji action to Text Editor.
2022-09-08 23:08:54 +01:00
thankyouverycool
35e557c657 Browser+LibGUI+WindowServer: Open Button menus uniformly
Instead of letting buttons determine the relative position
of their menus, a workaround only used by Statusbar segments,
open them all uniformly for a nice, consistent UI.

Passing a rect to popup() now routes to open_button_menu(), an
analog to open_menubar_menu(), which adjusts the menu's popup
position in the same way. Fixes button menus obscuring the buttons
which spawn them and jutting out at odd corners depending on screen
position.
2022-09-08 10:17:27 +01:00
electrikmilk
6675865582 Browser: Add context menu icons
This adds two new icons for browser context menu items "Close Other
Tabs" and "Download".

This adds existing icons where they were missing in context menu items.
2022-09-08 10:02:37 +01:00
networkException
178164808c Calendar: Limit the starting day input range to the selected month
Previously we allowed entering any day value greater than one. With this
patch the maximum input value is dynamic based on the selected month and
year.
2022-09-06 17:37:44 +01:00
Timothy Flynn
9e860d973e LibLocale: Move locale source files to the LibLocale library
Everything is now setup to create the LibLocale library and link it
where needed.
2022-09-05 14:37:16 -04:00
Timothy Flynn
43a3471298 LibLocale: Move locale source files to the LibLocale folder
These are still included in LibUnicode, but this updates their location
and the include paths of other files which include them.
2022-09-05 14:37:16 -04:00
Timothy Flynn
ff48220dca Userland: Move files destined for LibLocale to the Locale namespace 2022-09-05 14:37:16 -04:00
Timothy Flynn
fc8bf7ac3e LibUnicode+Userland: Migrate generated CLDR data to LibLocaleData
Currently, LibUnicodeData contains the generated UCD and CLDR data. Move
the UCD data to the main LibUnicode library, and rename LibUnicodeData
to LibLocaleData. This is another prepatory change to migrate to
LibLocale.
2022-09-05 14:37:16 -04:00
kleines Filmröllchen
c1c2e6f7d7 PixelPaint: Introduce a vectorscope
Vectorscopes are a standard tool in professional video/film color
grading. *Very* simply, the Vectorscope shows image colors with hue as
the angle and saturation as the radius; brightness for each point in the
scope is determined by the number of "color vectors" at that point. More
specifically, the Vectorscope shows a 2D UV histogram of the image,
where U and V are the chroma ("color") channels of the image.

Co-authored-by: MacDue <macdue@dueutil.tech>
2022-09-03 16:57:37 +01:00
kleines Filmröllchen
e6f20f27d8 PixelPaint: Invoke the modified_change callback when layers change
This propagates layer edits as well as undo stack operations to whoever
needs to perform updates when the image changes.
2022-09-03 16:57:37 +01:00
kleines Filmröllchen
fe88fd22fa PixelPaint: Extract common scope code into a generic ScopeWidget
When we add more scopes, this will facilitate code sharing.
2022-09-03 16:57:37 +01:00
kleines Filmröllchen
8b60305698 PixelPaint: Specify histogram height in GML
The histogram is perfectly fine with being drawn at any size, but the
code currently fixes its height to 65. Once the histogram is in a
subclass and several GML things around it change, the fixed height
breaks, so we move the height specification to GML. Additionally, the
container is specified to shrink as much as possible, alleviating a
hard-coded UI size. The user can now change histogram height in GML,
which is a lot more obvious.
2022-09-03 16:57:37 +01:00
Timothy Slater
f2da577e77 PixelPaint: Change repeated code into a loop for Wand Select Tool 2022-08-31 18:19:46 +01:00
Timothy Slater
25ac38cac1 PixelPaint: Make erase_selection work for non-rectangular selections
Layer::erase_selection used to erase the entire bounding box of the
selection. With the add/subtract merge modes for the selection tool it
is possible to create selections which are not rectangular. This leads
to deleting pixels that were not selected.

This change adjusts the erase behavior to walk the selection rect and
check if a pixel is selected or not before deleting.
2022-08-31 16:59:22 +01:00
Timothy Slater
fcf86b07a5 PixelPaint: Add Wand Select Tool
Wand Selection tool uses similar logic to the Bucket Tool. Flood filling
and threshold calculations to determine the affected area just in this
case we do not set the pixels of the selected area, instead we use
those pixels to alter the selection mask.

In the future we can probably abstract out the shared flood logic so
both tools can share the code.
2022-08-31 16:30:23 +02:00
Timothy Slater
066c5acee1 PixelPaint: Change BucketTool flood fill algorithm
This resolves some cases where the existing filling algorithm could get
stuck in a recursion loop and evenutally overflow the stack.
2022-08-31 16:26:09 +02:00
Timothy Slater
0506f4eef8 PixelPaint: Account for alpha in color distance calculation
This fixes an issue where BucketTool would consider "black"
and "transparent" the same color.
2022-08-31 16:26:09 +02:00
Crax97
7d544344ca PixelPaint: Add point_position_to_preferred_cell to RectangleSelectTool
Specializing point_position_to_preferred_cell for the
RectangleSelectTool as it selects a new cells with a rounding
behavior instead of a flooring behavior
2022-08-31 12:20:55 +02:00
Crax97
3d756e89c8 PixelPaint: Ask the current tool for the preferred pixel location
When handling mouse events, different tools may want to interact
with a different pixel in the image for the same input position.
2022-08-31 12:20:55 +02:00
Crax97
c9fb380490 PixelPaint: Execute mousemove_event early return check before
This is done to allow querying the current active tool inside the
event_with_pan_and_scale_applied and event_adjusted_for_layer
functions without risking a null pointer dereference
2022-08-31 12:20:55 +02:00
Crax97
3037f5b183 PixelPaint: Add point_position_to_preferred_cell method to Tool
This method is used to point a position at the preferred pixel of
the image. Certain tools may want to specify a different preferred
pixel for the same input position.
2022-08-31 12:20:55 +02:00
Adam Jakubek
aa466723eb FileManager: Navigate to parent dir when current location is removed
When the location currently displayed in FileManager is removed, find
the nearest existing parent path and open it in the window.
Without the fix, the FileManager window remained in the deleted
directory.

Changing the path in 'DirectoryView' object will automatically update
other components in the FileManager (breadcrumb bar, directory tree
view).
2022-08-31 10:32:41 +01:00
thankyouverycool
cce9172cd4 Applications+DevTools: Remove fixed sizes from Splitters
And adjust some GML properties. Since a808cfa, splitters grow
opportunistically. Setting them to fixed sizes now quite literally
fixes them in place. Fixes immovable splitters missed in the
aforementioned commit.
2022-08-30 16:28:44 +01:00
djwisdom
27f5a18ce6 HexEditor: Add Help->Manual entry in Menu 2022-08-29 09:25:29 +01:00
Linus Groh
cfa5885855 LibJS: Turn initialize_global_object() into a regular initialize()
There's nothing special about global object initialization anymore, this
can just work the same way as for any other object now.
2022-08-28 16:36:56 +01:00
Andreas Krohn
8aca5ab3b3 PixelPaint: Cropping to content with moved layers was broken
When cropping to content with a layer not positioned at 0,0 the moved
layers content disappeared and the layers position was not updated
according to the crop offset.

There's probably an easier/more efficient way, but for my testcase this
improves the behavior.
2022-08-28 11:22:42 +01:00
Kevin Meyer
6e006be9e6 PixelPaint: Fix const correctness of Selection::in_interactive_selection 2022-08-28 10:14:18 +01:00