Commit graph

40869 commits

Author SHA1 Message Date
Andrew Kaster
5ab3fcf710 Meta: Update jakt build support for fully bootstrapped compiler
Remove the Corrosion dependency, and use the now-builtin
add_jakt_executable function from the Jakt install rules to build our
example application.

By using find_package(Jakt), we now have to set ENABLE_JAKT manually on
both serenity and Lagom at the same time, so the preferred method to do
this for now is:

    cmake -B Build/superbuild<arch><toolchain> \
          -S Meta/CMake/Superbuild \
          -DENABLE_JAKT=ON \
          -DJAKT_SOURCE_DIR=/path/to/jakt

Where omitting JAKT_SOURCE_DIR will still pull from the main branch of
SerenityOS/jakt. This can be done after runing Meta/serenity.sh run.
2022-09-09 11:23:42 +02:00
thankyouverycool
72ae082ca8 WindowServer: Let Windows handle InputLeft events when blocked
Fixes windows not updating on active input changes after being
blocked
2022-09-08 23:21:54 +01:00
thankyouverycool
51006930da LibGUI: Only react on KeyDown when escaping a Dialog
Both KeyEvents aren't necessary and erroneously close two
Dialogs at once.
2022-09-08 23:21:54 +01:00
thankyouverycool
463aff827e LibGUI+WindowServer: Notify Windows on input preemption
Previously Menus set themselves as active input solely to make
sure CaptureInput modals would close, but this is a functional
half-truth. Menus don't actually use the active input role; they
preempt normal Windows during event handling instead.

Now the active input window is notified on preemption and Menus
can remain outside the active input concept. This lets us make
more granular choices about modal behavior. For now, the only
thing clients care about is menu preemption on popup.

Fixes windows which close on changes to active input closing
on their own context menus.
2022-09-08 23:21:54 +01:00
thankyouverycool
6c35aac617 WindowServer: Add unadjusted position members to Menu
Used to determine Menu relationships by proxy
2022-09-08 23:21:54 +01:00
Timothy Flynn
7c9ad6cc2f LibGUI: Add Unicode emoji group filters to the EmojiInputDialog
This allows users to filter the list of displayed emoji by the group to
which the emoji belong.
2022-09-08 23:12:31 +01:00
Timothy Flynn
273045d40e LibGUI: Display emoji in the EmojiInputDialog in Unicode display order 2022-09-08 23:12:31 +01:00
Timothy Flynn
c2148c7dde LibGUI: Add placeholder text to the emoji picker search box
Co-authored-by: electrikmilk <brandonjordan124@gmail.com>
2022-09-08 23:12:31 +01:00
Timothy Flynn
b61eca0a1e LibUncode: Parse and generate emoji code point data
According to TR #51, the "best definition of the full set [of emojis] is
in the emoji-test.txt file". This defines not only the emoji themselves,
but the order in which they should be displayed, and what "group" of
emojis they belong to.
2022-09-08 23:12:31 +01: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
electrikmilk
6a09d89329 Base+LibGUI: Add insert emoji common action
This adds a common action to invoke the emoji picker.
2022-09-08 23:08:54 +01:00
djwisdom
dd510b24c9 Ports: Update serenity-theming use latest commit 3b4e1f2 2022-09-08 18:07:07 +01:00
Sam Atkins
edc3ed2a0e AK: Allow creating NonnullPtrVectors from an initializer list
This was present in Vector already. Clang-format fixed some const
positions automatically too.

Also removed a now-ambiguous and unnecessary constructor from Shell.
2022-09-08 18:53:08 +02:00
Jelle Raaijmakers
f3877daac5 Ports: Build Quake in parallel
Instead of overwriting the existing `-j` makeopt, we only append
options. This brings the build time for the Quake port down from 24.3s
to 4.4s on my machine.
2022-09-08 12:08:09 -04:00
Jelle Raaijmakers
b42feb76a0 LibSoftGPU: Use approximation for maximum depth slope
OpenGL allows GPUs to approximate a triangle's maximum depth slope
which prevents a number computationally expensive instructions. On my
machine, this gives me +6% FPS in Quake III.

We are able to reuse `render_bounds` here since it is the containing
rect of the (X, Y) window coordinates of the triangle, thus its width
and height are the maximum delta X and delta Y, respectively.
2022-09-08 12:07:03 -04:00
Jelle Raaijmakers
08204efe1f LibGL: Set correct color material mode for GL_AMBIENT_AND_DIFFUSE
This was a silly mistake :^)
2022-09-08 12:05:54 -04:00
Andreas Kling
7ba6eb37fc LibWeb: Rename confusing parameter to layout_block_level_box()
It wasn't the content height, but rather the the bottom edge of the
lowest margin box.
2022-09-08 15:03:55 +02:00
Andreas Kling
af73a5d921 LibWeb: Use correct box edge when looking for space between floats 2022-09-08 15:03:55 +02:00
Xexxa
0270500383 Base: Add more emoji
👨‍👩‍👧‍👦 - U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466
FAMILY: MAN, WOMAN, GIRL, BOY
👨‍👩‍👦‍👦 - U+1F468 U+200D U+1F469 U+200D U+1F466 U+200D U+1F466
FAMILY: MAN, WOMAN, BOY, BOY
👨‍👩‍👧‍👧 - U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F467
FAMILY: MAN, WOMAN, GIRL, GIRL
👨‍👨‍👧‍👦 - U+1F468 U+200D U+1F468 U+200D U+1F467 U+200D U+1F466
FAMILY: MAN, MAN, GIRL, BOY
👨‍👨‍👦‍👦 - U+1F468 U+200D U+1F468 U+200D U+1F466 U+200D U+1F466
FAMILY: MAN, MAN, BOY, BOY
👨‍👨‍👧‍👧 - U+1F468 U+200D U+1F468 U+200D U+1F467 U+200D U+1F467
FAMILY: MAN, MAN, GIRL, GIRL
👩‍👩‍👧‍👦 - U+1F469 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466
FAMILY: WOMAN, WOMAN, GIRL, BOY
👩‍👩‍👦‍👦 - U+1F469 U+200D U+1F469 U+200D U+1F466 U+200D U+1F466
FAMILY: WOMAN, WOMAN, BOY, BOY
👩‍👩‍👧‍👧 - U+1F469 U+200D U+1F469 U+200D U+1F467 U+200D U+1F467
FAMILY: WOMAN, WOMAN, GIRL, GIRL
2022-09-08 13:20:54 +01:00
Andreas Kling
8f0a48ef23 LibWeb: Make default CSS font settings match other browsers better
Let's make 16px the default font size instead of 10px. This makes our
layout results match those of other engines in many more cases.

Also make the h1-h6 element styles use relative (em) font sizes, also
matching other browsers.
2022-09-08 12:43:49 +02:00
Andreas Kling
3dc82d2fa5 LibGfx: Add API for loading more directories into Gfx::FontDatabase
Also make the font discovery algorithm search subdirectories as well.
This will be used by Ladybird to discover more fonts on non-Serenity
systems. :^)
2022-09-08 12:30:25 +02:00
Andreas Kling
5c2e3d1637 LibWeb+WebContent: Add abstraction layer for generic font families
Instead of hard-coding the names of system fonts to use for the CSS
generic fonts (like "sans-serif", "monospace", etc.) we now call out
to a Platform::FontPlugin and ask for the generic names.
2022-09-08 11:57:03 +02:00
Andreas Kling
26544f559c LibWeb: Make anonymous wrapper blocks actually have "display: block"
We didn't set their display at all before, and since CSS display is not
inherited, anonymous block wrappers were actually "display: inline", but
it kinda worked anyway because we positioned blocks based on their C++
class (BlockContainer) rather than their CSS display value.

Now that we position based on CSS display value, this broke positioning
of anonymous wrapper blocks, and this fixes that.
2022-09-08 11:54:13 +02:00
thankyouverycool
0b0c4fc1e8 WindowServer: Set rendered cache dirty on maximization event
Fixes restore/maximize icon not updating when the cursor overlaps
window frame on restoration.
2022-09-08 10:17:27 +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
thankyouverycool
0fc1925cd7 LibGUI: Simulate a click on arrow key events for AbstractButtons
in exclusive, checkable groups. Instead of merely setting the
button checked, call click() so buttons with registered actions
can activate. Fixes ActionGroups like FileManager's view type
checkables not activating when cycled with the keyboard.
2022-09-08 10:17:27 +01:00
thankyouverycool
ab29f8976d Taskbar: Set TaskbarButton checkable 2022-09-08 10:17:27 +01:00
thankyouverycool
12ee92004d LibGUI+Taskbar: Don't immediately repaint checkable Buttons
Unlike regular buttons, unchecked checkables don't need to repaint
on MouseUp to feel responsive when clicking rapidly. In fact, this
can lead to a flickering effect when a bogus unchecked state gets
painted again before the button's checked one.
2022-09-08 10:17:27 +01:00
electrikmilk
56a719daf8 Base: Add Assembly file type icon
This adds 16x16 and 32x32 file type icons for assembly files.
2022-09-08 10:06:55 +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
electrikmilk
6193fdb477 Base: Add 12 new emojis
🪲 - U+1FAB2 BEETLE
🍰 - U+1F370 SHORTCAKE
🚘 - U+1F698 ONCOMING AUTOMOBILE
🔔 - U+1F514 BELL
🔕 - U+1F515 BELL WITH SLASH
🧼 - U+1F9FC SOAP
✖️ - U+2716 MULTIPLY
 - U+2795 PLUS
 - U+2796 MINUS
 - U+2797 DIVIDE
📛 - U+1F4DB NAME BADGE
✔️ - U+2714 CHECK MARK
2022-09-08 09:56:33 +01:00
electrikmilk
d7cfe35026 Base: Improve 4 emojis
🚥 - U+1F6A5 HORIZONTAL TRAFFIC LIGHT
🚦 - U+1F6A6 VERTICAL TRAFFIC LIGHT
📍 - U+1F4CD ROUND PUSHPIN
🗄️ - U+1F5C4 FILE CABINET
2022-09-08 09:56:33 +01:00
Andreas Kling
9e39f51fd3 LibWeb: Position blocks after previous block-level box, ignoring type
Before this change, block-level boxes were laid out vertically by
placing them after the nearest previous BlockContainer sibling. This
only worked if the preceding block-level box happened to be a
BlockContainer.

This fixes an issue where the screenshot on netsurf-browser.org was not
being laid out properly (it was `img { display: block }` which creates
a block-level ImageBox, and ImageBox is not a BlockContainer but a
ReplacedBox, so the following block-level box was skipping over the
ImageBox and being placed next to whatever was before the ImageBox..)
2022-09-08 01:42:25 +02:00
Andreas Kling
7b0dd98103 LibJS+LibWeb: Spin event loop via VM::CustomData abstraction
Instead of calling Core::EventLoop directly, LibJS now has a virtual
function on VM::CustomData for customizing this behavior.

We use this in LibWeb to plumb the spin request through to the
PlatformEventPlugin.
2022-09-08 00:13:39 +02:00
Andreas Kling
9567e211e7 LibWeb+WebContent: Add abstraction layer for event loop and timers
Instead of using Core::EventLoop and Core::Timer directly, LibWeb now
goes through a Web::Platform abstraction layer instead.

This will allow us to plug in Qt's event loop (and QTimer) over in
Ladybird, to avoid having to deal with multiple event loops.
2022-09-07 20:30:31 +02:00
djwisdom
7e5a8bd4b0 Base: Add five more emojis
🍘 - U+1F358 Rice Cracker
🍤 - U+1F364 Fried Shrimp
🍻 - U+1F37B Clinking beer mugs
🍥 - U+1F365 Fish cake with swirl
🍼 - U+1F37C Baby bottle
2022-09-07 17:56:12 +01:00
Andreas Kling
9018b58875 LibWeb: Only schedule ImageStyleValue resource load once
load_any_resources() may get called multiple times during layout, but
once we've started a resource load, we don't need to do it again.
2022-09-07 17:47:33 +02:00
Andreas Kling
faf9746244 LibWeb: Cache width of "alt" text in ImageBox
We were constantly measuring and re-measuring the "alt" attribute text
of ImageBox layout nodes, even when the alt text didn't change. By
caching this, we avoid a *lot* of repeated text measurement work.
2022-09-07 17:47:33 +02:00
Andreas Kling
514fa83708 LibWeb: Improve float: right behavior
- Use the border box of the floated element when testing if something
  needs to flow around it.
- Take the floated element's containing block size into account (instead
  of the BFC root) when calculating available space on a line where a
  right-side float intrudes.
2022-09-07 17:47:33 +02:00
Andreas Kling
a42506c8b9 LibWeb: Fix three accidental float truncations
We were doing this:

    max(0, some_floating_point_value)

This returns an `int` result based on the type of `0`, oops!
2022-09-07 17:47:33 +02:00
Timothy Flynn
21a89b65fc LibGUI: Set a tooltip on the emojis' buttons to their code point names 2022-09-07 14:34:02 +01:00
Timothy Flynn
eeb7b153a2 LibGUI: Add a search box to filter EmojiInputDialog by code point names 2022-09-07 14:34:02 +01:00
Timothy Flynn
a885406511 LibGUI: Disable EmojiInputDialog updates while re-displaying emoji
To prevent lag when the displayed code points are redrawn in support of
a search box, disable updates while re-adding the emoji buttons.
2022-09-07 14:34:02 +01:00
Timothy Flynn
1c32823dd8 LibGUI: Create the emoji buttons only once for EmojiInputDialog
To prevent lag when the displayed code points are redrawn in support of
a search box, only create the GUI::Button objects for the emoji a single
time. Re-use those buttons when adding them to the dialog.
2022-09-07 14:34:02 +01:00
Timothy Flynn
a511dec5ca LibGUI: Move code to display emoji buttons to a helper function
For a search box to be added, this code will need to be re-invoked as
the search query updates.
2022-09-07 14:34:02 +01:00
Timothy Flynn
3aaaacdb3a LibGUI: Wrap the EmojiInputDialog in a scrollable container
This will prevent the dialog from growing endlessly as emoji are added.
2022-09-07 14:34:02 +01:00
Timothy Flynn
11d29bc2ea LibGUI: Convert EmojiInputDialog to GML
This will allow easily adding components such as a search box. Also,
increase the number of emoji per row. This does not fix the issue where
too many emoji will cause the dialog to grow limitlessly, but it looks a
bit more reasonable now with the number of emoji that we have.
2022-09-07 14:34:02 +01:00
Arun Nanduri
e268316865 Documentation: Amend comment describing use of "virtual" and "final" 2022-09-06 19:15:54 +00:00
electrikmilk
325a8a3d9b Base: Match colors for C++ file type icons
Update the color of the 16x16 version of the C++ file icon to match the
new colors in the 32x32 version of the icon.
2022-09-06 18:44:02 +00:00