-
-
Notifications
You must be signed in to change notification settings - Fork 687
Add support for icons for TouchBar submenus (and maybe other customizations) #1105
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
Comments
Yes that's correct. Thinking more about it I think just fixing Vim's |
But other options like color, priority, etc, would probably need to be something special, right? |
I haven't quite decided on them, but yes, maybe. The Some other special items like the emoji picker is specified by special menu item names, like |
Maybe not entirely on topic but is it possible to update touchbar names dynamicaly during one session? Like when I i press button name1 it changes to name2? |
Use |
Yea I tried, but it does not seem to update in the same session. Anyway thanks :) |
@DesantBucie that should not be the case. Do you have the exact sequence of commands you used? |
Well I tried something like this let g:TabSpaces = 4
function! TabSpaces()
if g:TabSpaces == 4
set tabstop = 2 | set shiftwidth = 2
let g:TabSpaces = 2
else
set tabstop = 4 | set shiftwidth = 4
let g:TabSpaces = 4
endif
endfunction
nmenu TouchBar.Settings.Tab :TabSpaces<CR>
if g:TabSpaces == 4
tmenu TouchBar.Settings.Tab Set Tab 2
else
tmenu TouchBar.Settings.Tab Set Tab 4
endif |
@DesantBucie You need to debug your script more and make sure it works before even trying out the fancier Touch Bar label functionality. I don't think your script currently works at all.
|
I fixed 1,2,3, put both tmenus to function, got "default" one on vimrc and it works like magic. And no I wanted it to be available only on normal mode so it's fine. Thanks awfully for your time. |
Sorry to just hop in here, this could possibly be a separate issue, but is related to icons. In the toolbar and Touch Bar would it be possible to add SF Symbols support? So you could do something like: nnoremenu icon=cross.case.fill TouchBar.Fix :ALEFix <CR> |
Yeah it's something on my mind. I will likely touch these after the next release. It will also make the toolbars look better and fit macOS 11 better. |
Can now specify SF Symbols for tool bar / Touch Bar icons. The API remains the same where we use the "icon=" syntax in Vim menus to specify the icon, and just passing in the symbol name (e.g. 'gear.circle'). Also extended this to system named images like 'NSAdvanced' (the old gear shaped image), as previously we only had a specical case for Touch Bar system named template images. When loading the icon, MacVim will automatically determine whether it's an SF Symbol, system named image, or a file. SF Symbols can also be customized to be of a particular symbol style, or have a variable number set, by using colon-delimted option strings. For example: `aqi.high:palette:variable-0.5` is a symbol that uses the palette style, set to 0.5 variable value. Menu items now also support icons, the same as tool bars. We still don't support specifying icons for a submenu (which has been an issue for Touch Bar) since the Vim menu API doesn't support a way to do so. Also add an ability to use a `:template` value to specify that an image file is a template image. This is important to fix a minor regression introduced in macvim-dev#1214 where every image loaded in were assumed to be template. Add documentation to make this clear. See `:help macvim-toolbar-icon`. Also see comment in macvim-dev#1105 which requested this feature
@destructobeam, #1329 will add the ability to use SF Symbols for tool bar and Touch Bar icons! This includes the ability to customize the symbol to use palette color etc. As for the original request, @jabrouwer82 , submenu icons isn't supported yet. I may eventually add this but there are a lot of other things on my plate that are higher priority MacVim-wise. One compromise is that SF Symbols can be used in raw text form. You can actually copy the symbol out and paste it in as text (easiest way to do so is by using the SF Symbols app that you can download from Apple). For example, you can do this to make a submenu with the SF Symbol "gearshape.2.fill" as the icon for it: |
With the release of the M3 14" MacBook Pro, Apple has officially stopped making any new hardware that has a Touch Bar, with the M2 13" MacBook Pro being the last product that had it. Because of that, there will be no more effort put in for new Touch Bar features, sorry. Meanwhile, 🪦🫗 Touch Bar. I personally liked it despite it being a little polarizing and seemed to never really catch on with other third-party apps (or even first-party Apple ones). |
@ychin Late reply, but just a thanks for your work on this. I too liked the touch bar, a lot, and I will miss it. I feel like the disdain for it from a few popular commentators/podcasters killed this very useful feature. |
According to the code,
:menu
doesn't support setting an icon for touchbar submenus.For example in the hypothetical nested menu
TouchBar.Example.Thing
,TouchBar.Example
can only be plain a plain text (or emoji) button, butTouchBar.Example.Thing
could have an icon declared in the:menu
command that defined it.The (semi) original touchbar implementation (#715) suggests using the
macmenu
command to support extra customization options.The text was updated successfully, but these errors were encountered: