Commit Graph

17860 Commits

Author SHA1 Message Date
martinfalisse
92a00648b1 LibWeb: Parse grid-template-columns and grid-template-rows
Add functionality to begin parsing grid-template-columns and
grid-template-rows. There are still things to be added, like parsing
functions, but I would say a couple of the major points are already
adressed like length, percentage, and flexible-length.
2022-08-25 13:47:48 +02:00
martinfalisse
c40dd9ee78 LibWeb: Add GridTrackPlacementShorthandStyleValue
Add GridTrackPlacementShorthandStyleValue for the use of grid-column and
grid-row.
2022-08-25 13:47:48 +02:00
martinfalisse
08b832eb69 LibWeb: Add GridTrackPlacementStyleValue
Add GridTrackPlacementStyleValue for the use of CSS properties
grid-column-start, grid-column-end, grid-row-start, grid-row-end.
2022-08-25 13:47:48 +02:00
martinfalisse
0148260b5f LibWeb: Add GridTrackSizeStyleValue
Add GridTrackSizeStyleValue for the use of CSS properties
grid-template-columns, grid-template-rows.
2022-08-25 13:47:48 +02:00
martinfalisse
ca286fc220 LibWeb: Add GridTrackPlacement for grid-[column/row]-[start/end]
Add GridTrackPlacement to use with grid-column-start and related CSS
properties.
2022-08-25 13:47:48 +02:00
martinfalisse
fc36970973 LibWeb: Add GridTrackSize class for grid-template-*
Add GridTrackSize to be used with grid-template-column and
grid-template-row.
2022-08-25 13:47:48 +02:00
martinfalisse
e4c5799026 LibWeb: Add GridFormattingContext 2022-08-25 13:47:48 +02:00
martinfalisse
e4541d83d3 LibWeb: Parse grid display value 2022-08-25 13:47:48 +02:00
MacDue
b609dd7348 Eyes: Add an option to show/hide the window frame
This works the same as in the Cube demo, and now allows enjoying
the eyes without any obstructions :^)

The window frame can now be disabled with the -h/--hide-window
command-line option, or via toggle in the GUI.
2022-08-25 13:42:17 +02:00
faxe1008
21358d8a5f PixelPaint: Reduce verbosity of crop to content feature
This patch reduces the repetitiveness of the crop to content feature
implementation.
2022-08-25 13:38:31 +02:00
thankyouverycool
d5de9bcc51 Applications: Use modeless windows in some apps
Browser, Spreadsheet and Charactermap now open child windows
modelessly.
2022-08-25 13:28:50 +02:00
thankyouverycool
35a230f974 LibGUI+Taskbar+WindowServer: Remove mode and parent methods from Taskbar
Taskbar only needs a modeless parent and the activity state of the
modal chain to update buttons.
2022-08-25 13:28:50 +02:00
thankyouverycool
d54dc22362 WindowServer: Default to Desktop when picking a new active window 2022-08-25 13:28:50 +02:00
thankyouverycool
af706d081c WindowServer: Invalidate new and previous active input window frames
Fixes shared active title bar theming not updating for capturing
modals.
2022-08-25 13:28:50 +02:00
thankyouverycool
6f316d59f4 WindowServer: Restore modal chains from the Taskbar and Switcher
And only show modeless windows in WindowSwitcher.
2022-08-25 13:28:50 +02:00
thankyouverycool
5a0472d8d2 WindowServer: Use nearest modeless window for modal Taskbar rects
Modeless windows are guaranteed Taskbar buttons which lets us
simplify getting the proper taskbar rect for modals.
2022-08-25 13:28:50 +02:00
thankyouverycool
df2f479810 WindowServer: Don't move child windows in unison with their parents
This was a cludge for ComboBox ListView windows when they were first
implemented. The behavior is no longer needed and not very ergonomic
when moving Normal windows around.
2022-08-25 13:28:50 +02:00
thankyouverycool
2b2c317c2d WindowServer: Don't let modals minimize themselves
But do allow them to remain minimizable by a parent. This is a nice
ergonomics fix to allow a parent window to quickly minimize and
restore all its modal children.
2022-08-25 13:28:50 +02:00
thankyouverycool
788b16cbf8 WindowServer: Replace modal stacks with modal chains
And apply modal effects on move_to_front_and_make_active()

Instead of building a vector of windows every time we want to
loop over a group of related modals, simply recurse through
their ancestory. This lineage is now called a modal chain. Modal
chains begin at the first modeless parent, and a new chain
starts at every modeless child. This lets apps spawn child windows
independent of the main window's modal effects, restore state,
and workspace, yet still remain descendants.

Looping through a modal chain is recursive and includes the
modeless window which begins it.
2022-08-25 13:28:50 +02:00
thankyouverycool
4c7f95e2f8 LibGUI+WindowServer+Apps: Replace Accessory Windows
with the CaptureInput WindowMode. This mode will serve the same
function as accessories: redirecting input while allowing parent
windows to remain active.
2022-08-25 13:28:50 +02:00
thankyouverycool
0d4fd4e2a6 LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindows
with the RenderAbove WindowMode. This mode will ensure child
windows always draw above their parents, even when focus is lost.
RenderAbove modals are automatically themed the same as the old
ToolWindows. Fixes ToolWindows rendering above ALL normal windows,
regardless of parent. We can't rely on WindowType to create these
sort of effects because of WindowManager's strict display hierarchy.
2022-08-25 13:28:50 +02:00
thankyouverycool
589572cfa4 LibGUI+WindowServer: Introduce WindowModes
Previously, Windows only understood blocking modality: Windows were
either modal, i.e., in a blocking state, or not. Windows could also
be set as Accessories or ToolWindows, attributes which technically
applied modes to their parents but were implemented ad hoc. This patch
redefines these modal effects as WindowModes and sets up some helpers.
This will let us simplify a lot of modal logic in the upcoming patches
and make it easier to build new modal effects in the future.

Windows can now set 1 of 5 modes before reification:
-Modeless:	No modal effect; begins a new modal chain
-Passive:	Window joins its modal chain but has no effect
-RenderAbove:	Window renders above its parent
-CaptureInput:	Window captures the active input role from its parent
-Blocking:	Window blocks all interaction with its modal chain

States like fullscreen and tiling are dynamic and don't alter behavior
in modal chains, so they aren't included.
2022-08-25 13:28:50 +02:00
thankyouverycool
609391b46e WindowServer: Add modeless_ancestor() helper 2022-08-25 13:28:50 +02:00
thankyouverycool
ab517aa21d WindowServer: Remove m_unmaximized_rect from Window
Superceded by m_floating_rect
2022-08-25 13:28:50 +02:00
thankyouverycool
68570e897d LibGfx+WindowServer: Remove set_size_around() from Rect and Window
Superceded by to_floating_cursor_position() as a more accurate way
to reposition windows on untile. Effectively made set_size_around()
dead code, so the remnants can be removed.
2022-08-25 13:28:50 +02:00
thankyouverycool
a1dceb5b97 WindowServer: Remove nudge_into_desktop() from Window
Positioning windows outside visible coordinates is valid if sometimes
curious behavior, but it shouldn't be considered misbehavior by default.
There are multiple ways to recover windows with obscured title bars,
and this function papers over actual resize bugs and is no longer
needed to normalize window size, so let's remove it for now.
2022-08-25 13:28:50 +02:00
thankyouverycool
b180132c87 WindowServer: Fix typo 'reminder' -> 'remainder' in WindowManager 2022-08-25 13:28:50 +02:00
thankyouverycool
24b8301a0e WindowServer: Get taskbar height from TaskbarWindow directly
Fixes incorrect hardcoded heights and a failure to get taskbar
height when tiling on new workspaces.
2022-08-25 13:28:50 +02:00
thankyouverycool
c5dd72ac71 LibGUI: Remember size and position of hidden Windows
And don't reset windowless rects on resize events. Fixes child
windows reappearing at [0,0] and with the wrong dimensions after
being hidden.
2022-08-25 13:28:50 +02:00
thankyouverycool
f833473df0 Apps+Demos+Dialogs: Remove unnecessary minimum window sizes
The new layout system conveniently calculates these for us now.
In the case of Mandelbrot where it needs to be overriden, make
sure to disable obey min widget size first. In EmojiInputDialog's
case, the window needs to be resized instead to center correctly.
2022-08-25 13:28:50 +02:00
thankyouverycool
46d6347035 LibGUI+WindowServer: Initialize minimum window size to zero
And remove unnecessary workarounds to the old limit of {50, 50} and
the cautious but arbitrary limit of {1, 1} for other WindowTypes.
Null rects are already the default when calculating minimum window
size and are the least restrictive but valid value.

Also returns early during minimum size calculations for frameless
windows, and verifies against negative minimum sizes and failure to
disable widget min size before setting a minimum window size. Layout
automatically overrides this setting each relayout otherwise.
2022-08-25 13:28:50 +02:00
davidot
8b8cee3172 LibCrypto: Implement a (mostly) proper to_double for UnsignedBigInteger
SignedBigInteger can immediately use this by just negating the double if
the sign bit is set.
For simple cases (below 2^53) we can just convert via an u64, however
above that we need to extract the top 53 bits and use those as the
mantissa.

This function currently does not behave exactly as the JS spec specifies
however it is much less naive than the previous implementation.
2022-08-24 23:27:17 +01:00
davidot
2290fbc2a0 LibCrypto: Make a VERIFY a static_assert since it only uses constants 2022-08-24 23:27:17 +01:00
davidot
fce2b33758 LibJS: Allow BigInts as destructuring property names
These are simply treated as their numerical value which means that above
2^32 - 1 they are strings.
2022-08-24 23:27:17 +01:00
davidot
e663504df1 LibJS: Fix that leftshift for BigInts did not round down
For negative number this previously rounded towards zero instead of the
intended always rounding down.
2022-08-24 23:27:17 +01:00
davidot
cb49c07fb7 LibJS: Use the new BigInt compare_to_double algorithm :^)
Although this is much more complicated it does not seem to impact
performance that much even when looking only at values in which the
previous casting to i32 was correct.
2022-08-24 23:27:17 +01:00
davidot
b5c00830c2 LibCrypto: Add a way to compare a SignedBigInteger with a double
This supports any double value (except for NaNs) instead of having to
cast the double to some smaller type which doesn't work for very large
values.
2022-08-24 23:27:17 +01:00
James Bellamy
352d6545a9 WindowServer+DisplaySettings: Capitalize display mode dropdown
Every other dropdown in settings is capitalized apart from this one.
This commit fixes that.
2022-08-24 12:17:30 +02:00
electrikmilk
1a9d4ffecf PixelPaint: Add more icons
This adds menu item icons for Add Mask, Flatten Image, Fit Image To
View, and Generic 5x5 Convolution.

This modifies the menu item icon for Swap Colors to make the action more
obvious and improve accessibility.
2022-08-24 12:01:19 +02:00
davidot
a9d2d806b6 LibJS: Use __builtin_isnan in static_assert instead of isnan
For the fuzzer build isnan was not usable in a constexpr context however
__builtin_isnan seems to always be.

Also while we're here add my name to the copyright since I forgot after
the Value rewrite.
2022-08-23 22:30:15 +01:00
Andreas Kling
34a09bbb54 PixelPaint: Add simple "Crop Image to Content" feature
This command finds the smallest non-empty content bounding rect
by looking for the outermost non-transparent pixels in the image,
and then crops the image to that rect.

It's implemented in a pretty naive way, but it's a start. :^)
2022-08-23 22:39:27 +02:00
Andreas Kling
5ded6904d8 PixelPaint: Make the default empty image transparent by default
It was previously white by default, but let's change that. :^)
2022-08-23 22:39:27 +02:00
Andreas Kling
28714deff6 PixelPaint: Avoid division-by-zero in HistogramWidget
This is more of a hack fix than anything else, but let's stop PixelPaint
from infinite-looping in HistogramWidget::paint_event().
2022-08-23 22:39:27 +02:00
Jose Flores
355911c44e SQLStudio: Reset status bar and menu actions when closing a tab 2022-08-23 19:08:26 +01:00
Emily Trau
abc150085f LibC: Add missing sys/cdefs.h include
Some header files use __BEGIN_DECLS without including sys/cdefs.h.
This causes issues for C code that compiles against these headers,
which may occur with Ports.
2022-08-23 19:07:12 +01:00
Ali Mohammad Pur
e70624de9f LibWeb: Don't grow Wasm memory again after initialisation
The constructor grows the memory to the initial size, we don't need to
do that again.
2022-08-23 19:04:18 +01:00
Tim Schumacher
5f99934dce Userland: Consolidate most PATH resolving into a single implementation
We previously had at least three different implementations for resolving
executables in the PATH, all of which had slightly different
characteristics.

Merge those into a single implementation to keep the behaviour
consistent, and maybe to make that implementation more configurable in
the future.
2022-08-23 19:00:04 +01:00
Tim Schumacher
39a3775f48 Userland: Rely on a single authoritative source for the default PATH 2022-08-23 19:00:04 +01:00
Linus Groh
61e18c681b LibWeb: Restore realm retrieval from 'this' in activate_event_handler()
Removing the FIXME'd code in b99cc7d was a bit too eager, and relying on
the main thread VM's current realm only works when JS is being executed.

Restore a simplified version of the old code to determine the realm this
time instead of the global object, following the assumptions already
made in get_current_value_of_event_handler() regarding what kind of
event target 'this' can be.
2022-08-23 17:44:39 +01:00
Linus Groh
987927a596 LibJS: Remove Bytecode::Register::global_object()
This is unused.
2022-08-23 13:58:30 +01:00