Skip to content

Conversation

@danirabbit
Copy link
Member

Adds a menu_model property to Granite.ListItem so you can automatically set up a context menu without all the boilerplate

Screenshot from 2025-04-08 10 32 05

@danirabbit danirabbit requested a review from a team April 8, 2025 17:34
Copy link

@ZanderBrown ZanderBrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Gdk.Key.Menu (and ShiftF10) isn't being handled here?

Must admit I'm not quite sure what the recommended way to do that in Vala would be these days, but it is somewhat handy to have!

@danirabbit
Copy link
Member Author

@ZanderBrown fixed the click gesture to use the menu event and also added keypress handling. Thanks for the review!

@danirabbit danirabbit requested a review from ZanderBrown April 12, 2025 18:01
Copy link

@ZanderBrown ZanderBrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks like you've covered all the context-menu cases I know of

@danirabbit danirabbit added this to OS 9 Apr 19, 2025
@danirabbit danirabbit moved this to Needs Review in OS 9 Apr 19, 2025
Copy link
Member

@leolost2605 leolost2605 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably remove the menu key controller from the parent when we unparent

@danirabbit danirabbit requested a review from leolost2605 May 8, 2025 16:37
@danirabbit
Copy link
Member Author

@leolost2605 does it make sense to do it as part of the destructor or should we connect to unmap maybe?

@leolost2605
Copy link
Member

@danirabbit ig the proper fix would be to make it focusable because then we receive keyboard input so we don't have to deal with parent etc.. Not sure if that would break something?

@danirabbit
Copy link
Member Author

@leolost2605 fixed!

@zeebok
Copy link
Contributor

zeebok commented Sep 18, 2025

@danirabbit New conflict to resolve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

5 participants