toga icon indicating copy to clipboard operation
toga copied to clipboard

Layouts inside SplitContainer (and OptionContainer?) don't update until resizing finishes

Open HalfWhitt opened this issue 11 months ago • 2 comments

Describe the bug

In Toga Demo — at least on macOS — when you drag the window to resize, or drag the middle divider back in forth, the layouts within the two panes of the SplitContainer don't update until the mouse button / trackpad is released. The OptionContainer on the left does resize itself continuously, but the table (or tree) within it doesn't.

The teal background in the OptionContainer example behaves similarly.

Steps to reproduce

pip install toga-demo
toga-demo

Or, in a copy of the repository:

cd examples/optioncontainer
python -m optioncontainer

Expected behavior

Intuitively, I'd expect the table/tree and the buttons to change size dynamically as the window is resized and the middle slider is moved.

Screenshots

https://github.com/user-attachments/assets/42fef2bc-2b12-4073-a52d-370cce0f69ba

Environment

  • Operating System: macOS Sonoma 14.7.3
  • Python version: 3.13.0
  • Toga: Development

Logs

Additional context

I haven't poked any at this yet, but I thought I'd go ahead and post it since I don't see an existing issue for it.

HalfWhitt avatar Feb 10 '25 03:02 HalfWhitt

Worth noting that in both these cases, the demo is a "container in a container" - the left is an Option Container inside a SplitConatiner; the right is a ScrollContainer inside a SplitContainer. So - it's not necessarily clear if the issue is:

  1. SplitContainer not passing down resize requests appropriately
  2. OptionContainer and ScrollContainer not handling resize requests appropriately
  3. Containers inside Containers as a general principle.

freakboy3742 avatar Feb 10 '25 03:02 freakboy3742

I didn't even notice the ScrollContainer on the right, despite having just talked about how, unlike in HTML/CSS, boxes can't spontaneously grow scrollbars on their own.

HalfWhitt avatar Feb 10 '25 03:02 HalfWhitt