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

How are you hiding the dropdown windows when the user clicks away from it? #44

Closed
MonstrousOgre opened this issue Jul 30, 2024 · 2 comments

Comments

@MonstrousOgre
Copy link

This isn't a bug or a feature request. I was just curious how you implemented this functionality. I already have my own ags config which includes a bar for each monitor and a dropdown window. Right now, the only way to hide or show the dropdown window for my config is to click on a button on the bar. I'd love to be able to close the dropdown window by clicking away from it anywhere.

I tried looking at your config but couldn't figure out how you accomplished this. I'm guessing it has something to do with all the EventBox widgets in DropdownMenu?

@Jas-SinghFSU
Copy link
Owner

Jas-SinghFSU commented Jul 31, 2024

You're exactly right. In the DropdownMenu, I have 2 EventBoxes. The parent EventBox that covers the entire screen (className: "parent-event"). This parent event box will then close the window if it registers a click.

Then I have a child EventBox inside of the parent EventBox above. This child also registers clicks but it returns true instead. This allows you to interact with it's children; which in our case would be the dropdown menu's contents itself.

@Jas-SinghFSU
Copy link
Owner

Let's go ahead and move this conversation over in Discussions.

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

No branches or pull requests

2 participants