Version: SunRise (12.2 build 282174.999)
Frequency: Consistently
Severity: High
Marketplace package name: N/A
Context: N/A
Similar MSFS 2020 issue: N/A
Bug description:
Building a minimal toolbar panel (a text input, a checkbox, and a button) using <ingame-ui> from /templates/ingameUi/ingameUi.html. Setting content-fit="true" on the element (per the template’s own attribute, intended to size the frame to its content) leaves the panel collapsed to just its title bar — none of the light-DOM content is visible, even though the DOM shows the content mounted correctly.
Workaround: drop content-fit, set an explicit fixed width/height/min-width/min-height on the ingame-ui element, and force the framework-generated .ingameUiContent / .ingameUiWrapper wrapper divs (which ingame-ui wraps light-DOM children in) to flex: 1 1 auto; width: 100%; height: 100% via CSS, since by default they collapse to zero height. I reverse-engineered this workaround by checking GSX content.
Repro is public: part-13/13-4 - CommBus from Toolbar/Panel, specifically:
Repro steps:
Toggling content-fit="true" back on (and removing the fixed sizing) reproduces the collapse.
Attachments:
Private attachments: N/A
Hello @BenkeiBuddy ,
So after further investigation, I think I found the problem.
On your project, inside “dutchflightsim_commbussender_panel.xml” the dimensions were not specified.
This specifies the dimension of the view, and then inside the HTML and CSS, you can tell if you want to use all the view or not.
And in your case, you were using 100% of a default small view.
So the fix will be to add:
[...]icon="DFS_COMMBUS_SENDER">
<minWidth>48</minWidth>
<minHeight>55</minHeight>
<defaultWidth>47.963</defaultWidth>
<defaultHeight>55</defaultHeight>
[...]</InGamePanels.InGamePanelDefinition>
A ticket has been logged to document the functioning of the panel.
Thanks for the report.
Romain,
When I tried to set this and go back to 100%, I got all kinds of strange effects. Initially with the dialog taking the full height of the window, until I concluded that those values were not in pixels.
Googling around I found someone who also had “defaultTop” and “defaultRight”, as well as “resizeDirections”, but these were all written in a form that suggests they were specified as attributes to the InGamePanels.InGamePanelDefinition tag, rather than elements.
There has been an update, because I now get download links for the 1.7.2 SDK, but at the moment I don’t see my dialog any more. Is there a way to not only fix the size, but also fix the position?
You mention documentation fixes, but for this particular kind of Panel I can’t find anything at all in the SDK docs.
Cheers,
Bert
@PowerGecko I have been doing more experiments. Again, see example 13-4 in my repo.
Width now appears to work, but height kept going between invisible and something that looks like “too high to fit”. That too-high state causes the bottom of the panel to be on the bottom of the screen, confirmed by hovering over the panel element in the Coherent debugger, which shows the bottom margin to be there, but no top margin.
Using defaultRight appears to work, but defaultTop doesn’t do anything that I can see.
Note this behaviour started since the update that came along with SDK 1.7.2.
Hello @BenkeiBuddy ,
I’m not sure to correctly understand because on my side it now looks like this :
And the coherent panel looks like this:
I Select File, “Open project” and select the xml file, “Build All in project”. No errors. I now get a button in the menu. When I click that, it adds the dot in the lower-right corner to signify the dialog is open. On screen I see:
This is with “'SunRise' (12.2 build 282174.999)”
Bert