Commit Graph

705 Commits

Author SHA1 Message Date
LuK1337
0486e5895d Terminal: Grey out color scheme widget when there's nothing to select
By default we only include one color scheme.
2021-07-04 17:58:33 +02:00
timre13
55dd568583 Assistant: Show a border around the window 2021-07-04 14:48:54 +02:00
Gunnar Beutner
3bbe86d8ea Everywhere: Prefer using "..."sv over StringView { "..." } 2021-07-04 14:24:03 +02:00
ForLoveOfCats
d73f53d1de Assistant: Prevent window from being minimized 2021-07-04 13:58:56 +02:00
Daniel Bertalan
6c0b9919ce FileManager: Remove explicit T to Optional<T> conversion 2021-07-04 07:24:41 +04:30
Gunnar Beutner
f52bf15f8d Assistant: Make more of the classes final 2021-07-03 22:38:53 +02:00
Gunnar Beutner
52a3226f6d Assistant: Make the bitmap accessor pure virtual
Assistant looks broken when a result doesn't have an icon.
2021-07-03 22:38:53 +02:00
Gunnar Beutner
6af08f950a Assistant: Add missing bitmap accessor for terminal actions 2021-07-03 22:38:53 +02:00
Edwin Hoksberg
a4b4397a10 Assistant: Skip URL provider if query is empty or provider specific 2021-07-03 22:38:40 +02:00
Andreas Kling
c06f72c264 Assistant: Don't index the /proc and /sys directories
Roughly 20% of indexing time in a fresh install was spent on traversing
these kernel-generated directories. Let's just not. :^)
2021-07-03 22:14:09 +02:00
Andreas Kling
94def5ae9d Assistant: Avoid copying the result vectors when providers finish
Just move() them instead to cut down on the copying. :^)
2021-07-03 22:14:09 +02:00
Andreas Kling
e4199beccc Assistant: Keep the set of providers in a Vector for easy iteration 2021-07-03 22:14:09 +02:00
Andreas Kling
4fce72a967 Assistant: Use fstatat() while building FileProvider path cache
Using fstatat() allows the kernel to do relative path resolution as
opposed to absolute path resolution, which is significantly faster
and allows us to build the path cache sooner. :^)
2021-07-03 20:03:53 +02:00
Andreas Kling
801f74362e Assistant: Use StringView more in FileProvider fuzzy matching code
By not allocating new String objects, the fuzzy matcher becomes a lot
faster and more responsive while typing. :^)
2021-07-03 20:03:53 +02:00
Andreas Kling
d640031214 Assistant: Use FileIconProvider for FileProvider query results
Instead of showing the default "folder" icon for all file results,
we now show an appropriate icon for the given file. :^)
2021-07-03 20:03:53 +02:00
Andreas Kling
513e67e2eb Assistant: Make Result bitmaps virtual/lazy
Result classes now return their bitmap via a virtual Gfx::Bitmap*
getter. This effectively makes bitmap fetching lazier, since only
results that end up on screen actually get asked for their bitmap.

This drastically reduces the amount of work done by the FileProvider
background worker.
2021-07-03 20:03:53 +02:00
Marcus Nilsson
e0cf6f3cf0 TextEditor: Reset editor width when disabling preview mode
When disabling preview mode, reset the fixed width of m_editor so that
it fills out the window again even after resizing the splitter.
2021-07-03 17:36:50 +02:00
Timothy Flynn
27fe2b45e5 Assistant: Convert all Vector<NonnullRefPtr> to NonnullRefPtrVector 2021-07-03 15:41:35 +02:00
Timothy Flynn
d69691a26b Assistant: Add provider to run a command in a terminal
Prefix text with "$" in the Assistant text box to run a command in a
forked terminal. For example, "$ top" or "$ top -s pid".
2021-07-03 15:41:35 +02:00
Edwin Hoksberg
d5dfc255ed Assistant: Add new URLProvider to open URL's in the browser 2021-07-03 15:27:19 +02:00
Tom
5acee4b4d0 DisplaySettings: Add new Desktop tab with virtual desktop settings
This allows the user to configure the virtual desktop setup as desired.
2021-07-03 12:27:23 +02:00
Noah Rosamilia
2feaf59ab2 3DFileViewer: Add primitive mouse controls 2021-07-03 04:02:52 +02:00
Max Wipfli
3bdaed501e AK+Everywhere: Remove StringView::find_{first,last}_of(char) methods
This removes StringView::find_first_of(char) and find_last_of(char) and
replaces all its usages with find and find_last respectively. This is
because those two methods are functionally equivalent.
find_{first,last}_of should only be used if searching for multiple
different characters, which is never the case with the char argument.

This also adds the [[nodiscard]] to the remaining find_{first,last}_of
methods.
2021-07-02 21:54:21 +02:00
Marcus Nilsson
05e8bea736 PixelPaint: Reset layer widgets when closing last tab
When closing the last tab the layer list widget and layer properties
widget did not reset since they still had a pointer to the image.
2021-07-02 17:54:01 +02:00
Marcus Nilsson
54d4df668a PixelPaint: Add layer to image before setting properties
Previously when opening an image with layers that had properties like
visibility set, PixelPaint would crash when trying to trigger
layer_did_modify_properties() without in image. Avoid this by
adding the layer to the image before setting the properties.
2021-07-02 17:54:01 +02:00
Spencer Dixon
e6f0b2d817 Assistant: Add a new FileProvider to assist in searching the filesystem
When searching in Assistant, we now dispatch some background jobs to
query the whole filesystem. Activating a result will use the Desktop
launcher's default way of opening that file or directory.
2021-07-02 16:47:14 +02:00
Spencer Dixon
00f93b2545 LibThreading: Add ability to cancel ongoing BackgroundActions
Handlers of the BackgroundAction are responsible for checking if the
action has been cancelled and returning early.
2021-07-02 16:47:14 +02:00
Spencer Dixon
4a3958c8ae Assistant: Remove Result::Kind in favor of native typeid
I was unaware of the `typeid` construct in C++ which can be used to
achieve the same thing I was doing with this extra Kind enum.
2021-07-02 16:47:14 +02:00
Spencer Dixon
609a0aa75d Assistant: Change to home directory when spawning applications
When launching Terminal via Taskbar we change to the users home
directory. For consistency, let's also `chdir` to `/home/anon` when
launching apps via Assistant's AppProvider.
2021-07-02 14:16:56 +02:00
Sam Atkins
f5e63f785a FileManager: Remove clicked breadcrumbs for non-existing directories
This fixes #8204.

In the case that we just navigated up from a directory because it was
deleted, we can detect that easily by checking if the child directory
exists, and then remove the relevant breadcrumbs immediately.

However, it's harder to notice if a child directory for a breadcrumb
is deleted at another time. Previously, clicking that breadcrumb would
crash, but now we check to see if the directory it points to actually
exists. If it doesn't, we pop that breadcrumb and any after it, off
of the breadcrumbbar.

This may not be the ideal solution - maybe it should detect that the
directory is gone automatically - but it works and doesn't involve
managing additional directory watchers.
2021-07-01 17:15:26 +04:30
Andreas Kling
3f5c9d3edb CrashReporter: Fix bogus register alignment on x86_64 2021-07-01 11:35:52 +02:00
DoubleNegation
e992658c12 DisplaySettings: Adjust FontSettings.gml to work with dark themes
The FontSettings widget now uses background_role instead of
background_color to ensure that it displays properly independently of
the active system theme.
2021-07-01 00:10:25 +02:00
Hendiadyoin1
2c2cf90661 Utilities: Fix Build on x86_64 2021-06-30 19:05:51 +02:00
Hendiadyoin1
8e575d2f62 Debugger: Compile on x86_64
This is not guaranteed to work at all
2021-06-30 19:05:51 +02:00
Andreas Kling
80cf8bb27c Assistant: Use static_cast instead of dynamic_cast
When the type is guaranteed to be known, there's no need to use RTTI.
2021-06-30 11:44:52 +02:00
Andreas Kling
6c630437e9 Assistant: Don't add a subtitle label widget if we don't need it 2021-06-30 11:44:34 +02:00
Max Wipfli
d8be530397 AK+Everywhere: Remove "null state" of LexicalPath
This removes the default constructor of LexicalPath, and subsequently
modifies all its users to accommodate the change.
2021-06-30 11:13:54 +02:00
Max Wipfli
fc6d051dfd AK+Everywhere: Add and use static APIs for LexicalPath
The LexicalPath instance methods dirname(), basename(), title() and
extension() will be changed to return StringView const& in a further
commit. Due to this, users creating temporary LexicalPath objects just
to call one of those getters will recieve a StringView const& pointing
to a possible freed buffer.

To avoid this, static methods for those APIs have been added, which will
return a String by value to avoid those problems. All cases where
temporary LexicalPath objects have been used as described above haven
been changed to use the static APIs.
2021-06-30 11:13:54 +02:00
Max Wipfli
9b8f35259c AK: Remove the LexicalPath::is_valid() API
Since this is always set to true on the non-default constructor and
subsequently never modified, it is somewhat pointless. Furthermore,
there are arguably no invalid relative paths.
2021-06-30 11:13:54 +02:00
FalseHonesty
988e17ed05 LibVideo: Migrate to east-const style & apply other minor fixes
This patch brings all of LibVideo up to the east-const style in the
project. Additionally, it applies a few fixes from the reviews in #8170
that referred to older LibVideo code.
2021-06-30 11:03:51 +02:00
Adam Hodgen
1e5e02c70b LibWeb+Browser: Support DOM Inspector for OutOfProcessWebView
This introduces a new DOMTreeJSONModel, which provides the Model for the
InspectorWidget when the Browser is running using the
OutOfProcessWebView.

This Model is constructed with a JSON object received via IPC from the
WebContentServer.
2021-06-29 23:06:48 +02:00
ngc6302h
e2187f2956 SoundPlayer: Don't limit duration inference to WAV files 2021-06-30 00:58:06 +04:30
Andreas Kling
3ecd1d603f Assistant: Add subtitle field to the Result class
This allows providers to specify an appropriate subtitle instead of
making that something the UI layer has to figure out. :^)
2021-06-29 13:23:51 +02:00
Max Wipfli
9c8a2a5f69 AK+Spreadsheet+LibWeb: Remove JsonObject::get_or()
This removes JsonObject::get_or(), which is inefficient because it has
to copy the returned value. It was only used in a few cases, some of
which resulted in copying JsonObjects, which can become quite large.
2021-06-29 13:18:03 +02:00
Max Wipfli
e0ed160372 AK: Use OrderedHashMap in JsonObject
This changes JsonObject to use the new OrderedHashMap instead of an
extra vector for tracking the insertion order.

This also adds a default value for the KeyTraits template argument in
OrderedHashMap. Furthermore, it fixes two cases where code iterating
over a JsonObject relied on the value argument being copied before
invoking the callback.
2021-06-29 13:18:03 +02:00
Andreas Kling
9179a2ea73 Assistant: Fix crash when activating empty search result
If there are no search results in the list, we shouldn't do anything
when you try to active the selected result, since there isn't one.

Fix this by using an Optional<size_t> to store the selected index.
2021-06-29 13:08:21 +02:00
Spencer Dixon
b9d1ef99de Assistant+Taskbar: Use AppFile::spawn() utility 2021-06-28 16:29:02 +02:00
Spencer Dixon
66c13edb98 Userland: Add new app called Assistant
'Assistant' is similar to macOS spotlight where you can quickly open a
text input, start typing, and hit 'enter' to launch apps or open
directories.
2021-06-28 16:29:02 +02:00
Spencer Dixon
d16db6a67c Meta: Tidy up include path and alphabetic ordering 2021-06-28 16:29:02 +02:00
Andreas Kling
ba9d5c4d54 LibJS: Rename Function => FunctionObject 2021-06-27 22:36:04 +02:00