Commit graph

5218 commits

Author SHA1 Message Date
Andreas Kling e630ad5927 GTableView: Don't allow resizing columns to a negative width
This is definitely not perfect but better than letting you put the
GTableView into a weird state with negative column widths. :^)
2019-11-20 22:27:12 +01:00
Andreas Kling e08d605f72 GTableView: Don't hover-highlight unsortable column headers
The hover highlight is meant to indicate that the button is pressable.
Non-sortable columns are not pressable.
2019-11-20 22:23:51 +01:00
Andreas Kling 16c290e8d5 GTableView: Highlight the hovered column header
This makes it feel even *more* like a proper button.
2019-11-20 22:19:30 +01:00
Andreas Kling 191535d626 LibGUI: Make the GTableView column headers behave like proper buttons
Previously they would resort based on the column immediately when you
mousedown on them. Now we track the click event and show the header
in a pressed state, etc. The usual button stuff :^)
2019-11-20 22:11:43 +01:00
Andreas Kling 0b0017bbbd LibGUI: Make the GTableView row background colors a little brighter
This has been bothering me for a long time.. :^)
2019-11-20 21:52:34 +01:00
Andreas Kling 386bf8b763 LibVT: Don't implicitly copy the selection on double-click or mouse-up 2019-11-20 21:47:12 +01:00
Andreas Kling dabdd484f7 LibVT: Add a context menu to TerminalWidget
Starting with only the copy and paste actions. But I'm sure we can come
up with some more things to put here. :^)
2019-11-20 21:47:12 +01:00
Andreas Kling dbf8d6bc1e Terminal+LibVT: Switch Terminal to using explicit copy/paste actions
Instead of implicitly copying whatever you select, and pasting when you
middle-click, let's have traditional copy and paste actions bound to
Ctrl+Shift+C and Ctrl+Shift+V respectively.
2019-11-20 21:47:12 +01:00
Andreas Kling 6fa26c73e2 LibVT: Use the middle mouse button for pasting (instead of right)
This will allow us to show a context menu when you right-click,
which will feels more consistent with the rest of the Serenity desktop.
2019-11-20 21:47:12 +01:00
Andreas Kling ef552add6c Terminal: Add action to open a new terminal with Ctrl+Shift+N 2019-11-20 21:47:12 +01:00
Sergey Bugaev 3df521e2b7 AudioServer: Make all source files depend on generated sources
This fixes race conditions & failures during build.
2019-11-19 20:10:38 +01:00
Andreas Kling 9a6388f718 LibHTML: Render a background-color behind line box fragments if needed 2019-11-19 19:23:14 +01:00
Andreas Kling 5a04472470 LibHTML: Fix bug in removal of trailing whitespace from line boxes
This code was using the text from the DOM as a reference for how much
whitespace to remove from the end of a line box.

Since the DOM may contain uncollapsed whitespace, it would sometimes
be out of sync with the collapsed text used by the rest of the layout
system.
2019-11-19 19:21:47 +01:00
Andreas Kling 1fe2cca439 LibHTML: Use LayoutText::text_for_rendering() in layout tree dumps
This way the fragment offsets make a lot more sense, since they assume
whitespace has already been collapsed.
2019-11-19 18:36:33 +01:00
Andreas Kling dce7646882 LibHTML: Failed font lookups should use a bold fallback when fitting
If we fail to find the font specified by a page, but we do have some
font-weight information, use a bold fallback font for bold weights.
2019-11-19 18:23:58 +01:00
Andreas Kling 1fd5869490 LibHTML: Tolerate empty CSS rules
A rule that contains nothing but whitespace is still a valid rule.
2019-11-19 18:23:18 +01:00
Andreas Kling 56dad2272c LibHTML: Implement the universal selector ("*") 2019-11-19 18:23:09 +01:00
Andreas Kling 516708aab2 LibHTML: Don't crash when stringifying an unknown CSS property
Instead, just log that it happened, and then we can track it down.
2019-11-19 18:21:12 +01:00
Andreas Kling e87b9e2d7c LibHTML: Add the CSS "position" property to CSS/Properties.json 2019-11-19 18:20:54 +01:00
Andreas Kling 0405ab91aa LibHTML+AK: Move URL completion from Document to AK::URL
Completing a relative URL based on a base URL seems like generally
useful functionality.
2019-11-19 17:46:36 +01:00
Sergey Bugaev 47326042c5 Ports: Make sure Bash loads its built-in commands statically
Bash's configure script is checking whether the system has dlopen().
We do, but it doesn't actually work (yet). So patch the check out.
2019-11-19 16:03:25 +01:00
Sergey Bugaev 63cef4bd5f Ports: Fix ignoring patches
According to gitignore docs,

> It is not possible to re-include a file if a parent directory of that file is excluded.

So make sure to re-include "*/patches" before trying to re-include "*/patches/*".
This commit also converts the .gitignore file to have Unix line endings.
2019-11-19 16:03:25 +01:00
Sergey Bugaev 16b9b3f228 Kernel: Don't interrupt short writes
Remove explicit checking for pending signals from writing code paths,
since this is handled automatically when blocking, and should not
happen if the write() call is "short", i.e. doesn't block. All the
other syscalls already work like this.

Fixes https://github.com/SerenityOS/serenity/issues/797
2019-11-19 14:07:24 +01:00
Andreas Kling 0ddde627b1 Lagom: Fix build 2019-11-19 11:14:26 +01:00
Andreas Kling a12292bd03 LibHTML: LayoutImage should not dereference a null bitmap
This was happening when trying to render a bitmap that we couldn't
decode properly.
2019-11-18 20:26:32 +01:00
Andreas Kling 89a0d873ba LibHTML: Update tree dumping code now that everything is floating point 2019-11-18 20:26:15 +01:00
Andreas Kling 15fb341eb4 HackStudio: Always re-match curlies/parens after a re-highlight
While you are typing in HackStudio, we re-lex the C++ as you type,
so this means we also need to keep re-checking for matching curlies and
parentheses at the cursor.

Fixes #769 (although it's not optional, because it's too cool. :^)
2019-11-18 19:21:18 +01:00
Andreas Kling d5afc58744 HackStudio: Highlight maching parentheses as well
This can just piggyback on the code I just wrote for curly braces.
2019-11-18 19:13:46 +01:00
Andreas Kling c8e02e60a6 HackStudio+LibGUI: Implement matching curly brace highlighting
This works for C++ syntax highlighted text documents by caching the C++
token type in a new "arbitrary data" member of GTextDocumentSpan.

When the cursor is placed immediately before a '{' or immediately after
a '}', we highlight both of these brace buddies by changing their
corresponding spans to have a different background color.

..and spans can also now have a custom background color. :^)
2019-11-18 19:10:06 +01:00
Andreas Kling 5f7f97355e LibDraw: Add named colors "MidCyan" and "DarkCyan"
I need these for .. a thing. :^)
2019-11-18 19:02:10 +01:00
Andreas Kling 7b3f1218be little: Make this build by default, and add some curlies 2019-11-18 19:01:50 +01:00
Andreas Kling 0e9e70ca4f IPv4: Disconnected non-blocking sockets were not signalling EOF
After a socket has disconnected, we shouldn't return -EAGAIN. Instead
we should allow userspace to read/recvfrom the socket until its packet
queue has been exhausted.

At that point, we now return 0, signalling EOF.

It might be even better to start returning -ENOTCONN after signalling
EOF once. I'm not sure how that should work, needs looking into.
2019-11-18 17:37:54 +01:00
Andreas Kling b7a840fd0d LibHTML: Respect the line-height property if set
It's now possible to override the line-height via CSS. It will still
default to 1.4 if not specified.
2019-11-18 16:54:20 +01:00
Andreas Kling a14cc573b0 LibHTML: Implement some basic floating point CSS value parsing 2019-11-18 16:54:03 +01:00
Andreas Kling b0f38c1733 Build: Oops, typo in the path to LibHTML code generators in makeall.sh
This worked locally because I already had the built generators lying
around, but failed for other people who hadn't built them yet. Oops!
2019-11-18 16:45:14 +01:00
Andreas Kling c628ebda0f LibHTML: Use floating point numbers throughout the layout tree 2019-11-18 16:30:18 +01:00
Andreas Kling da23864c8d LibHTML: Let's just build host-side tools in makeall.sh instead
Instead of trying to build the host-side code generator helpers right
before we need them in the LibHTML build process, just build them ahead
of time in makeall.sh, like we already do for {IPC,Form}Compiler.
2019-11-18 16:30:18 +01:00
Andreas Kling 85d7afb6df LibHTML: Make all .cpp files implicitly depend on the generated sources
Hopefully this will make Travis generate sources before building all
the other files.
2019-11-18 15:36:30 +01:00
Andreas Kling a116a4a180 LibHTML: Get rid of dual Makefile setup
It's no longer possible to build LibHTML on the host machine since it
depends on LibGUI now. This patch gets rid of the dual Makefiles in
LibHTML since we only support Serenity builds anyway.

Also clean the code generator directory before building it.
2019-11-18 14:51:46 +01:00
Andreas Kling 1309c45cc6 LibHTML: Fix code generator dependencies for initial build
Fixes #796.
2019-11-18 13:09:33 +01:00
Andreas Kling c23addd1fb Kernel: When userspaces calls a removed syscall, fail with ENOSYS
This is a bit gentler than jumping to 0x0, which always crashes the
whole process. Also log a debug message about what happened, and let
the user know that it's probably time to rebuild the program.
2019-11-18 12:35:14 +01:00
Andreas Kling 040fee370d LibHTML: Expand the "padding" shorthand property
This expands in the same way as "margin".
2019-11-18 12:34:52 +01:00
Andreas Kling b08de46480 LibHTML: Implement basic 'max-width' and 'min-width' support
These CSS properties constrain the computed width of a block-level box
to a maximum, followed by a minimum value.

This makes the "better mother fricken website" look more like it's
intended to (which helps makes the author's point, I suppose.)
2019-11-18 12:26:08 +01:00
Andreas Kling df16c9676b LibHTML: Tolerate "px" suffix on CSS lengths
We only support "px" units (and "auto") but we shouldn't choke just
because someone actually says "10px" instead of just "10"
2019-11-18 12:15:23 +01:00
Andreas Kling 00d171e4d6 LibHTML: Implement the "margin" shorthand property
This is a very bulky way of doing this, and doesn't seem sustainable to
implement every shorthand property this way, but it's a place to start.

The "margin" CSS property now expands into its four longhands as far as
my understanding of the specs.

Note that shorthand expansion happens when we *resolve* style, not when
we parse CSS. I'm not sure this is correct anymore, I think other UA's
may actually expand shorthands into the declaration directly at parse
these days. If so, we should do this at parsing as well.
2019-11-18 11:51:02 +01:00
Andreas Kling e6e41e4fb8 LibHTML: Start building a simple code generator for CSS properties
Code for parsing and stringifying CSS properties is now generated based
on LibHTML/CSS/Properties.json

At the moment, the file tells us three things:

- The name of a property
- Its initial value
- Whether it's inherited

Also, for shorthand properties, it provides a list of all the longhand
properties it may expand too. This is not actually used in the engine
yet though.

This *finally* makes layout tree dumps show the names of CSS properties
in effect, instead of "CSS::PropertyID(32)" and such. :^)
2019-11-18 11:48:41 +01:00
Andreas Kling dcd10149fe Lagom: Move this into Meta/
This is more of a meta thing, since it's not seeing active development,
but is just a way for me to build some Serenity parts and include them
in other projects. Move it out of the root to keep things tidy.
2019-11-18 09:07:05 +01:00
Andrew Kaster 618aebdd8a Kernel+LibPthread: pthread_create handles pthread_attr_t
Add an initial implementation of pthread attributes for:
  * detach state (joinable, detached)
  * schedule params (just priority)
  * guard page size (as skeleton) (requires kernel support maybe?)
  * stack size and user-provided stack location (4 or 8 MB only, must be aligned)

Add some tests too, to the thread test program.

Also, LibC: Move pthread declarations to sys/types.h, where they belong.
2019-11-18 09:04:32 +01:00
Dan MacDonald aae26a3a1e LibC: Add O_ACCMODE to fcntl.h 2019-11-18 08:55:45 +01:00
Andreas Kling 39190402e4 Ports: Upgrade the vim port to build with more features :^)
Previously we were only able to build with --with-features=small.
Thanks to all the compatibility work done in the kernel and LibC over
the last couple of months, we can now build --with-features=normal.

It's not the biggest deal in the world, but it's pretty nice to see
this kind of progress!
2019-11-17 21:03:41 +01:00