-
Notifications
You must be signed in to change notification settings - Fork 15
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
Make document tabs closable #240
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do that because I find it very ugly... (I already refused such a PR).
The only way for me to accept would be to change the style of the close button, like VS Code for example:
- only show the button on the current tab
- or when hovering the other tabs
- change the icon to use the close icon from the dock for example
I don't think it's worth it. If you want to do it, go ahead, otherwise close the PR.
b3ab264
to
ad0bbd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, just rebase and remove the timer, and it's good to go.
This implementation shows and hides all close buttons simultaneously while mouse cursor hovers over them. A delay was added before close buttons are hidden again to save the user from a jarring experience when they off-shoot the mouse cursor reaching for the tab bar. Ideally we'd only display close buttons for the active tab and the tab currently being hovered. However, the list of tabs is stored in the protected side of QTabBar (qtabbar_p.h) and we can't make use of it without re-inventing the wheel.
Allow closing documents by clicking X in their tabs.