Skip to content

WebView inside OptionContainer not resizing when maximising #1968

@freakboy3742

Description

@freakboy3742

On Winforms, if you have a window that contains an OptionContainer, with a tab that contains a web content, and you resize the window, the web view responds. However, if you press the maximise button, the OptionContainer and Webvew don't resize to fit the window.

When you de-minimize, the OptionContainer resizes to fit the smaller window, but the WebView appears to be resized to fit the old, maximized size.

Example:

import toga
from toga.style import Pack
from toga.constants import COLUMN


class BugReport(toga.App):
    def startup(self):
        self.main_box = toga.Box(style=Pack(direction=COLUMN, flex=1))

        self.optioncontainer = toga.OptionContainer(style=Pack(flex=1))
        self.optioncontainer.add("A Tab", toga.WebView(url="https://beeware.org"))
        self.main_box.add(self.optioncontainer)

        self.main_window = toga.MainWindow(
            title=self.formal_name, size=(510, 600), position=(100, 0)
        )
        self.main_window.content = self.main_box
        self.main_window.show()


def main():
    return BugReport("Bug report", "org.beeware.bug")


if __name__ == "__main__":
    main().main_loop()

The resize works as expected on Cocoa and GTK.

Discussed in #1967

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.windowsThe issue relates to Microsoft Windows support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions