Commit Graph

200 Commits

Author SHA1 Message Date
Dean Herbert
b4ed7217c1 Bring back HasFlagsFast
.NET version performs poorly on debug.
2024-08-19 19:40:59 +09:00
Dan Balasescu
b4aa48697d Remove HasFlagFast 2024-07-02 13:26:53 +09:00
Bartłomiej Dach
0635c0f922 Replace selected null-propagations with hard non-null asserts
Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
2024-05-29 14:22:45 +02:00
Bartłomiej Dach
64e95e6b39 Adjust usages of GetContainingInputManager() 2024-05-27 11:33:19 +02:00
Bartłomiej Dach
a48bed6f47 Null-propagate all calls to GetContainingFocusManager() 2024-05-27 11:01:23 +02:00
Dan Balasescu
397b3d0b71 Add IFocusManager interface 2024-05-18 01:35:27 +09:00
Dan Balasescu
dffe45bc61 Update R# + fix inspections 2024-02-02 03:44:24 +09:00
Salman Ahmed
4e543e037c Merge branch 'master' into dropdown-search 2023-12-12 20:57:53 +03:00
Salman Ahmed
5bfe0a5774 Convert to auto-property 2023-12-05 00:59:37 +03:00
Salman Ahmed
1833630542 Remove CloseOnEscape and add local handling in DropdownMenu 2023-12-05 00:59:31 +03:00
Salman Ahmed
0200dfa7c2 Move filtering entirely from Menu to DropdownMenu 2023-12-05 00:56:49 +03:00
Salman Ahmed
6d215cf930 Change search bar display implementation to work better 2023-12-02 22:14:15 +03:00
Salman Ahmed
33e2e46b7d Hook up dropdown search bar implementation 2023-12-02 22:14:15 +03:00
Salman Ahmed
413dc6ff2f Change type exposure of Menu.ItemsContainer to avoid potential manipulation in layout position 2023-11-28 06:07:10 +03:00
Salman Ahmed
6e483d7280 Handle non-alive menu items during addition/removal 2023-11-25 02:30:10 +03:00
Salman Ahmed
571b75f14d Add proper handling for BindableList collection changes in dropdowns 2023-11-25 01:40:59 +03:00
Salman Ahmed
ab0c8993f0 Add support for reordering menu items 2023-11-25 01:40:59 +03:00
Dean Herbert
d002fdaa37 Fix issues only pointed out on CI 2023-06-24 01:29:28 +09:00
Dean Herbert
5f2c03c271 Handle edge case of Action changing while already hovered 2023-04-03 15:48:01 +09:00
Dean Herbert
c7b6febfa3 Combine HasSubmenu into IsActionable variable (except for single private usage) 2023-04-03 15:43:17 +09:00
Dean Herbert
533f81ba2e Expose HasSubmenu for osu! usage 2023-02-22 17:10:03 +09:00
Dean Herbert
03a056c1fe Make sure hover effects still apply if a menu has a submenu 2023-02-22 16:38:18 +09:00
Dean Herbert
e1bbc4745d Change DrawableMenuItem.Clicked to only invoke in success scenarios 2023-02-22 16:38:07 +09:00
Dean Herbert
583721d1bd Expose IsActionable and only set hover background/foreground state on menu items when enabled 2023-02-22 16:08:09 +09:00
Dan Balasescu
9bbc6a81a2 Partial everything 2022-11-25 18:58:48 +09:00
Dan Balasescu
330939c864 Fix potential nullref in Menu 2022-09-14 15:54:20 +09:00
Dean Herbert
04c5dd65bf Update all existing usages of Remove methods to add new parameter 2022-08-26 14:59:16 +09:00
Dan Balasescu
ba1385330c Automated #nullable processing 2022-06-13 21:57:05 +09:00
Salman Ahmed
c2577ddaca Mark local methods as static where possible 2022-04-26 10:02:49 +03:00
Salman Ahmed
f0928843c1 Fix Menu not handling mouse down events 2022-04-24 17:57:59 +03:00
Dean Herbert
e0098b44fa Standardise DrawableMenuItem colour update logic
As of https://github.com/ppy/osu-framework/pull/5054, it was feasible
that `OnSelected` would be fired by a `DrawableDropdown` on its child
items before they were `IsLoaded`. If an implementation relied on
`OnSelected` to update the colour state correctly, this would have
caused a potential regression in behaviour due to calls to
`Update*Colour` not happening when `!IsLoaded`.

To fix this, I've standardised all calls to `UpdateBackgroundColour` and
`UpdateForegroundColour` to be scheduled and debounced. I've also
replaced multiple methods of performing the same colour set in different
ways.

The `AddOnce` was a large improvement, as each item was previously
having it called unnecessarily 3-5 times before initial display.

I've tested this against osu! manually. It's hard to test framework-side
because it was caused by a non-standard osu! side implementation of
colour/hover/select handling.
2022-04-15 16:15:05 +09:00
Dan Balasescu
ce05c4dbbb Fix sub-menu getting invalid position 2022-02-22 22:34:20 +09:00
Bartłomiej Dach
e187c840be Fix menu layout logic implicitly assuming top left anchor 2022-01-14 00:18:42 +01:00
Bartłomiej Dach
f01b207eed Fix menus with perpendicular submenus not laying out properly 2022-01-13 23:04:15 +01:00
Bartłomiej Dach
5acf25d528 Add comments to layout implementation to aid comprehension 2022-01-09 19:17:37 +01:00
Bartłomiej Dach
984a503d5f Rewrite layout logic to use anchors better 2022-01-09 19:09:06 +01:00
Bartłomiej Dach
cb4926b322 Avoid changing submenu anchor away from top-left if the menu doesn't fit either way 2022-01-09 18:12:11 +01:00
Bartłomiej Dach
56d61e605a Fix position changes not invalidating nested menu layout 2022-01-09 17:49:33 +01:00
Bartłomiej Dach
88b5599a2e Alternate menu anchors across menu item direction if not enough space 2022-01-09 17:29:09 +01:00
Bartłomiej Dach
ef802e7b33 Alternate menu anchors across expansion direction if not enough space 2022-01-09 17:29:08 +01:00
Bartłomiej Dach
c0a03a2459 Move submenu positioning to submenu itself 2022-01-09 17:29:07 +01:00
smoogipoo
c62b923e70 Fix menus not resizing correctly if content is masked away 2021-10-07 13:37:08 +09:00
Dean Herbert
5ac8381c24 Avoid running menu animation code on Clear() calls
From blame history, it looks like this was only done to consolidate the
invalidation logic call. I've split this out to ensure correct
behaviour, while avoiding the actual state change operations being
unnecessarily run.

Closes https://github.com/ppy/osu/issues/14553.
2021-08-30 13:51:35 +09:00
Salman Ahmed
0a8e5e01fb Update existing usages of such quirk 2021-07-10 09:22:52 +03:00
Dean Herbert
40162a1832 Remove empty <returns> xmldoc 2021-04-12 17:44:17 +09:00
smoogipoo
d924110921 Replace all usages of HasFlag with HasFlagFast 2021-02-25 14:24:14 +09:00
voidedWarranties
bb2b7abfa3 Use only HandleNonPositionalInput + ChangeFocus 2020-08-12 10:06:27 -07:00
voidedWarranties
03c60f411f Switch to HasFocus 2020-08-11 13:52:17 -07:00
voidedWarranties
7ea5cec68b Fix tests and remove check from OnKeyDown 2020-08-11 13:25:43 -07:00
voidedWarranties
a43f5f7182 Check menu is open before closing with esc 2020-08-09 21:05:08 -07:00