summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
2021-05-09Taskbar+LibGUI+WindowServer: Shrink taskbar by one pixelAndreas Kling
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..
2021-05-08LibGUI: Clear GUI::TextEditor selection before performing undo/redoAndreas Kling
Fixes #6972.
2021-05-08LibGUI: Remove now-unused undo coalescing timer from GUI::TextEditorAndreas Kling
This is no longer used since commands handle merging themselves.
2021-05-08LibGUI: Show command name in GUI::TextEditor undo/redo action textAndreas Kling
We can now show things like "Undo Insert Text" and "Redo Remove Text" instead of just "Undo" and "Redo" in menu items. Pretty neat! :^)
2021-05-08LibGUI: Add UndoStack::{undo,redo}_action_text()Andreas Kling
These return the action_text() for the current undo and redo commands, if available.
2021-05-08LibGUI: Make Command::action_text() virtualAndreas Kling
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.
2021-05-08LibGUI: Make Action::set_text() update any associated menu itemsAndreas Kling
Now you can change the text of an action and it will actually show up in the menu. :^)
2021-05-08LibGUI: Remove UndoStack's automatic command combo'ingAndreas Kling
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. :^)
2021-05-08LibGUI: Implement merging of TextDocument's RemoveTextCommandAndreas Kling
When deleting text by pressing backspace, the commands will be merged into a single RemoveTextCommand.
2021-05-08LibGUI: Implement merging of TextDocument's InsertTextCommandAndreas Kling
When performing multiple text insertions in a row, they will now be merged into a single InsertTextCommand.
2021-05-08LibGUI: Support merging of adjacent commands on the UndoStackAndreas Kling
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. :^)
2021-05-08LibGUI: Some tweaks for TextEditor's will-execute-command virtualAndreas Kling
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.
2021-05-08LibGUI: Don't fire TextDocument change notification after each commandAndreas Kling
The undo stack has its own notification mechanism now, and we no longer piggyback on the document change notifications.
2021-05-08LibGUI: Add missing <AK/Function.h> includeMaciej Zygmanowski
2021-05-08LibGUI+TextEditor: Make TextDocument modified state track undo stackAndreas Kling
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.
2021-05-08LibGUI: Use UndoStack::on_state_change inside TextDocument/TextEditorAndreas Kling
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.
2021-05-08LibGUI: Add UndoStack::on_state_change hookAndreas Kling
This will allow clients to react to the undo stack changing state. It's invoked when the stack or clean index are changed.
2021-05-08LibGUI: Reverse internal direction of GUI::UndoStackAndreas Kling
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.
2021-05-08Revert "LibGUI: Fix undo stack reporting wrong modified state"Andreas Kling
This reverts commit 0b7e19e2bb34cceb340607f0b7f76b338d78767e. Let's reverse the direction of the undo stack to fix the confusion.
2021-05-08LibGUI: Fix undo stack reporting wrong modified stateCarlos César Neves Enumo
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.
2021-05-08Profiler: Fix scrolling behaviorGunnar Beutner
When resizing the timeline view the timelines should scroll to the bottom when the resize operation reveals space that is beyond the view.
2021-05-08LibGUI: Rename UndoStack internalsAndreas Kling
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".
2021-05-07LibGUI: Convert StringBuilder::appendf() => AK::FormatAndreas Kling
2021-05-06LibGUI: Remove line-is-empty check in TextDocument return-earlyMax Wipfli
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.
2021-05-06LibGUI: Don't show resize corner in non-resizable window's statusbarAndreas Kling
Fixes #6886.
2021-05-06LibGUI: Move widget registration to LibCoreTom
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>
2021-05-06LibGUI: Remember modified state on undo/redo actionsCarlos César Neves Enumo
2021-05-06LibGUI: Clear undo stack when opening a new documentCarlos César Neves Enumo
2021-05-05LibGUI: Add ScrollableContainerWidget :^)Andreas Kling
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.
2021-05-05LibGUI: Allow specifying GUI::Statusbar segment count in GMLTimothy Flynn
2021-05-04LibGUI: Make GUI::Widget ignore wheel events by defaultAndreas Kling
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.
2021-05-04LibGUI: Rename ScrollableWidget.cpp => AbstractScrollableWidget.cppAndreas Kling
2021-05-03LibGUI: Fix off-by-one in Scrollbar::scrubber_rect()Linus Groh
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.
2021-05-03LibGUI: Remove unused Scrollbar::{de,in}crement_gutter_rect()Linus Groh
2021-05-03WindowServer+LibGUI: Make much of window construction asynchronousAndreas Kling
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.
2021-05-03WindowServer+LibGUI: Make much of menu construction asynchronousAndreas Kling
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)
2021-05-03Userland: Make IPC results with one return value available directlyGunnar Beutner
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.
2021-05-03Userland: Update IPC calls to use proxiesGunnar Beutner
This updates all existing code to use the auto-generated client methods instead of post_message/send_sync.
2021-05-03Userland: Change IPC funcs to use plain arguments instead of a structGunnar Beutner
Instead of having a single overloaded handle method each method gets its own unique method name now.
2021-05-03LibGUI: Rename ScrollableWidget => AbstractScrollableWidgetAndreas Kling
2021-05-03Revert "LibGfx: Add directional floating-point scaling to Painter"Andreas Kling
This reverts commit ff76a5b8d2e4dfe007c20a1376cb6862a2c2dbe0.
2021-05-03TextEditor: Clear the selection before deleting itPaul Berg
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.
2021-05-03LibGUI: Debounce TextDocument undo stackCarlos César Neves Enumo
This replaces the repeating 2-sec timer with a debounced single-shot timer on user input.
2021-05-02LibGfx: Add directional floating-point scaling to PainterMatthew Olsson
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.
2021-05-02LibGfx: Unify Rect, Point, and SizeMatthew Olsson
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.
2021-05-02LibGUI+HackStudio: Remove editing specific hacks from GUI::CommandAndreas Kling
Use is<T> to check for specific types of command in HackStudio instead of cluttering up GUI::Command with specialized getters.
2021-05-02WindowServer+LibGUI+Taskbar: Store window progress as Optional<int>Andreas Kling
We were previously using the magical constant -1 to signify that a window had no progress state. Be more explicit an use an Optional. :^)
2021-05-01Everywhere: Turn #if *_DEBUG into dbgln_if/if constexprGunnar Beutner
2021-05-01LibGUI: Improve a FIXME comment in TextDocumentAndreas Kling
2021-05-01LibGUI: Track modified state in GUI::TextDocumentAndreas Kling
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.