summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Action.cpp
AgeCommit message (Collapse)Author
2022-11-26LibGUI: Propagate changing an action's text to its associated buttonsTimothy Flynn
All other action state changes are already propagated to the action's buttons. Do the same for text.
2022-11-26Revert "LibGUI: Update buttons' text/tooltips in Action::set_text"Timothy Flynn
This reverts commit e20756f9f735187f481420947329dfdb9a3418ac. Some buttons, e.g. GUI::ToolbarButton, set text to be used only as a tooltip instead of text on the button itself. This commit forced those buttons to have text on them when their action became set. For most toolbars, this was an invisible side effect; the button icons covered the whole button rect. But the toolbar for EmojiInputDialog has slightly smaller icons, causing an ellipsis to be displayed next to the icon.
2022-11-19LibGUI: Add fallible try_create_checkable() Actionthankyouverycool
2022-11-14LibGUI: Handle Action keyboard shortcuts in Widget keydownZaggy1024
Widgets can now prevent shortcut Actions from being called, which allows text input keydown handlers to override single key shortcuts.
2022-11-14LibGUI: Share code for finding an Action by ShortcutZaggy1024
This moves logic for finding a shortcut on a Window or Widget to Action::find_action_for_shortcut instead.
2022-10-30LibGUI: Update buttons' text/tooltips in Action::set_textZaggy1024
This allows Actions that change based on some state to update their associated buttons' text and tooltips to match their new text. The play/pause button in SoundPlayer (and VideoPlayer if it's merged) will now change tooltips when the playback changes state, rather than always displaying "Play (Space)".
2022-06-01LibGUI+WindowServer: Propagate action icon changes to buttons and menusnetworkException
Previously when setting an action's icon we would only change the bitmap stored by the action. This patch adds logic to propagate that change to toolbar buttons as well as window menus. This fixes an issue in SoundPlayer that would cause the play button not to reflect the play state.
2022-04-03LibGUI: Extend mimic pressed across keyboard shortcuts for buttonsRob Ryan
Primary motivation for this was to get a visual indication in the browser for Ctrl-R refresh. This extends what ForLoveOfCats had done for calculator button shortcuts across all buttons with shortcuts. When an action is triggered without an activator each associated button will be set as mimic pressed.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-02-13AK+Kernel: Rename try_make_weak_ptr to make_weak_ptr_if_nonnullIdan Horowitz
This matches the likes of the adopt_{own, ref}_if_nonnull family and also frees up the name to allow us to eventually add OOM-fallible versions of these functions.
2022-01-30LibGUI: Flash menubar when using command palettebugreport0
2022-01-09LibGUI+WindowServer: Flash menubar menu when using a keyboard shortcutbugreport0
Briefly flash the menubar menu containing the keyboard shortcut action to give the user immediate visual feedback on their interaction with the system.
2021-08-19LibGUI: Move common action definitions to CommonActions.cppsin-ack
This makes Action.cpp itself only talk about the Action object, and makes it easier to navigate.
2021-07-21LibGfx: Use "try_" prefix for static factory functionsAndreas Kling
Also mark them as [[nodiscard]].
2021-07-14Base+LibGUI: Add icon to the Rename actionjakubiakdev
2021-07-13LibGUI: Add Rename actionKarol Kosek
2021-06-25LibGUI: Add alternate shortcut F5 to the "reload" common actionAatos Majava
2021-06-25LibGUI: Add support for an alternate keyboard shortcut in ActionAatos Majava
This patch adds the alternate_shortcut member to LibGUI::Action, which enables one Action to have two keyboard shortcuts. Note that the string used in menus and tooltips only shows the main shortcut, which is the same behaviour as in Firefox and Chrome.
2021-05-21Applications: Use titlecase and distinct underlined characters in menusMax Wipfli
This changes (context) menus across the system to conform to titlecase capitalization and to not underline the same character twice (for accessing actions with Alt).
2021-05-15LibGUI: Add CommonActions helpers for "zoom in/out" and "reset zoom"Andreas Kling
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-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-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-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-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-09LibGUI: Give Alt shortcuts to all the CommonActions :^)Andreas Kling
2021-04-04LibGUI: Add GUI::CommonActions::make_properties_action()Andreas Kling
Many apps want a "Properties" action with the same icon and shortcut.
2021-02-20LibGUI: Use delegating constructors in GUI::ActionAndreas Kling
2021-02-20LibGUI: Tidy up Action constructors and factory functions a bitAndreas Kling
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling