GorvGoyl / Shortcut-Menu-Bar-VSCode-Extension

Add handy buttons like beautify, show opened files, save, toggle terminal, etc to the editor menu bar in VSCode. You can also create your own buttons with custom commands. VSCode Marketplace link: https://marketplace.visualstudio.com/items?itemName=jerrygoyal.shortcut-menu-bar
https://marketplace.visualstudio.com/items?itemName=jerrygoyal.shortcut-menu-bar
GNU General Public License v3.0
221 stars 44 forks source link

Ability to make our own buttons... #28

Closed XeonG closed 3 years ago

XeonG commented 4 years ago

Something like the lines of supporting something like https://marketplace.visualstudio.com/items?itemName=hoovercj.vscode-settings-cycler

ie the most common type of button I'd want being a toggle of some other plugins setting or command..

XeonG commented 4 years ago

Even better if 'toggle' buttons can get there visual status based on the command setting.. ie Active/Inactive states.

GorvGoyl commented 4 years ago

That seems like a good feature but a bit complex to implement. I will look into this.

minig0d commented 3 years ago

+1 on this idea. I just skimmed the code of this extension, and in reality isn't it just mapping a "label" that's displayed to the user to a command? Should be easy enough to accept this from a settings JSON obj. By reading from the settings, it actually exponentially increases the versatility because the customizations can take place at the workspace level and can be changed accordingly.

Ex. the following extension is similar to this except in the statusbar and takes the buttons from a user provided config (and is completely customizable, including icon): // vsc marketplace https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-commands // repo for same ext if you want to browse the code https://github.com/fabiospampinato/vscode-commands

rysolv-bot commented 3 years ago

mfurey has contributed $50.00 to this issue on Rysolv.

The total bounty is now $50.00. Solve this issue on Rysolv to earn this bounty.

GitMensch commented 3 years ago

I'd try to add this in the following way:

This allows anyone to setup up to 9 (or more if you want more) self-defined actions and as those are normal settings can also be tied to the workspace.

@GorvGoyl Are you ok with this approach (or see any issue with this)? If not I'd start hacking. @GorvGoyl Second question (which would be unrelated to my PR): would you be ok to replace the current boolean setting in general with the suggested string option? To disable a menu entrr people would then have to empty the command, to enable use the "set to default" option.

GorvGoyl commented 3 years ago

@GitMensch thanks for digging, I think we can maintain both Boolean for the buttons provided by extension and String option for user-defined commands. I'm quite tied up at this time would it be possible to test this method? I found 2 extensions doing something similar: https://github.com/AnWeber/vscode-statusbar-command , https://github.com/Gruntfuggly/activitusbar

GitMensch commented 3 years ago

I'm quite tied up at this time would it be possible to test this method?

Yes, if you are fie with that approach I'd try it for user-defined ones. Depending on work-load and family I may start next week, but I'd really like to know up-front that you'd pull if the approach does work.

GorvGoyl commented 3 years ago

Yes, if you are fie with that approach I'd try it for user-defined ones. Depending on work-load and family I may start next week, but I'd really like to know up-front that you'd pull if the approach does work.

I would gladly accept if it works!

GitMensch commented 3 years ago

I would gladly accept if it works!

Works fine here :-) if possible I'd love to see this in a new release (including on open-vsx which is the extension provider I primarily use), possibly with the other PRs. Thanks!

GorvGoyl commented 3 years ago

released on vscode marketplace. Publishing on open-vsx is in pipeline