cancel
Showing results for 
Search instead for 
Did you mean: 

how to trigger modal in all screens from the model

JPabl.1
Associate III

Hi there Touchgfx team!

 

I have about 15 different screens. I also have a modal that says "battery critical level". I know how to propagate a notification from the model to the view to trigger this modal. 

My question is: is there an easy way to do this for 15 different screens? or everytime I need to override the notification function in each screen? 

Thanks a lot in advance

3 REPLIES 3
ferro
Senior III

Hi @JPabl.1 , one solution could be a new screen, just with that warning message window and transparent background and transition to that. Then back to original screen.

Hi @ferro , thanks for the reply. 

 

I think that might work if the modal were just a single screen, but the UI requirements is for it to pop up on top of the current screen, like this: 

JPabl1_0-1729876995759.png

From your answer it seems the only way will be to the same on all screens?

 

Hi @JPabl.1 

 

but the UI requirements is for it to pop up on top of the current screen

 

Yes, and that is exactly what will happen. But I forgot one important detail.

Before transitioning to the warning screen, You must set the size of the default background box, named __background, injected automatically by Gfx Designer ( I suppose you use screen Base clasess) to the size of your modal widget. In that case, the previous screen content stays as it is ( in frame buffers).

 

From your answer it seems the only way will be to the same on all screens?

 

If you could rephrase that please, do not inderstand what you mean.

 

I've just remembered this post

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/persistent-widgets-between-screens/m-p/690918