Temp workaround: Object mode pie glitches since 'Edit Strokes' mode was introduced

To ensure all items of a pie are always at the same position, invisible dummy buttons were added for unavailable items. This caused mainly two issues: Command line printed warning because of the > 8 elements, and some modes weren't visible in some cases ('Object Mode' entry was missing in stroke edit mode).
To solve this nicely, we had to support > 8 items per pie. Will look into that this week, but for now, drawing dummy buttons is disabled.

From a user POV this has two ugly consequences: 1. While this temporary workaround is used, *some* pie items are positioned differently than before, 2. The 'Edit Strokes' mode entry might change its position depending on the amount of available modes.
This commit is contained in:
Julian Eisel 2015-12-15 15:29:23 +01:00
parent c5e99abe70
commit 669fdca681
Notes: blender-bot 2023-02-14 08:21:52 +01:00
Referenced by issue #46973, New GP causes errors with Pie menus
1 changed files with 12 additions and 1 deletions

View File

@ -923,7 +923,17 @@ void uiItemsFullEnumO(
target = uiLayoutColumn(split, layout->align);
}
if (radial) {
if (0 && radial) {
/* XXX Disabled as temporary workaround!
*
* Normally, we always draw a button for all items even if they're unavailable (we draw invisible
* dummy buttons then), so items are always at the same position. This causes issues with current
* 'Object Mode' pie since more than 8 modes exist now (see T46973).
* Disabling this until more than 8 items per pie are supported (or a better solution is found).
* We should work on that ASAP though.
*
* - Julian (Dec 2015)
*/
RNA_property_enum_items_gettexted_all(block->evil_C, &ptr, prop, &item_array, NULL, &free);
}
else {
@ -973,6 +983,7 @@ void uiItemsFullEnumO(
}
else {
if (radial) {
/* invisible dummy button to ensure all items are always at the same position */
uiItemS(target);
}
else {