Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0b1] Set the width of a Menu to fit the widest MenuItem #800

Merged
merged 7 commits into from
Apr 28, 2022

Conversation

fieldOfView
Copy link
Contributor

This PR adds a width to Menu.qml so the Menu is wide enough to fit the widest MenuItem. This way MenuItems don't need to be elided, which causes confusion about the interactivity of MenuItems ending in an ellipsis (...)

The technique is copied from here: https://martin.rpdev.net/2018/03/13/qt-quick-controls-2-automatically-set-the-width-of-menus.html

This PR is a partial fix for #799

@fieldOfView
Copy link
Contributor Author

Now without binding loops for menus containing menuitems with a shortcut or submenu indicator.

@nallath
Copy link
Member

nallath commented Mar 25, 2022

Nope, sorry, still binding loops :(

2022-03-25 10:04:23,088 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [428]: file:///home/jvankessel/Development/Cura/resources/qml/MainWindow/ApplicationMenu.qml:51:9: QML FileMenu: Binding loop detected for property "width"
2022-03-25 10:04:24,324 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [428]: file:///home/jvankessel/Development/Cura/resources/qml/MainWindow/ApplicationMenu.qml:53:9: QML ViewMenu: Binding loop detected for property "width"
2022-03-25 10:04:24,324 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [428]: file:///home/jvankessel/Development/Cura/resources/qml/MainWindow/ApplicationMenu.qml:53:9: QML ViewMenu: Binding loop detected for property "width"
2022-03-25 10:04:32,217 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [428]: file:///home/jvankessel/Development/Cura/resources/qml/Menus/ContextMenu.qml:37:9: QML MenuItem: Binding loop detected for property "contentWidth"
2022-03-25 10:04:36,176 - WARNING - [MainThread] UM.Qt.QtApplication.__onQmlWarning [428]: file:///home/jvankessel/Development/Cura/resources/qml/Menus/ContextMenu.qml:37:9: QML MenuItem: Binding loop detected for property "contentWidth"

@fieldOfView
Copy link
Contributor Author

Dang it... Back to the drawing board.

@fieldOfView fieldOfView changed the base branch from master to 5.0 April 28, 2022 13:18
@fieldOfView
Copy link
Contributor Author

Back from the drawing-board... Did I gt them all now?

I have changed the base branch to 5.0, because I think this is a bug fix against the 1st beta. Let me know if I should change it back to master.

@fieldOfView fieldOfView changed the title Set the width of a Menu to fit the widest MenuItem [5.0b1] Set the width of a Menu to fit the widest MenuItem Apr 28, 2022
@nallath
Copy link
Member

nallath commented Apr 28, 2022

CURA-9218

@nallath nallath merged commit 5e9c916 into Ultimaker:5.0 Apr 28, 2022
@fvrmr fvrmr added this to the 5.0.0 milestone May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants