richardwilkes/unison

Feature request:Add context menu for tabCloser under dock layout to close all tabs

ddkwork opened this issue · 6 comments

Hello, once again I am disturbing you. After a long time of reading the unison source code, I have not been able to find the rendering process of the tab's title bar area and the implementation of the mouse press event. Currently I would like to simulate goland's tab right click --> close other tabs or close all. I tried inserting the context menu inside a panel that implements the tabcloser interface and converting the first dockable to a container dock, when the context menu is clicked it closes the page beyond the last dockable, which is a bit strange, ideally all of them would be closed instead of the one left. Also, the popup position and trigger area for the context menu is laid out within the panel inserted within the tabcloser, not in the title area, when the panel is stuffed with buttons or tables, the trigger area for the context menu will override it, resulting in no popup menu, so the correct position can only be to popup in the title header area of the tab so that it always works. I tested that inserting a label or field into a tab's panel triggers the context menu properly and closes all tabs with one click, but this is not universal.

Screenshot_20240510_140456_com.realvnc.viewer.android.jpg

Screenshot_20240510_140608_com.realvnc.viewer.android.jpg

Screenshot_20240510_195612_com.realvnc.viewer.android.jpg

After some tough research, I finally made it. Needed to add the get method for the dockheader, in addition to adding another method to fetch the labels for each tab, and I am sure that these lines of code had no side effects on the gcs, including the set parent panel method for the panel mentioned earlier. In case you'd like to expand on these new features

Would you be willing to accept my short pr to extend these features? The entire code would be no more than 20 lines, thank you.

I'm open to a PR. Depending on just what and how it is being changed, I may or may not accept it. Worth taking a look, though.

I'm open to a PR. Depending on just what and how it is being changed, I may or may not accept it. Worth taking a look, though.

#56

are you ok ? i hope you are well.

I'm fine. Just extremely busy with work, which doesn't leave a lot of time for personal projects such as unison.