Understanding sidesheet in new M3 theme

I’m trying to use the sidesheet in the new M3 theme.

I create a form based on the NavigationRailLayout, mark it as a layout and add some navigation links to the Rail. (Let’s call that ‘Main’).

I create another form that uses my new layout.

How do I toggle the sidesheet? Although the NavigationRailLayout has show_sidesheet attribute, my Main form does not.

What’s the intended pattern here?

Clone link:

All you need to do is go up the layout change one more time:

self.layout.layout.show_sidesheet = not self.layout.layout.show_sidesheet

in the button’s click handler.

yeah, I’d wondered about putting a property on my Main form that gets and sets the parent property.

I just wondered if I was missing something slightly nicer!

1 Like

I suppose what seems odd is that, in the designer, my Main form appears to have that property - I can see it in the properties tab and I can set its value.

I just can’t do the same via code.

Interesting, that’s odd.

I think that this basically falls under this feature request:

As @duncan_richards12 suggests, the correct approach here is to reference self.layout.layout.show_sidesheet. We’ll investigate why that is showing up in the properties of your derived layout!

1 Like

OK. Thanks both. At least I know I’m not missing something blindingly obvious!

A post was split to a new topic: M3 form() and drawer() methods like alert()