sugarlabs / physics

a box2d playpen
GNU General Public License v3.0
7 stars 26 forks source link

Fix create toolbar #55

Closed sparshg closed 1 year ago

sparshg commented 1 year ago

Button to show create toolbar got deleted in b4036112022c63ab4f96d5ce04fefc3da4553188 Closes #54 @chimosky

chimosky commented 1 year ago

Tested, b403611 doesn't remove create toolbar though.

The activity canvas doesn't adjust after create toolbar is hidden, instead the lower part comes up and shows the base of the canvas;

Screenshot from 2023-07-24 16-51-30

After the colors tool bar button is hidden, the top part of the canvas is left with a mark of the toolbar.

Screenshot from 2023-07-24 16-52-01

sparshg commented 1 year ago

Tested, https://github.com/sugarlabs/physics/commit/b4036112022c63ab4f96d5ce04fefc3da4553188 doesn't remove create toolbar though.

I think it was because toolbar_box.show_all() was removed. I confirmed it was working before this commit.

I am working to fix other problems meanwhile.

chimosky commented 1 year ago

I think it was because toolbar_box.show_all() was removed. I confirmed it was working before this commit.

Yeah you're probably correct

sparshg commented 1 year ago

Okay so this is what I found, (included in commit)

the top part of the canvas is left with a mark of the toolbar.

Sugargame doesn't detect resize due to open/closing of menu by create_toolbar (and other similar dropdown widgets). This leads to a horizontal gap because the pygame canvas is not resized when the menu is hidden.

lower part comes up

Also, using the color selector dropdown does trigger the resize and the pygame canvas fills the gap. But now all the elements are shifted up because (0, 0) of pygame canvas is shifted up.

A solution to all of this would be to not show the create_toolbar by default, eliminating the need to resize the canvas anytime.

chimosky commented 1 year ago

Tested 7f8cfbd, works as expected and seems like a preferred solution.

@quozl any objections?

quozl commented 1 year ago

No objections. Give it a good test.