These are chat archives for pybee/general

15th
Jun 2018
Geoff
@go8ose
Jun 15 07:05

I looked at the pack algorithm, and wrote a test case. The test case is at https://github.com/go8ose/toga/tree/show_layout_bug. I stepped through the packing procedure in pdb. I think lines 128 to 131 of src/core/toga/style/pack.py might be problematic. When hitting these lines for the node_0_0 TestNode in that test case, the available_width is 630 (which seems fair, it's the size of the viewport less some padding) and the node.intrinsic.width is 10, and the on line 129 available_width is set to 630. This later goes on to be the width used for the node, and the surrounding boxes.

This seems to match up with step 1 of the algorithm described on https://toga.readthedocs.io/en/latest/reference/style/pack.html, If the element has a minimum intrinsic width, the available width is fixed to the maximum of the adjusted view width and the intrinsic minimum width.

I thought that maybe setting line 129 to min() would be better, but when I did that, a bunch of other test cases failed.

QwertyCool
@QwertyCoolMT
Jun 15 20:03
hey there, am i looking in thw wrong place or is there no way to access camera with toga yet?
Russell Keith-Magee
@freakboy3742
Jun 15 22:46
@QwertyCoolMT The bridging tools are good enough to hit the native camera APIs, but Toga itself doesn’t have a cross-platform camera API yet.