Age | Commit message (Collapse) | Author |
|
Make the taskbar 27 pixels tall instead of 28. This makes the button
icons and applets vertically centered.
On a related note, this required touching *way* too many places..
|
|
Fixes #6972.
|
|
This is no longer used since commands handle merging themselves.
|
|
We can now show things like "Undo Insert Text" and "Redo Remove Text"
instead of just "Undo" and "Redo" in menu items. Pretty neat! :^)
|
|
These return the action_text() for the current undo and redo commands,
if available.
|
|
It will be easier for some commands to generate an action text on the
fly instead of having to think of it up front, so a virtual that you
can override seems more convenient here.
|
|
Now you can change the text of an action and it will actually show
up in the menu. :^)
|
|
UndoStack will now merge adjacent commands *if they want to be merged*
instead of bundling everything you push onto it until you tell it
to "finalize the combo."
This uses less memory and gives applications full control over how
their undo stacks end up. :^)
|
|
When deleting text by pressing backspace, the commands will be merged
into a single RemoveTextCommand.
|
|
When performing multiple text insertions in a row, they will now
be merged into a single InsertTextCommand.
|
|
When pushing a new command on an undo stack, we will now attempt to
merge it into the stack's current command.
Merging is implemented by overriding the "merge_with(Command const&)"
virtual on GUI::Command. :^)
|
|
Renamed the virtual from "on_edit_action" to "will_execute" so it
doesn't clash with our convention for Function hook names.
Also tighten the parameter type to GUI::TextDocumentUndoCommand
since that's the only kind of command it will receive.
|
|
The undo stack has its own notification mechanism now, and we no longer
piggyback on the document change notifications.
|
|
|
|
This was quite unreliable before. Changes to the undo stack's modified
state are now reflected in the document's modified state, and the
GUI::TextEditor widget has its undo/redo actions updated automatically.
UndoStack is still a bit hard to understand due to the lazy coalescing
of commands, and that's something we should improve upon (e.g with more
explicit, incremental command merging.) But for now, this is a nice
improvement and undo/redo finally behaves in a way that feels natural.
|
|
Have TextDocument listen for state changes on the internal undo stack,
and forward those to all clients via a new virtual function.
This simplifies updating the can_undo / can_redo states of TextEditor.
|
|
This will allow clients to react to the undo stack changing state.
It's invoked when the stack or clean index are changed.
|
|
The undo stack was very difficult to understand as it grew by adding
new undo commands to the front of the internal vector. This meant we
had to keep updating indices as the stack grew and shrank.
This patch makes the internal vector grow by appending instead.
|
|
This reverts commit 0b7e19e2bb34cceb340607f0b7f76b338d78767e.
Let's reverse the direction of the undo stack to fix the confusion.
|
|
Since the `redo` action never goes back to `index: 0`,
we have to mark the clean index as being the current
non-empty index for the undo/redo navigation to work properly.
The problem is that if we never `undo`, the stack index stays at zero,
which is the empty container waiting for commands. In that situation,
if we save the document, it registers the clean index as being 1
(the non-empty index) but because the stack index has never left zero,
the document was being reported as modified, being out of sync with
the window modified state.
|
|
When resizing the timeline view the timelines should scroll to the
bottom when the resize operation reveals space that is beyond the
view.
|
|
Since we keep a stack of command combos, let's call entries on the
stack "Combo" instead of "UndoCommandsContainer".
And since it has a vector of commands, let's call it "commands"
instead of "m_undo_vector".
|
|
|
|
This patch removes an incorrect way for TextDocument::text_in_range
to return early when the first line of the selection was empty. This
fixes an issue in TextEditor where the status bar showed that 0
characters are selected when the selection started on an empty line.
|
|
Fixes #6886.
|
|
This also moves Widget::load_from_json into Core::Object as a virtual
function in order to allow loading non-widget objects in GML (e.g.
BoxLayout).
Co-authored-by: Gunnar Beutner <gbeutner@serenityos.org>
|
|
|
|
|
|
This widget provides a scrollable view onto another (child) widget.
If the child is larger than the parent, scrollbars are provided for
panning around the child.
|
|
|
|
This makes wheel events bubble up to parent widgets, which is useful
in case they care about wheel events even if their children don't.
|
|
|
|
Recent changes in the button painting code made this unnecessary. For
the case of value() == max(), the scrubber button would overlap the
increment button.
Fixes #6838.
|
|
|
|
Most of the IPC that happens between clients and WindowServer when
creating and configuring windows can be asynchronous. This further
reduces the amount of ping-ponging played during application startup.
|
|
Creating a menu/menubar needs to be synchronous because we need the
ID from the response, but adding stuff *to* menus (and adding menus
to menubars, and menubars to windows) can all be asynchronous.
This dramatically reduces the amount of IPC ping-pong played by
each GUI application during startup.
I measured how long it takes TextEditor to enter the main event loop
and it's over 10% faster here. (Down from ~86ms to ~74ms)
|
|
This changes client methods so that they return the IPC response's
return value directly - instead of the response struct - for IPC
methods which only have a single return value.
|
|
This updates all existing code to use the auto-generated client
methods instead of post_message/send_sync.
|
|
Instead of having a single overloaded handle method each method gets
its own unique method name now.
|
|
|
|
This reverts commit ff76a5b8d2e4dfe007c20a1376cb6862a2c2dbe0.
|
|
This patches fixes a crash of the Userland/TextEditor where it would
crash when deleting a range spanning two lines. This was because the
TextEditor would delete the range and modify the cursor position
before clearing the selection. This would trigger a status bar update
with the invalid selection.
|
|
This replaces the repeating 2-sec timer with a debounced single-shot
timer on user input.
|
|
This allows the painter to be scaled separately in both directions, and
not just in integer intervals. This is crucial for proper SVG viewBox
support.
Most bitmap-related things verify the scale to be one as of now.
|
|
This commit unifies methods and method/param names between the above
classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where
appropriate. It also renamed the various move_by methods to
translate_by, as that more closely matches the transformation
terminology.
|
|
Use is<T> to check for specific types of command in HackStudio instead
of cluttering up GUI::Command with specialized getters.
|
|
We were previously using the magical constant -1 to signify that a
window had no progress state. Be more explicit an use an Optional. :^)
|
|
|
|
|
|
Until now, this has been hackishly tracked by the TextEditor app's
main widget. Let's do it in GUI::TextDocument instead, so that anyone
who uses this class can know whether it's modified or not.
|