Commit graph

6844 commits

Author SHA1 Message Date
Bogdan
7590270e13 WebServer: Ensure directory listing URLs end with a slash
We will now send a redirect (301) if a directory listing is requested and the
request URL doesn't end with a slash character. This makes relative file URLs
that we generate in directory listings actually work as expected.
2020-02-13 20:06:32 +01:00
Andreas Kling
f88fe5dc3f LibGUI: Don't assert when hovering spacing around single-child Splitter
Fixes #1215.
2020-02-13 20:00:01 +01:00
Andreas Kling
fc562a3a93 WebServer: Remove debug spam in directory listing code 2020-02-13 08:52:24 +01:00
Andreas Kling
f767085eb6 WebServer: Escape HTML entities in path names in directory listings
I left a FIXME in here about implementing URL encoding.
2020-02-13 08:51:49 +01:00
Andreas Kling
3e486f75ff AK: Move escape_html_entities() from LibHTML to AK
This sort of thing can be useful to things that don't want to link with
all of LibHTML.
2020-02-13 08:46:00 +01:00
Andreas Kling
deca1d8b77 WebServer: Show file size and modification time in directory listings
This exposed an issue with the unveil() implementation which currently
short-circuits path resolution for any path containing "/..". This will
cause the ".." entry to show up with a 1970-01-01 mtime for now. FIXME.

Also add some rulers and a nice little footer. :^)
2020-02-12 21:39:09 +01:00
Andreas Kling
083f3edcb0 WebServer: Add basic directory listings
If a directory does not have an index.html file, we will now generate
a directory listing HTML document for that directory on the fly. :^)
2020-02-12 21:18:04 +01:00
Andreas Kling
90fec9c732 LibCore: Add "static bool Core::File::exists(filename)" 2020-02-12 21:17:00 +01:00
Andreas Kling
0cdf68f668 LibGUI: Always unhighlight table view column headers when cursor leaves
If the cursor left a table view column header while also pressing it,
we would keep the header highlighted. This was not consistent with how
regular buttons behaved.
2020-02-12 19:35:25 +01:00
Andreas Kling
29aee5e0d6 LibGUI: Make last auto-sized widget in a BoxLayout fill remaining space
Since space is divided evenly between widgets with SizePolicy::Fill,
we were sometimes ending up with a couple of unused pixels after the
last widget (due to rounding.)

Fix this by always giving the slack pixels at the end to the very last
auto-sized widget in the layout.

This fixes an issue where it was sometimes possible to click on an
"unreachable" part of a Splitter widget. :^)
2020-02-12 14:05:50 +01:00
Shannon Booth
91a97f7a42 WindowServer: Move some menu related code into MenuManager
Shuffle around some menu related code from window manager into menu
manager. This still is not perfect, and results in a little more of the
window manager to be publically exposed - but this is another step
towards better seperation of concerns between menu and window manager.

We also move the mouse_event handling into a new function in menu manager
as event handling was beginning to become a bit chunky.
2020-02-12 09:19:20 +01:00
Andreas Kling
24dfc5051a IRCClient: Use Core::DateTime 2020-02-11 20:43:32 +01:00
Andreas Kling
5e42fe76d6 LibGUI: Use Core::DateTime in FileSystemModel 2020-02-11 20:43:32 +01:00
Andreas Kling
e22283e5e6 Userland: Use Core::DateTime 2020-02-11 20:43:29 +01:00
Andreas Kling
8f89cc85d1 LibCore: Add DateTime::from_timestamp(time_t) 2020-02-11 19:48:46 +01:00
Andreas Kling
2c9d94c6b9 WebServer: Use Core::DateTime for logging timestamps 2020-02-11 19:43:40 +01:00
Andreas Kling
b8cf83926a LibCore: Add a basic Core::DateTime class
This is just to have a pleasant way to print the current time for now:

    dbg() << Core::DateTime::now();

Or if you want it as a string:

    Core::DateTime::now().to_string();
2020-02-11 19:43:29 +01:00
Andreas Kling
29aa8373d4 LibC: Add localtime_r() 2020-02-11 19:36:59 +01:00
Andreas Kling
57e4410044 Revert "LibC: Remove isfoo() declarations from ctype.h"
This reverts commit 2ba06662b6.

This broke the toolchain build. Apparently libstdc++v3 depends on the
declarations of isfoo() helpers.
2020-02-11 19:36:47 +01:00
Andreas Kling
0e44fb8731 WebServer: Add copyright headers 2020-02-11 19:25:06 +01:00
Andreas Kling
193d7c5b19 WindowServer: Make some WindowSwitcher members private 2020-02-11 18:56:31 +01:00
Andreas Kling
cfa6e44131 WindowServer: Remove unused WindowManager::draw_window_switcher() 2020-02-11 18:55:16 +01:00
Andreas Kling
0f00e9a1c7 WindowServer: Draw a coolbar border around the hovered switcher item
This gives a small but nice indication that the switcher window list
items are clickable. :^)
2020-02-11 18:53:56 +01:00
Andreas Kling
4c620dea83 WindowServer: Update window switcher when moving window to front
If the window switcher is up when a window is made frontmost (usually
by clicking on it), the window will now become the selected window in
the switcher.

This still has a slight feeling of "hmm" but is definitely better than
what we had before.
2020-02-11 18:38:48 +01:00
Andreas Kling
ba135dc0c0 WindowServer: Allow clicking on windows in the window switcher
You can now switch between windows using your mouse to click them in
the window switcher. :^)
2020-02-11 18:28:45 +01:00
Andreas Kling
2ba06662b6 LibC: Remove isfoo() declarations from ctype.h
We'll keep the definitions in ctype.cpp so you can link against them
but there's no reason to have competing declarations and macros.
2020-02-11 17:41:16 +01:00
Andreas Kling
92e2afe584 LibGUI: Tweak C++ syntax highlighting colors a bit :^) 2020-02-11 13:07:21 +01:00
Andreas Kling
a1e7064937 gron: Use pledge() 2020-02-11 12:42:06 +01:00
Andreas Kling
05e772d276 jp: Use pledge() 2020-02-11 12:16:07 +01:00
Andreas Kling
9a09437c46 LibGUI: Splitter should forget resize candidates after cursor leaves
Otherwise we'll keep highlighting the grabbable rect even after the
cursor has left the splitter widget.
2020-02-11 11:53:38 +01:00
Andreas Kling
6ecf90c6f8 SystemMonitor: Tweak bottom margin of the process table 2020-02-11 11:53:38 +01:00
Andreas Kling
8a605922bb LibGUI: Make splitters 1px wider as 3px is slightly too narrow 2020-02-11 11:53:38 +01:00
Andreas Kling
1fc887c576 LibGUI: Only highlight grabbable area between a Splitter's children
We were previously cheating by setting the entire splitter's background
color to the hover highlight color. This looked goofy whenever there
were transparent widgets inside a splitter, since the highlighted color
would shine through when hovering.

This was especially noticeable in SystemMonitor, which now looks much
better. :^)
2020-02-11 11:53:38 +01:00
Andreas Kling
3f58f0e87c LibGfx: Add Rect::operator!=(Rect) 2020-02-11 11:53:38 +01:00
Andreas Kling
f4fa758959 LibGUI: Add a Widget::did_layout() that gets called after layout
This will allow widgets to implement post-layout behaviors.
2020-02-11 11:53:38 +01:00
Andreas Kling
7aa62665a3 LibGUI: Factor out Splitter hit testing into a separate function 2020-02-11 11:53:38 +01:00
Shannon Booth
01cefa83aa WindowServer: Ensure on a menu key press invalid items are not hovered
Whenever a new menu item is hovered through a up or down key press, we
should always end up hovering a valid item.
2020-02-11 11:00:09 +01:00
Shannon Booth
7b6d450b6a LibGfx: Assert that an empty bitmap is not created 2020-02-11 11:00:09 +01:00
Shannon Booth
cef3988e30 WindowServer: Assert that a window is not being set as empty 2020-02-11 11:00:09 +01:00
Shannon Booth
96bfbfca9b WindowServer: Remove unimplemented header function 2020-02-11 11:00:09 +01:00
Shannon Booth
97508844dc WindowServer: Use early return to reduce nesting 2020-02-11 11:00:09 +01:00
Andreas Kling
14f9a29502 Terminal: Set up a nice $PROMPT for the shell :^) 2020-02-10 21:53:04 +01:00
Andreas Kling
8262c1e662 Shell: Build prompt based on the PROMPT environment variable if present 2020-02-10 21:52:58 +01:00
Andreas Kling
1828d9eadd Kernel: Remove some commented-out code in Scheduler::yield() 2020-02-10 20:16:50 +01:00
Andreas Kling
7cf33a8ccb Kernel: Remove outdated FIXME from Scheduler 2020-02-10 20:15:53 +01:00
Andreas Kling
27f0102bbe Kernel: Add getter and setter for the X86 CR3 register
This gets rid of a bunch of inline assembly.
2020-02-10 20:00:32 +01:00
Andreas Kling
7323d085dd LibGUI: Single-line GUI::TextEditor should not have "go to line" action 2020-02-10 19:49:49 +01:00
Andreas Kling
580a94bc44 Kernel+LibC: Merge sys$stat() and sys$lstat()
There is now only one sys$stat() instead of two separate syscalls.
2020-02-10 19:49:49 +01:00
ignas-sa
b67035c3ac
Calculator: Accept more keyboard input (#1207)
Allow user to clear/remove last numeral from input (Esc/Backspace
respectively) and type the decimal point.
2020-02-10 19:48:52 +01:00
asliturk
077ef556a7 WindowServer: Move applet code from MenuManager to AppletManager.
Move applet logic to the own class. Remove applet code from MenuManager.
With new AppletManager applet order is configurable via WindowManager.ini file.
2020-02-10 18:33:28 +01:00