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

Add option to remove tab close buttons #10739

Closed
jez9999 opened this issue Aug 20, 2016 · 16 comments
Closed

Add option to remove tab close buttons #10739

jez9999 opened this issue Aug 20, 2016 · 16 comments
Assignees
Labels
feature-request Request for new features or functionality workbench-tabs VS Code editor tab issues
Milestone

Comments

@jez9999
Copy link

jez9999 commented Aug 20, 2016

There should be a preference for removing tab close buttons (it just needs to apply the css style ".close-editor-action {display:none;}" to the interface) - tab close buttons make it too easy to accidentally close a tab, and you can use middle-click instead anyway.

@bpasero bpasero added feature-request Request for new features or functionality workbench-tabs VS Code editor tab issues workbench labels Aug 22, 2016
@bpasero bpasero added this to the Backlog milestone Aug 22, 2016
@bpasero bpasero removed their assignment Aug 22, 2016
@bpasero bpasero added the help wanted Issues identified as good community contribution opportunities label Aug 29, 2016
@jez9999
Copy link
Author

jez9999 commented Sep 20, 2016

@bpasero @hashhar As this has now been implemented by you when will it get checked into the main codebase?

@bpasero
Copy link
Member

bpasero commented Sep 20, 2016

@jez9999 @hashhar I am not seeing a PR yet?

@hashhar
Copy link
Contributor

hashhar commented Sep 20, 2016

@bpasero @jez9999 I am only able to hide and show the close buttons but they don't refresh automatically. You would have to at least drag the tab to make the setting take effect.

I am unable to get it to repaint the window at my will.
I'll look into it again but right now I have campus placement sessions coming up so I'm a little too busy.

@jez9999
Copy link
Author

jez9999 commented Sep 20, 2016

@hashhar Your patch modifies the code where the tabs are created, but is there a way to apply a global stylesheet to the UI? If so, you could just add or remove a CSS styling that hides all the tab close buttons. That seems the most straightforward way to do it.

@bpasero
Copy link
Member

bpasero commented Sep 20, 2016

@hashhar also keep in mind that you do not want to hide the dirty decorator which is drawn on top of the close action.

@hashhar
Copy link
Contributor

hashhar commented Sep 20, 2016

Thanks for the input. I'll take it up again after the placements are over.

@jez9999
Copy link
Author

jez9999 commented Sep 20, 2016

@hashhar How long will the placements take? This seems like a very small patch and I'd really like to get rid of those tab close buttons as soon as possible. :-)

@hashhar
Copy link
Contributor

hashhar commented Sep 20, 2016

You are welcome to try and write a patch if you would like. I think it should be over by 28th of this month.

@jez9999
Copy link
Author

jez9999 commented Oct 5, 2016

@hashhar Bump! Any chance of progressing on this issue now? :-)

@hashhar
Copy link
Contributor

hashhar commented Oct 5, 2016

I am not able to figure out how tabs are drawn. I think I have a long week ahead of me of stepping through the entire codebase to learn how stuff works.

@jez9999
Copy link
Author

jez9999 commented Oct 22, 2016

@hashhar Did you get anywhere with this? I just closed another tab accidentally! Grrrr!

@bpasero bpasero self-assigned this Oct 30, 2016
@bpasero bpasero modified the milestones: November 2016, Backlog Oct 30, 2016
@bpasero bpasero removed the help wanted Issues identified as good community contribution opportunities label Nov 2, 2016
@bpasero bpasero closed this as completed in 8185338 Nov 3, 2016
@bpasero
Copy link
Member

bpasero commented Nov 3, 2016

Pushed this behind a new setting workbench.editor.showTabCloseButton. The dirty indicator when visible serves as action to save the file:

editors

@PunchyRascal
Copy link

PunchyRascal commented Nov 3, 2016

It's great that these little things are being worked on, thanks. But -

I am sorry to maybe sound a little negative, but IMO the reason why people wanted to remove the close button is because they don't want to accidentally push any buttons while switching tabs, just being free to press anywhere on the tab, without worrying what will happen - at least I do. So to replace a close button with another button is a bit counter productive. Maybe add settings for it too?

@jez9999
Copy link
Author

jez9999 commented Nov 3, 2016

Exactly.

@bpasero While having the indicator save the document is at least a lot less destructive that closing it, I'm still disappointed you didn't just use my code. The idea is that we want to be able to click the tab button with no side effects apart from selecting or moving the tab. Your solution gives the side effect of saving. I still suggest you back this out and implement my patch.

bpasero added a commit that referenced this issue Nov 3, 2016
@bpasero
Copy link
Member

bpasero commented Nov 3, 2016

@PunchyRascal thanks for your comment on this, I see the issue and pushed a fix for it.

@jez9999
Copy link
Author

jez9999 commented Nov 3, 2016

Nice. No tab buttons, and a dirty indicator implemented through CSS. Works great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality workbench-tabs VS Code editor tab issues
Projects
None yet
Development

No branches or pull requests

5 participants