MTMR
MTMR copied to clipboard
Show icon for a group
I have made it so you can define an image for a group, I have created a pull request: https://github.com/Toxblh/MTMR/pull/266/
Hopefully it gets merged.
@maandagdev Heya! I'm using your code which works well. Plus i have also extended it to allow for 'width' parameters for groups. Do you have any idea how to enable the 'border' (.isBorder) for group toggle-button aswell? Tried to modify collapsedRepresentation without any success so far. Maybe you have a lil hint for me (ツ)
@maandagdev Heya! I'm using your code which works well. Plus i have also extended it to allow for 'width' parameters for groups. Do you have any idea how to enable the 'border' (.isBorder) for group toggle-button aswell? Tried to modify collapsedRepresentation without any success so far. Maybe you have a lil hint for me (ツ)
Nice! I am glad the code is working for you as well, not sure why the border is not working, I will have to go through the code and have a look for you. Can you show me an example of how you want it to look? (Never got the border to work for any of the items)
@maandagdev Heya! I'm using your code which works well. Plus i have also extended it to allow for 'width' parameters for groups. Do you have any idea how to enable the 'border' (.isBorder) for group toggle-button aswell? Tried to modify collapsedRepresentation without any success so far. Maybe you have a lil hint for me (ツ)
Nice! I am glad the code is working for you as well, not sure why the border is not working, I will have to go through the code and have a look for you. Can you show me an example of how you want it to look? (Never got the border to work for any of the items)
Sure thing! I'd love just to be able to get the bordered-param working for groups:
"type": "group",
"width": 32,
"bordered": false,
[...]
A small hint may be enough (ツ)
@maandagdev Heya! I'm using your code which works well. Plus i have also extended it to allow for 'width' parameters for groups. Do you have any idea how to enable the 'border' (.isBorder) for group toggle-button aswell? Tried to modify collapsedRepresentation without any success so far. Maybe you have a lil hint for me (ツ)
Nice! I am glad the code is working for you as well, not sure why the border is not working, I will have to go through the code and have a look for you. Can you show me an example of how you want it to look? (Never got the border to work for any of the items)
Sure thing! I'd love just to be able to get the bordered-param working for groups:
"type": "group", "width": 32, "bordered": false, [...]
A small hint may be enough (ツ)
Aaah, you want to hide the border?
Aaah, you want to hide the border?
Yeah! Would be ok for me if all group-items would have no border too... Simply can't find where this is defined.
Aaah, you want to hide the border?
Yeah! Would be ok for me if all group-items would have no border too... Simply can't find where this is defined.
I'm currently at my internship but I will have a look for you later tonight. If I can remember correctly it's using an item that the touchbar already knows which makes it (as far as I know) impossible to remove the border. But I will give it a shot for you.
Okay, so I got it working, it's quite dirty but you can find the code on this branch:
https://github.com/maandagdev/MTMR/tree/feature/custom-group-item
What I did is just make a custom class with the same exact code the group item had, but it's now a custom item and from what I can tell it works the same exact way.
Let me know if that is what you want, I will clean up the code and make it work better (Rename the type group to customGroup in your preferences to see it in action)
@maandagdev you deserve the medal of the day! This works awesome! And my touchbar is once clean and simple for my needs!
Thanks a ton!
@dieideeistgut can you share your preset?
@Sn0wCooder - sure! I'll not PR it to examples as it requires the changes by @maandagdev for now. But this gist will do:
https://gist.github.com/dieideeistgut/163ee7901e7361cae4ebc7e870b64277
@dieideeistgut thanks!
@dieideeistgut Do you by any chance know how I could close a group programmatically? I see you don't have an exit button on your groups. Does pressing ESC close it?
@dieideeistgut Do you by any chance know how I could close a group programmatically? I see you don't have an exit button on your groups. Does pressing ESC close it?
There is an close button in place of the group-toggle button ;)
@dieideeistgut I meant by using code, I want to make a timer so the group closes on its own after x amout of time.
@maandagdev maybe you can set an timeout once the group opens and then use the dismissPopover? (https://developer.apple.com/documentation/appkit/nspopovertouchbaritem/2544697-dismisspopover)
I have tried that, it just closes the entire touchbar. it shows like a black bar.
@maandagdev i have tried several stuff here now too - sadly without success. Sorry m8.
@dieideeistgut No worries dude, thanks for trying to help :)
Okay, so I got it working, it's quite dirty but you can find the code on this branch:
https://github.com/maandagdev/MTMR/tree/feature/custom-group-item
What I did is just make a custom class with the same exact code the group item had, but it's now a custom item and from what I can tell it works the same exact way.
Let me know if that is what you want, I will clean up the code and make it work better (Rename the type group to customGroup in your preferences to see it in action)
@maandagdev Could you please create a pull request to the original repository? :) I think others could benefit from your update!
Thank you so much @maandagdev !!!! Always having the touch bar display on was bothering me, but your code let me make a blank button to toggle my entire touch bar!
I currently am unable to get an image to show for groups. The button shows and has the image, but nothing opens when pressed. There is haptic feedback as well.
{ "type":"customGroup", "width": 40, "align":"left", "bordered":true, "title":"", "image":{ "base64":"BASE64 of image 54x35" },
"items": [
@maandagdev any progress? Maybe pull request to master?