Assign a customized image to an icon on the Quick Access Toolbar

I have created two Quick Access Toolbar buttons that let me toggle between two desired Matlab Desktop layouts, one which arranges the panes in a certain way when the Editor is docked, and one when the Editor undocked:
However, it is unappealing to me that both use the same visual icon . I would like to assign alternative and distinct images to each of these icons.
I notice that the custom Quick Access Buttons are configured with .xml files in the prefdir. I have attached the .xml.zip for my "Docked" button as an example. I was wondering if there is something in the file that I could add or modify to change the icon image. I am looking for tags that dictate the current image, but cannot determine which it is.
Does anyone know if/how such a customization could be made?

 Akzeptierte Antwort

kei hin
kei hin am 26 Jan. 2024
Bearbeitet: kei hin am 26 Jan. 2024

1 Stimme

Right click on your Quick Access Toolbar button, then edit the icon you want in command edit window.
In R2019b, command below will be found in a xml file named with FavoriteCommands. Change 'favorite_command' to the icon image file path you want.
<callback>clear;clc</callback>
<icon name="favorite_command"/>

5 Kommentare

Matt J
Matt J am 26 Jan. 2024
Bearbeitet: Matt J am 26 Jan. 2024
@kei hin you may have misunderstood my post (or I misunderstand yours). Right-clicking does not take me to any options for redefining the appearance of the icon that I can see. Perhaps you can demonstrate with an example. I attach an image of a common North American stop sign. How would I make the Toolbar button present with the image of the stop sign instead of the standard icon.
kei hin
kei hin am 26 Jan. 2024
Bearbeitet: kei hin am 26 Jan. 2024
@Matt J Can you post the window after Right click?
Matt J
Matt J am 26 Jan. 2024
Bearbeitet: Matt J am 26 Jan. 2024
Sure, I see the following dropdown menu,
and after selecting "Customize", I am taken to the Preferences dialogue below. But from there, I don't see any option to select a customized image for the icon. Can you tell me how to proceed?
Sorry I misunderstood your post. layout button is not a command...
Ahah, but this FEX download,
makes it possible to activate a layout with a Matlab command, and therefore to do the same using a Favorite action.
Thanks!!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2021b

Gefragt:

am 26 Jan. 2024

Kommentiert:

am 26 Jan. 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by