Commit graph

1676 commits

Author SHA1 Message Date
Andreas Kling
7d30cf7122 FileManager: Teach DirectoryView subviews to create editing delegates
This enables inline editing of filenames for table views, where this is
already supported. More work in LibGUI will be required to support the
feature in icon and columns views.
2020-09-24 11:36:02 +02:00
asynts
1cb8be9906 Applications+IRCClient: Use new format functions. 2020-09-23 21:45:28 +02:00
Andreas Kling
4a8bfcdd1c LibJS: Move the current exception from Interpreter to VM
This will allow us to throw exceptions even when there is no active
interpreter in the VM.
2020-09-22 20:10:20 +02:00
Tibor Nagy
3bd6142918 SystemMonitor: Wrap file descriptor and unveiled paths model into a SortingProxyModel 2020-09-22 19:05:50 +02:00
Tibor Nagy
f910cdcdb7 SystemMonitor: Fix assert when sorting by the "Page map" column 2020-09-22 19:05:50 +02:00
Tibor Nagy
e596b1da88 SystemMonitor: Wrap adapters and sockets model into a SortingProxyModel 2020-09-22 19:05:50 +02:00
Tibor Nagy
2c1b244889 SystemMonitor: Add sorting key to the devices model 2020-09-22 19:05:50 +02:00
Peter Elliott
7907df7617 Applications: Use placeholders in TextBoxes where applicable 2020-09-21 20:15:10 +02:00
Andreas Kling
df3ff76815 LibJS: Rename InterpreterScope => InterpreterExecutionScope
To make it a little clearer what this is for. (This is an RAII helper
class for adding and removing an Interpreter to a VM's list of the
currently active (executing code) Interpreters.)
2020-09-21 14:35:12 +02:00
AnotherTest
e7f5090808 Spreadsheet: Always keep the workbook interpreter in VM scope
Fixes #3570.
2020-09-21 00:10:19 +02:00
Tibor Nagy
cba5a69f07 FontEditor: Draw the baseline in the glyph editor widget 2020-09-20 23:23:56 +02:00
Andreas Kling
1c43442be4 LibJS+Clients: Add JS::VM object, separate Heap from Interpreter
Taking a big step towards a world of multiple global object, this patch
adds a new JS::VM object that houses the JS::Heap.

This means that the Heap moves out of Interpreter, and the same Heap
can now be used by multiple Interpreters, and can also outlive them.

The VM keeps a stack of Interpreter pointers. We push/pop on this
stack when entering/exiting execution with a given Interpreter.
This allows us to make this change without disturbing too much of
the existing code.

There is still a 1-to-1 relationship between Interpreter and the
global object. This will change in the future.

Ultimately, the goal here is to make Interpreter a transient object
that only needs to exist while you execute some code. Getting there
will take a lot more work though. :^)

Note that in LibWeb, the global JS::VM is called main_thread_vm(),
to distinguish it from future worker VM's.
2020-09-20 19:24:44 +02:00
Andreas Kling
95eeb321f9 LibGfx+FontEditor+Base: Add "baseline" value to all fonts
This does nothing at the moment but will soon allow us to improve the
vertical positioning of text.
2020-09-19 19:16:22 +02:00
Andreas Kling
e1965a5a8e FileManager: Prevent feedback loop between treeview and directory view
When opening something in the left-side treeview, it also opens in the
right-side directory view. That triggers the "path changed" hook in the
directory view, which causes us to fully reveal the opened directory
in the left-side treeview.

This feedback loop made the UI feel weird since it caused directories
to expand just by selecting them in the left-side treeview. So let's
break that loop.
2020-09-19 14:09:59 +02:00
Andreas Kling
eb24603da0 FileManager: Properly reveal newly opened directories in the treeview
Use the new TreeView::expand_all_parent_of() API to ensure that newly
opened directories are revealed and scrolled-into-view in the left-side
treeview. :^)
2020-09-18 21:29:01 +02:00
Andreas Kling
56328409d9 FileManager: Update GUI when "entering" an inaccessible directory
When we enter an inaccessible directory, we still allow that directory
to become selected in the left-side treeview, so we need to update the
location box and window title to reflect the new current path.

This is not perfectly factored and there's a bit of duplication between
the model's on_error and on_complete hook callbacks in DirectoryView.
Needs more work. :^)
2020-09-18 21:29:01 +02:00
Andreas Kling
8075db683b FileManager: Show an inline error message for inaccessible directories
Instead of popping up a message box whenever we can't read an opened
directory, show the error message inside the DirectoryView (as a label)
instead.

This fixes a visual inconsistency where an inaccessible directory would
be selected in the left-side treeview while the previous directory's
contents were still showing on the right.

This also makes keyboard navigation a bit more pleasant since you're
not suddenly interrupted by a message box.
2020-09-18 21:29:01 +02:00
Andreas Kling
65b246aaf4 FileManager: Remove an unused enum in DirectoryView 2020-09-18 21:29:01 +02:00
Andreas Kling
07d4b41bac FileManager: Move DirectoryView into the FileManager namespace 2020-09-17 17:23:37 +02:00
Andreas Kling
8055f7a1f5 FileManager: Move the DesktopWidget to its own compilation unit 2020-09-17 14:34:47 +02:00
Andreas Kling
4e8c50d92d FileManager: Handle drop events in DirectoryView
This makes it possible to drag & drop files to/from the desktop! :^)
2020-09-17 14:30:00 +02:00
Andreas Kling
e1e58d5bc9 FileManager: Use GUI::FileIconProvider for the location box icon 2020-09-16 21:08:55 +02:00
Andreas Kling
17ae1c37bb FileManager: Show the root (/) directory in the treeview on the left
This gives you something to click on if you actually want to open
the root directory. Previously, if you wanted to get to /, you had to
use the "to parent directory" repeatedly. Silly. :^)
2020-09-16 21:08:55 +02:00
Andreas Kling
95b6c98435 LibGUI: Fix TreeView scrolling to top when clicking sub-items
This code was confusing two different versions of scroll_into_view that
were getting mixed up due to member function shadowing.

Adding an "override" to the subclass declaration exposed the problem.

With this fixed, we no longer lose our scroll position wildly when
using the mouse to select TreeView items.
2020-09-16 16:37:28 +02:00
Andreas Kling
d67b421628 Browser: Move the basic Tab UI skeleton to JSON GUI 2020-09-14 19:55:17 +02:00
Andreas Kling
1307f7292c Browser: Set tab text alignment from JSON GUI 2020-09-14 19:55:17 +02:00
Andreas Kling
856f683dc9 Browser: Generate the main browser window UI from JSON :^) 2020-09-14 19:55:17 +02:00
Andreas Kling
f67c876df0 Build+TextEditor: Add a compile_json_gui() CMake helper
This makes it easier to include JSON GUI declarations in any app. :^)
2020-09-14 16:16:36 +02:00
Andreas Kling
119a0c5dee TextEditor: Move the find/replace buttons to JSON GUI 2020-09-14 16:16:36 +02:00
Andreas Kling
89822c5ae7 TextEditor: Set initial widget visibilities from JSON 2020-09-14 16:16:36 +02:00
Andreas Kling
8a7935a29f TextEditor: Move the "find" and "replace" widget containers to JSON GUI 2020-09-14 16:16:36 +02:00
Andreas Kling
2e547ce7a3 TextEditor: Move the main window UI to JSON
This is our first client of the new JSON GUI declaration thingy.
The skeleton of the TextEditor app GUI is now declared separately from
the C++ logic, and we use the Core::Object::name() of widgets to locate
them once they have been instantiated by the GUI builder.
2020-09-14 16:16:36 +02:00
Andreas Kling
67dca51f47 FileManager: Use the correct delete action in the treeview context menu 2020-09-13 21:48:16 +02:00
Andreas Kling
ef50e5aaee FileManager: Move delete and force-delete actions to DirectoryView
This is a little bit messy since the left-side treeview also has a
delete action. Because of that, we have to put a focus-dependent action
that delegates to the relevant view-specific action in the tool bar
and menu bar.

I'm not sure yet what a good abstraction would be for this. We'll see
what we can think of.
2020-09-13 21:41:45 +02:00
Andreas Kling
174527b580 KeyboardMapper: Avoid using [&] captures for persistent lambdas
These are not bugfixes, just improving the hygiene.
2020-09-13 21:41:45 +02:00
Andreas Kling
825fcb8292 FileManager: Move "Open Terminal here" action to DirectoryView 2020-09-13 21:41:45 +02:00
AnotherTest
d103686261 Spreadsheet: Implement a specialised version of printf for formatting
Now all format values will format a single double, cast to the
appropriate types.
2020-09-12 15:01:19 +02:00
AnotherTest
c2228b669d Spreadsheet: Allow customising the cell foreground and background colors 2020-09-12 15:01:19 +02:00
AnotherTest
8fa385f774 Spreadsheet: Allow cells to optionally have static fg/bg colors 2020-09-12 15:01:19 +02:00
Ben Wiederhake
83b85e5578 IRCClient: Remove unused dump() logic
A 'FIXME' asked for this to be removed, so I did.
2020-09-12 13:46:15 +02:00
Ben Wiederhake
9c3a33762b LibGfx: Saner memory usage of indexed bitmaps
Indexed bitmaps used to allocate four times the required amount of memory.

Also, we should acknowledge that the underlying data is not always RGBA32,
and instead cast it only when the true type is known.
2020-09-12 00:13:29 +02:00
Andreas Kling
8f5b92865d HexEditor: Use widget override cursors 2020-09-11 14:37:30 +02:00
Andreas Kling
b4f307f982 LibGUI+WindowServer: Rename window "override cursor" to just "cursor"
Let's just say each window has a cursor, there's not really overriding
going on.
2020-09-11 14:26:37 +02:00
Andreas Kling
0f9be82826 LibGfx: Move StandardCursor enum to LibGfx
This enum existed both in LibGUI and WindowServer which was silly and
error-prone.
2020-09-10 19:25:13 +02:00
Andreas Kling
4e0df06f86 IRCClient: Use NonnullRefPtr<IRCClient> throughout
To protect against mishaps during app exit teardown, make sure everyone
who needs to be is a co-owner of the IRCClient object.

Fixes #3451.
2020-09-10 18:45:00 +02:00
Andreas Kling
b4bfc3ed54 Spreadsheet: Add "final" to JS objects and tweak declarations 2020-09-08 14:11:43 +02:00
asynts
9c83d6ff46 Refactor: Replace usages of FixedArray with Array. 2020-09-08 14:01:21 +02:00
Andreas Kling
c460f4a3cb IRCClient: Add the "/me" command to send CTCP ACTION emotes :^)
You can now express your feelings and actions with our IRC client by
using the /me command.
2020-09-07 20:49:35 +02:00
Andreas Kling
3c49a82ae9 Terminal: Use utmpupdate to update /var/run/utmp
We now put entries for interactive terminal sessions in the utmp file.
They are removed when you exit the terminal.
2020-09-06 16:15:51 +02:00
Andreas Kling
f405cd3830 PixelPaint: Update "paste" action enabled state based on clipboard
This action should only be enabled when there's a pastable bitmap
on the system clipboard. :^)
2020-09-05 16:57:03 +02:00