FIX: filament vendor submenu never opens when each group has one preset - #12094
Open
joranv1 wants to merge 1 commit into
Open
FIX: filament vendor submenu never opens when each group has one preset#12094joranv1 wants to merge 1 commit into
joranv1 wants to merge 1 commit into
Conversation
Hovering a category row (Custom, Bambu, Generic, ...) in the Project Filaments dropdown is supposed to open a submenu listing that vendor's presets. Often it does nothing at all. DropDown::hoverIndex() short-circuits on `count == items.size()` and returns the row index unchanged, assuming equal counts mean nothing is grouped. That does not hold when every group contains exactly one item: each group still collapses to a single row, so the counts match while grouping is present. The -i-2 group-row encoding is then never produced and mouseMove() cannot open the submenu. This is why it looks intermittent. It depends only on the preset list -- as soon as one vendor has two or more compatible presets the counts differ, the shortcut is skipped, and every submenu works again. Track has_groups in messureSize() next to count and require it to be false before taking the shortcut. selectedItem() had the same flaw, mispositioning the check mark in the affected lists. Also guard the subDropDown dereference in mouseMove(), which this makes reachable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hovering a category row (Custom, Bambu, Generic, ...) in the Project Filaments dropdown is supposed to open a submenu listing that vendor's presets. Often it does nothing at all.
DropDown::hoverIndex()short-circuits oncount == items.size()and returns the row index unchanged, assuming equal counts mean nothing is grouped. That does not hold when every group contains exactly one item: each group still collapses to a single row, so the counts match while grouping is present. The-i-2group-row encoding is then never produced andmouseMove()cannot open the submenu.This is why it looks intermittent. It depends only on the preset list: as soon as one vendor has two or more compatible presets the counts differ, the shortcut is skipped, and every submenu works again.
Track
has_groupsinmessureSize()next to count and require it to be false before taking the shortcut.selectedItem()had the same flaw, mispositioning the check mark in the affected lists. Also guard thesubDropDowndereference inmouseMove(), which this makes reachable.