Summary: | KActionMenu sticky/delayed wrong behavior | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kwidgetsaddons | Reporter: | Simone Gaiarin <simgunz> |
Component: | general | Assignee: | Christoph Feck <cfeck> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | david.hurka, kdelibs-bugs, nate |
Priority: | NOR | ||
Version: | 5.63.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Simone Gaiarin
2019-11-05 09:22:56 UTC
I also find this weird, thanks for opening the bug. I think providing a setPopupMode(QToolButton::ToolButtonPopupMode) would be just fine. From kactionmenu.cpp: In private class definition: > bool m_delayed = true; > bool m_stickyMenu = true; In createWidget(): > if (delayed()) { > button->setPopupMode(QToolButton::DelayedPopup); > } else if (stickyMenu()) { > button->setPopupMode(QToolButton::InstantPopup); > } else { > button->setPopupMode(QToolButton::MenuButtonPopup); > } In toggleactionmenu.cpp (D21971) I go the reverse way: > if ( popupMode == QToolButton::DelayedPopup ) > { > setDelayed( true ); > } > else if ( popupMode == QToolButton::InstantPopup ) > { > setDelayed( false ); > setStickyMenu( true ); > } > else > { > setDelayed( false ); > setStickyMenu( false ); > } Yes, setPopupMode seems the right solution (and deprecating setSticky and setDelayed). Anyone up for a review request? Also, do you think the behaviour change would be a bug fix, or should be delayed until KF6? If we go for the setPopupMode mehtod, we can issue a deprecation warning for the other two methods in KF5 and get rid of them completely in KF6. (I am no expert on how to deal with API modifications though) |