Removing buttons from the FileBrwoser's toolbar or changing their actions

Hello! I have created my own instance of the FileBrowser and I would like to remove some buttons from the FileBrwoser’s toolbar.

I know I can remove the whole toolbar with browser.layout.removeWidgetAt(0); however I would like just to remove some buttons from that toolbar.

I have checked that there might be a method to do this browser.toolbar.layout?.removeWidget() this method takes a parameter widget however I don’t know what is the widget for any of the buttons.

Also I was wondering if it is possible to change the action any of those buttons perform. I would also like to customize them.

Thank you very much in advance.

1 Like

If you can get access to the widget (this is the button you want to remove), it might be worth trying widget.parent = null. I have not tried it, but this is how one removes widgets from the notebook toolbar so I think it might work.

Hello! Thank you very much for your comment.

The thing is, I have no idea what is the name of any of the widgets (buttons) of the toolbar. I will continue digging.

Thank you very much for the pointers.

Oh, right. I think that you can iterate browser.layout.widgets which is a ReadonlyArray of widgets according to PanelLayout | @lumino/widgets

1 Like

Hello, Thank you very much again for that. I did that too, I only got numbers. I will dig into this anyways.

Thank you very much!
Have a great day.