Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ddkwork opened this issue May 10, 2024 · 6 comments

Comments

@ddkwork
Copy link

ddkwork commented May 10, 2024

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

@ddkwork
Copy link
Author

ddkwork commented May 10, 2024

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

@ddkwork
Copy link
Author

ddkwork commented May 10, 2024

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.

@richardwilkes
Copy link
Owner

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.

@ddkwork
Copy link
Author

ddkwork commented May 10, 2024

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

@ddkwork
Copy link
Author

ddkwork commented May 15, 2024

are you ok ? i hope you are well.

@richardwilkes
Copy link
Owner

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

@ddkwork ddkwork closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants