summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
AgeCommit message (Collapse)Author
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.
2021-05-01LibGUI: Add getter/setter for GUI::Window modified stateAndreas Kling
This state lives in WindowServer and has no local copy in the client process for now. This may turn out to be a performance issue, and if it does we can easily cache it.
2021-04-30LibGUI: Bump up common locations width from 90 to 95Valtteri Koskivuori
The Documents directory shows up properly now when selected. Previously the bold text would not fit horizontally, causing an ellipsis at the end.
2021-04-29Everywhere: "indexes" => "indices"Andreas Kling
I've wasted a silly amount of time in the past fretting over which of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29Everywhere: "file name" => "filename"Andreas Kling
2021-04-29Userland: Fix new GCC warningsGunnar Beutner
2021-04-29LibGUI: Fix issue where buttons with a menu sometimes stayed depressedMart G
When a Button has a menu, the AbstractButton behaviour will now not be used in the mousemove_event. This was already the case for mousedown_event. Why only sometimes? Normally the presence of the menu prevents mousemove_events from being delivered to the button. But the menu doesn't spawn immediately. So sometimes mousemove events got through to the AbstractButton after the menu was told to spawn but before it appeared. This caused the m_being_pressed field of AbstractButton to be set to true. But there was never a mouseup_event because the menu got those instead.
2021-04-29Userland: Fix two misaligned copyright headersLinus Groh
2021-04-29Everywhere: Use "the SerenityOS developers." in copyright headersLinus Groh
We had some inconsistencies before: - Sometimes "The", sometimes "the" - Sometimes trailing ".", sometimes no trailing "." I picked the most common one (lowecase "the", trailing ".") and applied it to all copyright headers. By using the exact same string everywhere we can ensure nothing gets missed during a global search (and replace), and that these inconsistencies are not spread any further (as copyright headers are commonly copied to new files).
2021-04-27VimEditingEngine: allow selection of the endline characterPaul Berg
This patch fixes the visual selection of endline characters in the VimEditingEngine. When the visual mode is disabled and the cursor is located on the endline character, it is shifted back to the last character of the line.
2021-04-27VimEditingEngine: Handle arrow, Home/End and Page keyssin-ack
This patch adds handling of the arrow, Home/End, and PageUp/PageDown keys to the Vim emulation mode. Home acts as 0, End acts as $, arrow keys act as their HJKL variants, and PageUp/Down behaves as you would expect. This patch also moves the default handling of the aforementioned keys to insert mode, since regular EditingEngine semantics are more appropriate there.
2021-04-27EditingEngine: Split selection from movement functionssin-ack
This patch moves selection updates outside movement functions in EditingEngine. Previously, movement functions would automatically update the selection based on whether the Shift key was pressed down during movement. However, not all EditingEngine subclasses want that; VimEditingEngine being a good example (because all selection is handled in visual mode). Therefore, this patch moves all selection updating to EditingEngine::on_key(). Subclasses wishing to provide custom movement and selection semantics should override it (and VimEditingEngine already does).
2021-04-27LibGUI/Window: Do not reset mouse cursor on show()Jelle Raaijmakers
Window::m_cursor already has ::None as its default value, so let's not overwrite its value if it was set to something else.
2021-04-26LibGUI: Make common locations configurableDexesTTP
2021-04-26Calendar: Swap Liza for Marietathankyouverycool
2021-04-25Everywhere: Remove empty line after function body opening curly braceLinus Groh
2021-04-25LibGUI: Select last word when double clicking at the end of a lineRafał
Fixes #6565.
2021-04-25LibGUI: Implement Vim motion systemsin-ack
This patch implements Vim motions. The VimMotion class will accept keycodes from the editing engine to build up a motion, and will signal when a motion is complete via VimMotion::is_complete(). The editing engine can then call VimMotion::get_range() to obtain a TextRange object which can be used to perform operations on the text, or VimMotion::get_position() to obtain a TextPosition which is the new position of the cursor after the motion. Currently, the following motions are supported: - h/j/k/l, regular Vim line and character movements - 0/^/$, start/end of line and start of non-blank - w/e/b/ge, word-related movements - W/E/B/gE, WORD (anything non-blank) versions of the above motions - gg/G, document related movements - t/f, to/find character All motions except gg/G accept a number prefix to repeat the motion that many times. This patch updates insert, normal and visual modes to use this motion system for movement.
2021-04-25VimEditingEngine: Add handling { and } to move between empty linesRok Povsic
2021-04-24LibGUI: Remove some unused cruft from GUI::IconViewAndreas Kling
2021-04-24LibGUI: Prevent a Painter's clip_rect from being outside of its targetMart G
Previously a Painter's m_clip_origin field was initialized to a widget's window_relative_rect, which is not ensured to be within the target rect. m_clip_origin is normally not used for clipping, but after calling clear_clip_rect the clip rect that IS used for clipping gets reset to m_clip_origin (so an invalid state is entered). Now the window_relative_rect will be clipped by the target rect first, and will only then be used to initialize both the active clip_rect and m_clip_origin.
2021-04-23AK: Rename adopt() to adopt_ref()Andreas Kling
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
2021-04-23LibGUI: Allow bypassing hook when setting SpinBox rangethankyouverycool
Pass false to set_range to avoid on_change side-effects.
2021-04-22Everywhere: Use linusg@serenityos.org for my copyright headersLinus Groh
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-21LibGUI: Convert String::format() => String::formatted()Andreas Kling
2021-04-21LibGUI: Prevent selecting empty line in TextEditor on double click (#6537)Rafał
2021-04-21LibGUI: Track selection starting index in AbstractView (#6515)iCristalrope
Modifying the selection while holding the shift button and selecting with the mouse or the arrow keys no longer results in broken selections. Fixes #6279.
2021-04-21LibGUI: Remove premature return in Window::handle_key_eventjakewestrip
2021-04-20LibGUI: Make statusbar label flat when displaying override_textLeandro Pereira
Changing the statusbar appearance when overriding text makes it less confusing as it's supposed to be something temporary, e.g. only when hovering over a toolbar or menu item. This behavior is present on old Windows systems, although things work slightly differently there (where only the overridden text is displayed rather than all the segments).
2021-04-19LibGUI+WindowServer: Add WM_SuperKeyPressed eventConor Byrne
This commit adds an event called WM_SuperKeyPressed which is sent to all windows via WindowManagerServerConnection. The event is fired from WindowManager when the super key is pressed, which is the windows key on most keyboards :)
2021-04-18LibGUI: Add some more status tips to common actionsAndreas Kling
2021-04-18LibGUI: Rename Action::long_text to Action::status_tipAndreas Kling
This feels a bit more descriptive.
2021-04-18Everywhere: Fix a bunch of typosLinus Groh
2021-04-17LibGUI: Add "override text" to GUI::StatusbarAndreas Kling
Each statusbar segment now has an optional "override text" which can be set, and if non-null will be displayed instead of the regular text. This allows programs to display contextual information in the statusbar temporarily without losing whatever text was already on there.
2021-04-17LibGUI: Make GUI::Toolbar buttons generate ActionEnter and ActionLeaveAndreas Kling
Now you'll get the same event whether you hover an action in a menu or in a toolbar. :^)
2021-04-17LibGUI: Add action enter/leave hooks on GUI::ApplicationAndreas Kling
Apps can now hook into these events by assigning a callback to the on_action_enter and on_action_leave hooks on GUI::Application. :^)
2021-04-17LibGUI: Add Action* accessors on GUI::ButtonAndreas Kling
2021-04-17LibGUI: Add a "long text" string to GUI::ActionAndreas Kling
Actions can now have a longer text description, in addition to its regular UI string. The longer text will soon be used to display a more detailed description of hovered actions in statusbars.
2021-04-17WindowServer+LibGUI: Notify GUI clients about menu item enter/leaveAndreas Kling
We now send out MenuItemEntered and MenuItemLeft messages to the client when the user hovers/unhovers menu items. On the client side, these become GUI::ActionEvent, with one of two types: ActionEnter or ActionLeave. They are sent to the Application. This will allow GUI applications to react to these events.
2021-04-17LibGUI: Make sure we depend on the WindowManager IPC endpointsAndreas Kling
2021-04-17LibGUI+WindowServer: Separate window manager IPC from regular IPCsin-ack
With this patch the window manager related functionality is split out onto a new endpoint pair named WindowManagerServer/Client. This allows window manager functionality to be potentially privilege separated in the future. To this end, a new client named WMConnectionClient is used to maintain a window manager connection. When a process connects to the endpoint and greets the WindowServer as a window manager (via Window::make_window_manager(int)), they're subscribed to the events they requested via the WM event mask. This patch also removes the hardcoding of the Taskbar WindowType to receive WM events automatically. However, being a window manager still requires having an active window, at the moment.
2021-04-17LibGUI: Make some API's take String instead of StringViewAndreas Kling
2021-04-17LibGUI: Make Window::set_title() take a StringAndreas Kling
2021-04-17LibGUI: Make GUI::Widget::set_tooltip() take a StringAndreas Kling
There was no reason for this to take a StringView.
2021-04-16LibGUI: Allow arbitrary font size in FontPickerJames Triantafylos
This commit adds a SpinBox to the FontPicker dialog to allow users to set arbitrary font sizes (1 to 255 inclusive) for TTF fonts. The SpinBox is only visible when the user is selecting a TTF font.
2021-04-16LibGUI+WindowServer: Fix some misaligned CMakeLists.txt SOURCES entriesLinus Groh
2021-04-13Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"Andreas Kling
I hereby declare these to be full nouns that we don't split, neither by space, nor by underscore: - Breadcrumbbar - Coolbar - Menubar - Progressbar - Scrollbar - Statusbar - Taskbar - Toolbar This patch makes everything consistent by replacing every other variant of these with the proper one. :^)