Hooking into Dialog opening or possibly grabbing them right after being opened
As last piece of functionality I'd like to achieve for plugin I am working on, I want to ensure that all Dialogues are opened consistently every single time, be it for new project (don't want to resize any time I open something new) or for existing one (this would not be needed if Idea didn't lose already placed dialogue position from time to time).
For this I need a way to capture the moment when or right before a Dialog opens or grab that component somehow, here are most important components I probably need:
- DialogRootPane (I guess this one is needed since I can see it holds the size in UI Inspector, for Search/Replace panel)
-JLayeredPane (this for instance is for SearchEverywhereUI, also holds the size)
Is there any way to do this?
- I would obviously like some hook before this opens, but so far I was unable to find any
- other option would be to grab the Dialog component and set its bounds, however I am not sure how to do this, didn't find this with search or in docs, so how could I grab Dialog windows of which I know the structure from exploring UI Inspector?
- or any other solution for this?
Please sign in to leave a comment.
Use
DialogWrapper
, it has builtin functionality to remember last dialog size https://plugins.jetbrains.com/docs/intellij/dialog-wrapper.html