summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/Menu.h
AgeCommit message (Collapse)Author
2022-11-13WindowServer: Update alt shortcuts for menu items when text changesAlec Murphy
WindowServer: Make CI happy :^)
2022-11-08WindowServer: Cycle through menu items with the same Alt shortcutSergiy Stupar
If there are multiple items with the same Alt shortcut, cycle through them with each keypress instead of activating immediately.
2022-09-08WindowServer: Add unadjusted position members to Menuthankyouverycool
Used to determine Menu relationships by proxy
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-04-09LibGfx: Move other font-related files to LibGfx/Font/Simon Wanner
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-24Services: Use default constructors/destructorsLenny 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."
2022-03-14WindowServer: Use font height for item heights in MenusKarol Kosek
The height of menu items was relatively small on larger fonts.
2022-02-25Userland: Rename IPC ClientConnection => ConnectionFromClientItamar
This was done with CLion's automatic rename feature and with: find . -name ClientConnection.h | rename 's/ClientConnection\.h/ConnectionFromClient.h/' find . -name ClientConnection.cpp | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
2022-02-21WindowServer: Add IPC call to remove a menu's itemMarco Cutecchia
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-11-02Services: Fix visibility of Object-derivative constructorsBen Wiederhake
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
2021-08-02LibGUI, WindowServer: Greatly simplify menubar logicsin-ack
Currently, any number of menubars can be plugged in and out of a window. This is unnecessary complexity, since we only need one menubar on a window. This commit removes most of the logic for dynamically attaching and detaching menubars and makes one menubar always available. The menubar is only considered existent if it has at least a single menu in it (in other words, an empty menubar will not be shown). This commit additionally fixes a bug wherein menus added after a menubar has been attached would not have their rects properly setup, and would therefore appear glitched out on the top left corner of the menubar.
2021-07-18WindowServer: Fix menu over-drawingTom
We only need to re-draw the item being selected and the item being deselected. We also don't care anymore if applets were added or removed as we no longer have a global menu bar.
2021-06-28WindowServer: Fix menu location on screens other than main screenTom
The menus always thought they were being outside of the main screen, which caused them to be left and/or top aligned. This also fixes the calculation of the available space by using the screen rectangle where it will be displayed.
2021-05-17WindowServer: Add Menu::is_open() to improve readabilityAndreas Kling
"menu.is_open()" instead of "MenuManager::the().is_open(menu)"
2021-05-09WindowServer: Fix a handful of clang-tidy warnings in the menu codeAndreas Kling
Some avoidable signed/unsigned mismatch, String move construction, and functions that can be static constexpr.
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-28WindowServer: Use window menu actions when clicking frame buttonsTom
This keeps the minimize/maximize/restore/close implementation consistent with the window menu actions.
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-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-15WindowServer: Clean up some of the code around menu item hoveringAndreas Kling
We were writing to the currently hovered menu item index in a bunch of places, which made it very confusing to follow how it changes. Rename Menu::set_hovered_item() to set_hovered_index() and use it in more places instead of manipulating m_hovered_item_index.
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. :^)
2021-04-09WindowServer: Cache internal Alt shortcuts on the Menu objectAndreas Kling
This way we don't have to recompute the set of shortcut keys every time we're handling an in-menu keydown event.
2021-04-09WindowServer: Support Alt shortcuts inside menus as wellAndreas Kling
Menu items can now also have Alt shortcut, and they work the same way top-level menu Alt shortcuts do. This replaces the previous "type to search" mechanism we had in menus.
2021-04-05WindowServer: Support Alt+Character menu shortcuts :^)Andreas Kling
This patch adds support for opening menus via keyboard shortcuts. Use an ampersand in a menu name to automatically create a keyboard shortcut (Alt + the character following the ampersand.) Menus with an Alt shortcut have a small underline under the shortcut character for discoverability.
2021-04-05WindowServer+LibGUI: Notify clients when menus become visible/hiddenAndreas Kling
This will allow clients to react to these events.
2021-03-28WindowServer: Add menu item fade-out animation upon activationTom
2021-03-26WindowServer: Keep menu open when activating a menu item with Ctrl heldAndreas Kling
This makes it easy to "try out" different options (like system themes!) in a menu without having to re-open the menu over and over. :^)
2021-03-26WindowServer+LibGfx: Make menubar menus slightly largerAndreas Kling
Also make sure the left/right padding is equally large.
2021-03-26WindowServer: Adjust position of flipped submenus by menu item heightLinus Groh
Fixes #5950.
2021-03-26WindowServer: Remove unused Menu->MenuBar link and "title font"Andreas Kling
We kept a backpointer from the Menu to its containing MenuBar, but it was not used for anything so let's remove it. Since all menus have the same font now, there's no need to track a separate "title font".
2021-03-25WindowServer: Remove "system menu" concept from WindowServerAndreas Kling
2021-03-25WindowServer: Tweak the look of menusAndreas Kling
Paint menus with a flatter outline instead of giving them the regular window border.
2021-03-25WindowServer+LibGfx: Show menus in windows! :^)Andreas Kling
This patch begins the transition away from the global menu towards per-window menus instead. The global menu looks neat, but has always felt clunky, and there are a number of usability problems with it, especially in programs with multiple windows. You can now call GUI::Window::set_menubar() to add a menubar to your window. It will be specific to that one window only.
2021-01-12Services: Move to Userland/Services/Andreas Kling