Commit graph

8913 commits

Author SHA1 Message Date
Andreas Kling
9617b7ede4 FileManager: Set content margin of DirectoryView to same as children 2020-04-24 19:05:04 +02:00
Andreas Kling
42f0b2522b LibGUI: Introduce widget content margins + improve splitters
A GUI::Widget can now set an optional content margin (4x0 by default.)
Pixels in the content margin will be ignored for hit testing purposes.

Use this to allow frame-like widgets (like GUI::Frame!) to ignore any
mouse events in the frame area, and instead let those go to parent.

This allows GUI::Splitter to react "sooner" to mouse events that were
previously swallowed by the child widgets instead of ending up in the
splitter. The net effect is that 2 more pixels on each side of a
splitter handle are now interactive and usable for splitting! :^)
2020-04-24 19:05:02 +02:00
Andreas Kling
9badcff1ba WindowServer: Don't allow activating disabled menu items with keyboard 2020-04-24 17:29:42 +02:00
Andreas Kling
e786444ffa WindowServer: Fix name typo in descend_into_submenu_at_hovered_item() 2020-04-24 17:26:16 +02:00
Andreas Kling
cbb3c7aade WindowServer: Skip over disabled menu items during keyboard navigation 2020-04-24 17:24:09 +02:00
Andreas Kling
4218b00cb4 Base: Tweak ladybug icon 2020-04-24 17:10:59 +02:00
Andreas Kling
5d88022252 LibGUI: When removing a TabWidget tab, activate the next tab 2020-04-24 17:10:59 +02:00
Kesse Jones
b0ca174d49 LibJS: Add Array.prototype.find 2020-04-24 17:10:19 +02:00
Linus Groh
fd5f05079d QuickShow: Properly hide toolbar on toggle action
Similar to fullscreen mode we need to hide the toolbar's container.
2020-04-24 17:00:00 +02:00
Linus Groh
d86d73f6e8 QuickShow: Hide toolbar container in fullscreen mode
If we just hide the toolbar itself, its container is still visible and
taking up space at the top of the screen.
2020-04-24 17:00:00 +02:00
Andreas Kling
5c2bdbf27f Browser+LibWeb: Open link in new tab on Ctrl+Click :^) 2020-04-24 14:43:56 +02:00
Andreas Kling
d5d8e87d56 Browser: Scope tab-specific actions to the tab itself
This makes LibGUI choose the correct action depending on which tab
is currently active (technically which tab is *focused*.)

Fixes #1935.
2020-04-24 14:34:24 +02:00
Andreas Kling
a2bdcfabc9 LibGUI: Grant focus when activating a new stack/tab child widget
This makes opening a tab actually focus the opened tab.
2020-04-24 14:34:24 +02:00
Andreas Kling
d0578bfa32 LibGUI: Search the entire focus chain for shortcut actions
Instead of only looking in the focused widget, we now also look in the
ancestor chain of that widget for any ancestor with a registered action
for the given shortcut.

This makes it possible for parent widgets to capture action activations
while one of their children is focused.
2020-04-24 14:34:24 +02:00
Linus Groh
896decd4d5 Browser: Open links with target="_blank" in new tab 2020-04-24 14:34:11 +02:00
Linus Groh
061205b3b3 LibWeb: Pass link target to HtmlView's on_link_click callback 2020-04-24 14:34:11 +02:00
Linus Groh
95b51e857d LibJS: Add TokenType::TemplateLiteral
This is required for template literals - we're not quite there yet, but at
least the parser can now tell us when this token is encountered -
currently this yields "Unexpected token Invalid". Not really helpful.

The character is a "backtick", but as we already have
TokenType::{StringLiteral,RegexLiteral} this seemed like a fitting name.

This also enables syntax highlighting for template literals in the js
REPL and LibGUI's JSSyntaxHighlighter.
2020-04-24 11:18:57 +02:00
Linus Groh
57caca3171 LibJS: Fix ObjectExpression::execute()
Change from code review changed key() and value() getters - forgot to
update this...
2020-04-24 00:02:07 +02:00
Linus Groh
746dd5b190 LibJS: Implement computed properties in object expressions 2020-04-23 23:56:04 +02:00
Linus Groh
bebd5c097c LibJS: Require colon in object expression for non-identifier keys
{foo} is valid - {"foo"} or {1} is not.
2020-04-23 23:56:04 +02:00
Linus Groh
402ba20c36 LibJS: Fix left shift operator
Typo causing it to compute lhs << lhs, not lhs << rhs as expected.
2020-04-23 23:48:27 +02:00
Andreas Kling
1b8b492258 Browser: Add "next tab" and "previous tab" actions
Now you can switch between the open tabs with Ctrl+PgUp and Ctrl+PgDn
2020-04-23 21:43:24 +02:00
Andreas Kling
4087e3cfb9 LibGUI: Add TabWidget functions to activate next/previous tab 2020-04-23 21:43:08 +02:00
Andreas Kling
312501f309 Browser: Add "Close tab" action (Ctrl+W) :^)
Note that this is a little bit unreliable with the keyboard shortcut
since LibGUI can get confused about which Action it's supposed to use
as each Browser::Tab has its own "close tab" action. This will need
to be fixed in LibGUI.
2020-04-23 21:36:17 +02:00
Andreas Kling
476a4475e5 Browser: Add "New tab" action (Ctrl+T) :^)
This also introduces a WindowActions collection of actions that are not
specific to the currently open tab, but nevertheless part of its menus.
2020-04-23 21:28:25 +02:00
Andreas Kling
4e8b6e48fd Browser: Start implementing tabbed browsing! :^)
This patch moves most of the Browser UI into a Tab class. The main UI
now mainly consists of a GUI::TabWidget that Tab objects are added to.

I'm going with the "tabs on top" style here, since I like how it makes
it feel like each tab has its own UI controls (which it actually does!)
2020-04-23 21:16:11 +02:00
Andreas Kling
ee7e7e6d55 LibGUI: Add TabWidget::set_tab_title(Widget&, StringView)
This lets you change the title of a tab after creating it.
2020-04-23 21:13:47 +02:00
Andreas Kling
933cf365e8 LibGUI: Tweak default ScrollBar size to make arrow icons centered :^) 2020-04-23 20:01:55 +02:00
Andreas Kling
5fc02c6f1d Base: Nudge Redmond theme closer to the Windows 95 colors :^) 2020-04-23 19:59:12 +02:00
Andreas Kling
029572b6fd Help: Sort the manual pages alphabetically
Fixes #1258.
2020-04-23 19:45:28 +02:00
Linus Groh
11728b7db5 LibJS: Implement 'in' operator 2020-04-23 19:38:13 +02:00
Linus Groh
396ecfa2d7 LibJS: Implement bitwise unsigned right shift operator (>>>) 2020-04-23 19:38:13 +02:00
Linus Groh
502d1f5165 LibJS: Implement bitwise right shift operator (>>) 2020-04-23 19:38:13 +02:00
Linus Groh
f0e7404480 LibJS: Implement bitwise left shift operator (<<) 2020-04-23 19:38:13 +02:00
Linus Groh
97366f4dd4 LibJS: Add Math.pow() 2020-04-23 19:38:13 +02:00
Kesse Jones
687096cadd LibJS: Add Array.prototype.includes 2020-04-23 19:30:16 +02:00
Andreas Kling
a639172760 WindowServer: Don't allow resize-grabbing window underneath title bar 2020-04-23 19:27:33 +02:00
Andreas Kling
2921793c01 QuickShow: Draw GUI::Frame parts of QSWidget
We were forgetting to draw the frame. :^)
2020-04-23 19:12:50 +02:00
Andreas Kling
42ddd551ef Base: Tweak filetype-javascript icon and add 32x32 version 2020-04-23 19:08:33 +02:00
Andreas Kling
108c08eb49 LibGUI: Make StatusBar 2px shorter vertically for a snugger fit 2020-04-23 18:52:34 +02:00
Andreas Kling
3af8fcc839 HexEditor: Fill main widget with background to prevent gaps 2020-04-23 18:52:34 +02:00
Andreas Kling
0f8dca9441 Base: Tweak new/open/save icons (make them a bit smaller) 2020-04-23 18:52:33 +02:00
Andreas Kling
2454c3b7fb Applications: Remove ChanViewer app
The HTTP JSON API this relied on is no longer available via HTTP and
I would rather make the website work in Browser anyway. :^)
2020-04-23 18:38:54 +02:00
Andreas Kling
9142890822 Base: Tweak icons with arrows in them (to be more pointy) 2020-04-23 18:35:15 +02:00
Andreas Kling
622806f570 Base: Tweak go-home icon 2020-04-23 18:31:03 +02:00
Andreas Kling
0af5e0b9f8 Applications: Tweak main layout spacing and background 2020-04-23 18:30:59 +02:00
Andreas Kling
fa0bab843a SystemMonitor: Shrink margins of main layout 2020-04-23 17:54:59 +02:00
Andreas Kling
8260cbf7bd LibGUI: Tweak colorization of ScrollBar gutter 2020-04-23 17:54:59 +02:00
Andreas Kling
5eb4d0f832 WindowServer: Make vertical segment under title bar 1px thicker 2020-04-23 17:54:57 +02:00
Andreas Kling
ab336e895f LibGUI: Add a ToolBarContainer widget and put most ToolBars in one
This mimics the Explorer toolbar container from Windows 2000 and looks
pretty neat! :^)
2020-04-23 17:44:49 +02:00