-
-
Notifications
You must be signed in to change notification settings - Fork 687
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
On IOS option window does not render correctly #2945
Comments
In this code example the same issue arises: import toga
|
When the making of the option container is in the synchronous startup it seems to work, e.g. with this code:
|
Thanks for the report - that's definitely an odd one. What's especially odd is that it appears to be the native OptionContainer widget itself that has the problem - it looks like all the pieces are rendered correctly except the background on the tab bar itself. That suggests the issue is with the widget not correctly evaluating its internal size... but I'm not sure why that would be happening. My initial guess is that it might be due to the In terms of an immediate workaround, I'd suggest constructing as much of the layout as you can in the startup method, and then only populate the content that needs to be async in the task. For example - you can create the web view with no content, and then populate the webview in the async task. |
@freakboy3742 thanks for the quick reply as always! I tried something similar as you suggested but tried to create the window in the synchronous init function of a togabox I was creating async. With this solution I now see a clear race condition, sometimes it shows correctly, sometimes it doesn't. For now I'll just move the constructing of the window in my startup function in app.py this should work, thanks! |
I have rewritten my code to this, but I still have the same issue when I call _show_main. As you can see the content is already generated in the startup. Any more suggestions for workarounds?:
|
Also there is another bug, there seems to be a padding top between the mainwindow title on ios and the start of the option container. As can also be seen in the screenshots earlier, the white bar at the top. |
It's very difficult to debug examples when you provide code for a complete app, rather than a reduced example - but the thing that stands out is that your initial main_window is being shown before it has any content, and the splash screen is being added after the window is shown - and it's not clear when (As an aside, I'll also note that the splash screen approach you're using based on hard-coding the size of the window isn't using the Toga API in the way it's intended to be used. If you need a layout to fill the window, then you need a flexible layout that fills the window, not content that is hard coded to a specific size). |
Describe the bug
I have an app that on ios first loads a toga box, does load data than when finished opens a optioncontainer in the main window by changing the main_window.content.
When the option container first renders it overlays the webview behind. When I switch between different options the rendering will be fine after. I have tried to make a highly simplified version, but here all works as expected.
There is only one strange thing in my app, which is that I render a webview outside of the visible window to retrieve the data required.
Steps to reproduce
Expected behavior
I expect the webview inside the option of the option container to stay within the option container area and not overlap the tabs.
Screenshots
Environment
Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: