Bug 464988 - An ActionToolBar with only hidden actions does not show an overflow menu
Summary: An ActionToolBar with only hidden actions does not show an overflow menu
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.102.0
Platform: Other Unspecified
: NOR normal
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-29 15:06 UTC by Oliver Beard
Modified: 2023-02-02 08:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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