Bug 464988

Summary: An ActionToolBar with only hidden actions does not show an overflow menu
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Oliver Beard <olib141>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: notmart
Priority: NOR    
Version First Reported In: 5.102.0   
Target Milestone: Not decided   
Platform: Other   
OS: Unspecified   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Oliver Beard 2023-01-29 15:06:59 UTC
SUMMARY
A Kirigami ActionToolBar with all actions set to be hidden (displayHint: Kirigami.Action.DisplayHint.AlwaysHide) will not show an overflow menu with the hidden actions.

MINIMUM EXAMPLE
Kirigami.ActionToolBar {
	actions: [
		Kirigami.Action {
			text: i18n("Quit")
			icon.name: "gtk-quit"
			displayHint: Kirigami.Action.DisplayHint.AlwaysHide
		}
	]
}

WORKAROUND
Create an empty (unhidden) action:
	Kirigami.Action {},

OBSERVED RESULT
The toolbar is completely empty, with no overflow menu.

EXPECTED RESULT
The overflow menu should appear.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Comment 1 Oliver Beard 2023-01-29 15:18:08 UTC
Nevermind, that workaround creates an empty button. Instead:
    Layout.maximumWidth: 0 // HACK: Force overflow (BUG: 464988)
with no displayHint.
Comment 2 Marco Martin 2023-02-02 08:33:58 UTC
Git commit 4496e30ca47b69407757d1d33f04ba921a41a3ae by Marco Martin.
Committed on 02/02/2023 at 08:33.
Pushed by mart into branch 'kf5'.

Take into account more button after is visible

Only after we decided whether the more button is actually visible we can
use it for toolbar height calculation, otherwise it will never be
considered

M  +5    -1    src/toolbarlayout.cpp

https://invent.kde.org/frameworks/kirigami/commit/4496e30ca47b69407757d1d33f04ba921a41a3ae
Comment 3 Marco Martin 2023-02-02 08:37:33 UTC
Git commit 86ba88a0db07ff32a516a55b83e69e805f94808d by Marco Martin.
Committed on 02/02/2023 at 08:37.
Pushed by mart into branch 'master'.

Take into account more button after is visible

Only after we decided whether the more button is actually visible we can
use it for toolbar height calculation, otherwise it will never be
considered

M  +5    -1    src/toolbarlayout.cpp

https://invent.kde.org/frameworks/kirigami/commit/86ba88a0db07ff32a516a55b83e69e805f94808d