plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

bb8 avatar image
bb8 asked virtuali commented

MSFS Tool Bar panel.... possible to autosize it?

Is it possible to make a panel in the Tool Bar "autosize".

We display a lot of information in the Tool bar and it's dynamic. It would be nice to be able to make the panel autosize since the layout changes due to the dynamic buttons.

Is there a way to do this?

As you can see in the screen shot, the user needs to manually drag the panel to accommodate all the buttons.
toolbar.png

wasmhtml
toolbar.png (251.0 KiB)
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

davux3 avatar image
davux3 answered Kartijno commented

I had this working, though min/max size didn't work. Try `content-fit="true"` on the `ingame-ui` node. You'll need to take care that your layout is ready when the panel initializes or else it would have an incorrect size.

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Kartijno avatar image Kartijno commented ·
For me also i had this working in that way
0 Likes 0 ·
bb8 avatar image
bb8 answered

Thank you, we'll try!

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

bb8 avatar image
bb8 answered

Alas, it didn't work. Any other ideas?

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Yoanito avatar image
Yoanito answered virtuali commented

Hello @bb8

Unfortunately we have not implemented a method to automatically resize panel. The sendUpdatePanelSize() method work for the height of the panel but not for the width.

You can try to use a minimal width big enough to cover all cases or change your html code to make sure that there is a line break when the text exceeds a certain length/ character count.

Best Regards,
Yohan

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

virtuali avatar image virtuali commented ·

It would be useful to have some function to set the width, since lots of content in a toolbar panel might be dynamic.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.