1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-14 00:14:18 +00:00
Commit graph

209 commits

Author SHA1 Message Date
reuk
081b1ff216
PopupMenu: Avoid dismissing menu in response to mouse events over the menu
In cases where no JUCE component had keyboard focus, clicking a menu
item would cause the menu to be dismissed instead of triggering the
item's action.
2023-04-04 19:55:11 +01:00
Anthony Nicholls
cff722a4af GUI Basics: Refactor juce_gui_basics file structure
- Created a new detail namespace
- Moved shared module implementation details into the detail namespace
- Split dependencies so source files only rely on details in the detail namespace
- Removed all code from the juce_gui_basics.cpp file
2023-03-16 08:53:12 +00:00
reuk
9cfbccca8e
Accessibility: Make createAccessibilityHandler public to allow calls from derived classes 2023-02-09 17:54:18 +00:00
attila
a662e5584b PopupMenu: Add explicit focus order to menu items
Without this VoiceOver will iterate over menu items left to right first,
and iteration order will be affected by whether the PopupMenu gets
broken up into multiple columns due to not enough screen space.
2023-02-03 16:11:11 +01:00
reuk
cf297c75c6
PopupMenu: Fix issue where PopupMenu would sometimes use the default rather than the parent look and feel
Previously, for the following snippet, the menu's LnF was incorrectly
being forced to the default LnF. The correct behaviour is to display the
menu using LnF v4. The menu doesn't have an explicit LnF set, so it
should use the LnF of its parent component.

    LookAndFeel::setDefaultLookAndFeel (&lookAndFeel_V1);
    setLookAndFeel (&lookAndFeel_V4);
    PopupMenu().showMenuAsync (PopupMenu::Options{}.withParentComponent (this));
2023-01-25 17:07:23 +00:00
reuk
e5fc50908e
PopupMenu: Use correct LookAndFeel when computing parent component 2022-12-01 11:41:52 +00:00
reuk
28f2157912
Convert ignoreUnused to [[maybe_unused]] 2022-12-01 11:41:50 +00:00
reuk
8b8ae10059
Build: Replace JUCE_NODISCARD with [[nodiscard]] 2022-09-12 16:14:57 +01:00
attila
c05ec5f9d0 MenuBarComponent: Fix incorrect deactivation of the menu bar
Prior to this commit it was possible to get the menu bar deactivated
by moving the mouse to an adjacent menu item and then back again. If
the movement was quick enough the corresponding PopupMenu would be
dismissed and created again before the dismissal's async command
handler would run. The command handler would see that the dismissed
menu's index and the currently activated index are equal and
deactivate the menu bar.
2022-08-02 14:58:31 +00:00
reuk
2b1745272e
Android: Fix a couple of accessibility-related crashes
These crashes could be seen in the DemoRunner when selecting items in
nested PopupMenu windows.
2022-06-13 15:29:56 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
reuk
319da1608d PopupMenu: Avoid potential crash when accessing exitingModalState member 2022-05-05 21:35:49 +01:00
reuk
4bfcb78809
PopupMenu: Use DPI awareness of target component when creating new windows
Also updates the drop shadower so that the DPI-awareness of the shadows
matches the DPI-awareness of the shadowed component.
2022-04-22 14:18:50 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
reuk
c51b331318
PopupMenu Accessibility: Report menu-item ticked state on Windows 2022-03-07 11:03:55 +00:00
attila
a1a8e1339f PopupMenu: Fix click-through from submenu
Previously it was possible to inadvertently activate a menu item by
clicking on a submenu item that was drawn on top of the parent menu.

The root cause was that hide() initiates an asynchronous mechanism
through exitModalState() that eventually destroys the MenuWindow, but
the MouseSourceState timer callbacks and event handlers sometimes still
had a chance to do a state update. Since the submenus have just been
destroyed the update could mistakenly conclude to activate one of the
items of the now lone parent.
2022-02-08 17:38:32 +01:00
reuk
b80927fc91
Nodiscard: Add to builder-pattern functions 2022-01-27 18:43:21 +00:00
reuk
77c24ae49f
PopupMenu: Expose item ticked state to screen readers 2022-01-10 22:15:20 +00:00
reuk
3084a23547
PopupMenu: Improve accessibility of custom components in menus
The 'wrapper' accessibility handler is now ignored if a menu item has a
custom component, and has no submenu, and cannot be triggered
automatically. This avoids the case where a custom menu item may end up
with a wrapper accessibility handler that has no useful actions.

This patch also adds a 'label' argument to the addCustomItem functions,
which allows text for the screen reader to be supplied in the case where
a custom component is in use, but the menu item has accessibility
actions.
2022-01-10 22:15:20 +00:00
Tom Poole
48a7274b08 PopupMenu: Update the example docs 2022-01-10 15:32:13 +00:00
reuk
ffee9b19de
MenuBarComponent: Avoid dereferencing dangling pointer when dismissing menus 2021-11-19 16:35:22 +00:00
ed
4727084838 PopupMenu: Store Options::targetComponent and ::parentComponent in WeakReferences to allow for deletion checks 2021-10-29 14:04:40 +01:00
reuk
c2f661171a
PopupMenu: Avoid giving focus back to previous component on dismiss
This change is designed to fix issues with views stealing focus and
being brought to the front when popup menus are dismissed.

To test this behaviour:
- Open two instances "a" and "b" of a plugin editor containing a
  ComboBox
- Click the ComboBox in editor "a", opening its PopupMenu
- Drag the titlebar of editor "b" to move it
- The PopupMenu should be dismissed, but editor "a" should *not* steal
  keyboard focus or be brought to the front
2021-10-26 16:52:14 +01:00
ed
b9542ccc4c Update code to use C++14 [[deprecated]] attribute
This commit removes the various compiler-specific JUCE_DEPRECATED macros and replaces them with C++14's deprecated attribute. It also removes the JUCE_CATCH_DEPRECATED_CODE_MISUSE flag as we can rely on the override specifier catching usage of these old virtual methods, and tidies up the DOXYGEN preprocessor checks as they were inconsistent across the codebase.
2021-09-29 16:14:00 +01:00
reuk
3141c32a64
PopupMenu: Avoid const_cast in implementation 2021-09-28 11:31:48 +01:00
reuk
ab966fb499
PopupMenu: Add withMousePosition helper function to Options 2021-09-28 11:31:48 +01:00
reuk
84c5627b42
PopupMenu: Ensure that menu appears at the correct position on Windows with a hi res display in standalone apps 2021-09-28 11:31:48 +01:00
reuk
c3276f436d
PopupMenu: Add some documentation to the Options class 2021-09-28 11:31:47 +01:00
reuk
37781916e5
PopupMenu: Fix documentation typo 2021-09-28 11:31:47 +01:00
reuk
ea757cf1ea
PopupMenu: Only show menus within safe areas of the screen
This change stops menus from displaying under notches/cutouts on mobile
platforms.
2021-09-28 11:31:47 +01:00
ed
d6fd33b38d Accessibility: Disable accessibility for PopupMenu windows on the desktop when their parent window or target component have accessibility disabled 2021-09-15 14:04:23 +01:00
ed
90eb878d16 Accessibility: Make createAccessibilityHandler() private in Component subclasses 2021-09-07 11:23:17 +01:00
ed
1028b6e5d1 Accessibility: Fix inaccessible MenuBarComponent items 2021-07-28 11:44:28 +01:00
Tom Poole
fe4ba9071b Set the default value of JUCE_MODAL_LOOPS_PERMITTED to 0
See BREAKING-CHANGES.txt for more details.
2021-06-30 13:01:14 +01:00
reuk
1ee106d730
PopupMenu: Avoid dismissing PopupMenus in bridged plugin editors
When bridging 32-bit/64-bit plugins on Windows, the plugin is hosted in
an auxilliary process, and the plugin's editor is embedded into an HWND
owned by a different process (the plugin host).

Previously, the `isForegroundProcess` check would fail for bridged
plugins, because the foreground window may belong to the DAW, rather
than to the auxilliary hosting process.

This patch adds an additional check, to find whether the same process
owns both the foreground window, and the window which embeds the
PopupMenu's target component. In this case, we avoid immediately
dismissing the PopupMenu.
2021-06-08 14:57:42 +01:00
reuk
0a4a67d439 PopupMenu: Use correct alignment for submenus with large borders 2021-05-24 19:40:47 +01:00
reuk
bcd7ae1fb5
PopupMenu: Avoid cropping menu items at the bottom of long menus with large borders 2021-05-24 18:48:39 +01:00
ed
b6bb2f4882 Accessibility: Improved PopupMenu focus handling when opening and added support for submenus 2021-05-20 18:24:57 +01:00
ed
ec990202b1 Accessibility: Added VoiceOver (macOS) and Narrator (Windows) accessibility screen reader support to juce_gui_basics 2021-05-10 10:53:14 +01:00
reuk
d62d3aaa4f
PopupMenu: Add option to specify initially-selected menu item 2021-03-10 16:14:42 +00:00
reuk
326d8deb16
PopupMenu: Tidy up Options implementation 2021-03-10 16:14:00 +00:00
ed
ad38182530 Added checks for DOXYGEN #define when excluding modal methods in headers 2021-02-05 14:17:19 +00:00
ed
1b2f17f2e8 PopupMenu: Check currently focused component before passing keyboard focus on menu completion 2021-01-29 11:43:04 +00:00
reuk
99e2cd0e3f
PopupMenu: Dismiss popups when minimising parent window
This behaviour was already present on windows, so this patch updates
Linux and macOS window-handling to match.
2021-01-15 12:18:31 +00:00
ed
b7e28541ca Replaced deprecated Displays methods 2020-10-27 12:38:59 +00:00
reuk
f61447fd01 PopupMenu: Allow manual column breaking 2020-10-26 17:04:49 +00:00
reuk
d4450ad8ae PopupMenu: Add LookAndFeelMethods for drawing column separators 2020-10-26 17:04:49 +00:00
reuk
f04e11c4bb PopupMenu: Allow theming of popup menu background based on Options
Adds a new `drawPopupMenuBackgroundForOption` member function to
`PopupMenu::LookAndFeelMethods`. By default this will pass through
to `drawPopupMenuBackground`, but it can be overridden in cases
where the background appearance depends on the current `Options`.
2020-10-26 17:04:49 +00:00
ed
94d853b00d Fixed some issues when navigating PopupMenus with the keyboard 2020-07-10 19:05:26 +01:00
reuk
394c4fd475 Clang: Fix warnings when building with clang 10 2020-07-01 10:00:43 +01:00