summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Toolbar.cpp
AgeCommit message (Collapse)Author
2022-11-26LibGUI: Allow buttons to control the behavior when their text changesTimothy Flynn
Some buttons control how their text is set in unique ways. For example, GUI::ToolbarButton will set only its tooltip instead of its text if it has an icon. So when the text changes, ToolbarButton will want to change its tooltip instead.
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-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-10-06LibGUI: Consider spacing for Toolbar overflow calculationFrHun
2022-10-06LibGUI: Include overflow button in overflow calculation only when shownFrHun
This prevents items from being put in the overflow menu, even though there is still enough space for all items to be shown, because the overflow button does not take up space when it is not needed.
2022-10-06LibGUI: Add option to move Toolbar items to overflow menu in groupsFrHun
When items are sent to the overflow menu one by one, it can happen that buttons that are heavily related, and don't make sense without one another (either visually or logically) are separated. This new option enables the developer to choose the "grouping" behavior, of sending all items that are not separated to the overflow menu together, as soon as one of them doesn't have enough space to be displayed. (provided the toolbar is set as collapsible)
2022-09-08Browser+LibGUI+WindowServer: Open Button menus uniformlythankyouverycool
Instead of letting buttons determine the relative position of their menus, a workaround only used by Statusbar segments, open them all uniformly for a nice, consistent UI. Passing a rect to popup() now routes to open_button_menu(), an analog to open_menubar_menu(), which adjusts the menu's popup position in the same way. Fixes button menus obscuring the buttons which spawn them and jutting out at odd corners depending on screen position.
2022-08-04LibGUI: Let Toolbars collapse into an overflow menuthankyouverycool
Previously Toolbars were governed by a strict minimum size which guaranteed all actions remained visible. Now, if set collapsible, extra actions will fold into an overflow menu on the Toolbar.
2022-08-04LibGUI: Remove button padding on Toolbar constructionthankyouverycool
And assume 24x24 button sizes by default. There currently aren't any toolbars with custom button sizes, but if the need arises, they can always determine their own padding.
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
This prevents us from needing a sv suffix, and potentially reduces the need to run generic code for a single character (as contains, starts_with, ends_with etc. for a char will be just a length and equality check). No functional changes.
2022-06-28LibGUI: Use new layout system for basic widgetsFrHun
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-12Libraries: Use default constructors/destructors in LibGUILenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2021-12-05LibGUI: Cast unused smart-pointer return values to voidSam Atkins
2021-11-24LibGUI: Add GUI::Toolbar::try_add_separator()Andreas Kling
This is a fallible variant of add_separator() that returns ErrorOr.
2021-11-24LibGUI: Add GUI::Toolbar::try_add_action()Andreas Kling
This is a fallible variant of add_action() that returns ErrorOr. It's careful to not fail with a partially added action.
2021-10-21LibGUI: Make toolbar buttons non-focusable by defaultAndreas Kling
Toolbar buttons are meant for quick mouse access to common actions, while quick keyboard access is normally achieved via keyboard shortcuts and underlined menu items. This makes interfaces with many toolbar buttons (e.g GUI::FilePicker) a lot nicer to navigate via keyboard.
2021-05-16LibGUI: Make GUI::Toolbar::add_action() return the toolbar buttonAndreas Kling
Previously there was no easy way for clients to access the button.
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-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-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. :^)