Commit graph

3973 commits

Author SHA1 Message Date
Linus Groh
64b44c7f30 LibJS: Implement Temporal.PlainTime.prototype[@@toStringTag] 2021-07-28 21:57:30 +01:00
Linus Groh
ae4bf8fc32 LibJS: Start implementing Temporal.PlainTime
This commit adds the PlainTime object itself, its constructor and
prototype (currently empty), and the CreateTemporalTime abstract
operation.
2021-07-28 21:57:30 +01:00
Linus Groh
321f2c0927 LibJS: Fix types of PlainDateTime iso_{milli,micro,nano}second params
999 does not fit into an u8. :^)
2021-07-28 21:57:30 +01:00
Linus Groh
2ba338869b LibJS/Tests: Remove two leftover console.log() calls 2021-07-28 21:57:30 +01:00
Linus Groh
d84fd3ad5c LibJS: Reflect infallibility editorial change in ToTemporalCalendar
See: https://github.com/tc39/proposal-temporal/commit/3437106
2021-07-28 21:57:30 +01:00
Andreas Kling
2135c66823 Revert "LibGUI: Only dispatch Leave if the now-hovered widget isn't a child"
This reverts commit cfc9ee6f16.

This change was wrong: The parent *does* lose hover when the mouse
cursor enters a child widget. Hover is not hierarchical, there is only a
hovered window and a hovered widget within that window.

This fixes an issue with GUI::TabWidget buttons appearing hovered
despite the mouse cursor not being over the buttons.
2021-07-28 21:28:56 +02:00
Andreas Kling
230f7ce71c Revert "LibGUI: Ignore the Enter event by default"
This reverts commit a5a32fbcce.

This change was wrong: it's fine for a child widget to receive an enter
event despite its parent never getting one. Only the widget directly
under the mouse cursor is considered hovered for enter/leave purposes.
2021-07-28 21:28:56 +02:00
Andreas Kling
410b3c85b6 LibGUI+LibGfx: Highlight currently active tab button with accent color
Use the new "Accent" color role to emphasize the currently active tab
within a GUI::TabWidget. :^)
2021-07-28 20:25:14 +02:00
Andreas Kling
9826d616dd LibGUI: Update windows when they become active/inactive
Since interfaces may look different depending on the window active state
we need to update them when it changes.
2021-07-28 20:25:14 +02:00
Andreas Kling
e378587c82 LibGfx+Base: Add a themable "Accent" color role
This can be used by GUI widgets to draw attention to a specific part of
the widget, for example the currently active sub-widget component.
2021-07-28 20:21:52 +02:00
Andreas Kling
03cca20699 LibGfx: Remove unused StylePainter::paint_surface() 2021-07-28 19:13:08 +02:00
ovf
898b8ffcb6 LibWeb: Avoid assertion failure on parsing numeric character references 2021-07-28 18:32:22 +02:00
LuK1337
3bbab9eb47 LibGUI: Align FilePickerDialog's common locations with file list view 2021-07-28 11:15:48 +02:00
Luke
3ec4ad8a73 LibGUI: Convert indexes to size_t and use Optional in TabWidget
Previously it was using int for indexes and using the -1 magic value.
Supersedes b9d51b8601
2021-07-28 11:03:27 +02:00
Luke
b9d51b8601 LibGUI: Always reset pressed close button index on mouse up in TabWidget
Previously it would only do this if the mouse was over the close 
button.

If you released the mouse outside the close button, the close button
would appear permanently depressed afterwards.
2021-07-28 01:43:51 +02:00
Andreas Kling
b3d27c2340 LibGUI: Add GUI_HOVER_DEBUG runtime debugging flag (environment)
You can now see the outline of GUI widgets when hovering them.
For example:

    $ export GUI_HOVER_DEBUG=1
    $ FileManager

Then move the mouse around in the file manager. :^)
2021-07-28 01:01:02 +02:00
Andreas Kling
3d4f93cf8d LibGUI: Make Label padding work with left/right aligned text
The previous text_rect() algorithm only produced the right result for
horizontally centered labels.

This adds some missing padding to GUI::Statusbar which we've apparently
needed for some time. :^)
2021-07-28 00:10:56 +02:00
TheFightingCatfish
0c53c2dfa2 LibGUI: Add a ClipboardClient for GUI::Clipboard
Anyone who inherits from `GUI::Clipboard::ClipboardClient` will receive
clipboard notifications via `clipboard_content_did_change()`.

Update ClipboardHistoryModel, TextEditor and TerminalWidget to inherit
from this class.
2021-07-27 23:49:25 +02:00
K-Adam
95f393ebcd LibWeb: Return null if an unknown canvas context type is requested 2021-07-27 23:48:23 +02:00
sin-ack
7f1677d574 LibGfx: Take the glyph spacing into account when building a line
Without this, a word might be added to a line despite going outside the
rect, due to the glyph spacing between blocks not being considered.
2021-07-27 23:47:00 +02:00
sin-ack
89d5797705 LibGfx: Remove extra space considered during wrapping
This was previously required because the whitespace was consumed and
manually added back after the fact, but now that we preserve whitespace,
this breaks wrapping of text with whitespace after it.
2021-07-27 23:47:00 +02:00
Timothy Flynn
2f8eb4f068 LibJS: Implement non-ECMA-402 String.prototype.toLocale{Lower,Upper}Case
In implementations without ECMA-402, these methods are to behave like
their non-locale equivalents.
2021-07-27 22:35:24 +01:00
FrHun
7f4a32e7bf AboutDialog: Fix inconsistent margins 2021-07-27 22:17:23 +02:00
FrHun
aa3dd0721a FilePicker: Fix button margins and size 2021-07-27 22:17:23 +02:00
FrHun
749b39997b ProcessChooser: Fix button margins and size 2021-07-27 22:17:23 +02:00
Andreas Kling
d5a27d77d7 LibGfx: Hotfix a -Wmaybe-uninitialized failure on the build bots 2021-07-27 22:08:46 +02:00
sin-ack
7696e96c7f LibGfx: Make TextLayout algorithm whitespace-aware
This converts the TextLayout algorithm from handling just words to
handling blocks of strings. With this model, whitespace is preserved
and inserted as-is, rather than being eaten and then replaced with a
single space (or none, if the whitespace was at the start of the word).

Closes #9032.
2021-07-27 22:05:20 +02:00
sin-ack
4c9c85ac01 Userland: Make TextWrapping::Wrap opt-in
This was breaking many places which didn't expect text to wrap. Now,
the only place where text currently wraps is in GUI::Label.
2021-07-27 22:05:20 +02:00
Timothy Flynn
2dc9ae00af LibJS: Use special case folding for String.prototype.to{Lower,Upper}Case
Note we still have one String.prototype.toLowerCase test262 failure due
to not yet parsing WordBreakProperty.txt.
2021-07-27 21:04:36 +01:00
Timothy Flynn
39f971e42b LibUnicode: Begin implementing special Unicode case folding
This implements unconditional special case folding, and conditional
folding for non-locale cases. Worth noting that the only conditional,
non-locale special case is for converting an uppercase sigma to
lowercase.
2021-07-27 21:04:36 +01:00
Timothy Flynn
5b110034dd LibUnicode: Produce each code point's general category
This will be needed for the Unicode Standard's Default Case Algorithm.
Generate the field as an enumeration rather than a string for easier
comparison.
2021-07-27 21:04:36 +01:00
Timothy Flynn
32ea461385 LibUnicode: Download and parse the special casing UCD file
This adds a SpecialCasing structure to the generated UnicodeData.h/cpp
files. This structure contains casing rules for code points which have
non-1-to-1 upper-to-lower case code point mappings. Further, these rules
may be limited to specific locales or other context.
2021-07-27 21:04:36 +01:00
Linus Groh
af3a26f4cc LibJS: Implement Temporal.Now.plainDateTimeISO() 2021-07-27 19:51:44 +01:00
Linus Groh
0bb19fc51c LibJS: Implement Temporal.Now.plainDateTime() 2021-07-27 19:51:44 +01:00
Linus Groh
f2a2e8e13c LibJS: Implement Temporal.Now.plainDateISO() 2021-07-27 19:51:44 +01:00
Linus Groh
c303bbde54 LibJS: Implement Temporal.Now.plainDate()
...and ten required AOs we didn't have yet:

- BalanceISODate
- BalanceISODateTime
- BalanceISOYearMonth
- BalanceTime
- BuiltinTimeZoneGetPlainDateTimeFor
- GetISOPartsFromEpoch
- GetOffsetNanosecondsFor
- ParseTemporalTimeZone
- SystemDateTime
- ToTemporalTimeZone
2021-07-27 19:51:44 +01:00
Linus Groh
5512ff79f0 LibJS: Implement a bunch of time value related Date AOs
We don't have these yet as our Date implementation doesn't use the time
value algorithms and AOs from the spec, but Temporal will need these in
various contexts.
2021-07-27 19:51:44 +01:00
Linus Groh
ff307194f3 LibJS: Implement Temporal.Now[@@toStringTag] 2021-07-27 18:48:22 +01:00
Linus Groh
b3723a88a6 LibJS: Implement Temporal[@@toStringTag] 2021-07-27 18:48:22 +01:00
Gunnar Beutner
c9118b84b7 LibCoreDump: Make symbolication work when .text isn't the first segment
This can happen with binaries built with Clang or with a custom linker
script.
2021-07-27 19:14:29 +02:00
Karol Kosek
99d46caa28 LibGUI: Disable changing the view on error in the FilePicker
Prior to this change, changing the view would hide the error label
and show an empty directory.
2021-07-27 19:06:21 +02:00
Karol Kosek
80e3cf3ef7 LibGUI: Show an error message on open error in the FilePicker 2021-07-27 19:06:21 +02:00
Andreas Kling
4a8d47edf8 LibGUI: Add some "fudge factor" around IconView item rects
Previously there was a dead zone between the item icon and its text
in IconViews. This meant that you could click between the icon and
the text label and hit nothing.

This patch improves the situation by inflating both rects so that
they both overlap and become a bit easier to hit.
2021-07-27 18:27:49 +02:00
Andreas Kling
75a41da69f LibGUI: Show dotfiles with 50% opacity (in FileSystemModel views)
Use the new ModelRole::IconOpacity for this. :^)
2021-07-27 18:27:49 +02:00
Andreas Kling
8ba47facf6 LibGUI: Add ModelRole::IconOpacity and support it in all views :^)
This role allows you to specify a custom opacity for icon painting.
Note that the opacity is not in effect when the item is either
selected and/or hovered.
2021-07-27 18:27:49 +02:00
Andreas Kling
2d1eff01a2 LibGUI: Add Variant::as_float_or(fallback) 2021-07-27 18:27:49 +02:00
Andreas Kling
4486e5b26d LibGUI: Remove some unused code in GUI::TreeView 2021-07-27 18:27:49 +02:00
Gunnar Beutner
78c81854cc LibC: Don't include C++ headers in C system headers 2021-07-27 16:53:16 +02:00
Gunnar Beutner
57417a3d6e Kernel: Support loading the kernel at almost arbitrary virtual addresses
This enables further work on implementing KASLR by adding relocation
support to the pre-kernel and updating the kernel to be less dependent
on specific virtual memory layouts.
2021-07-27 13:15:16 +02:00
Gunnar Beutner
e3d2ca6bd2 LibSymbolication: Fix integer overflow when calculating region addresses 2021-07-27 13:15:16 +02:00