Menus and button labels using markup

Now that Opus supports (some) markup in button labels, something like this can be achieved without needing external images:

star_rating_menu_dark

This uses the code <%stars:1/1> for the single star on the menu item and then <%stars:0/5> through to <%stars:5/5> for the individual functions.

Some more markup codes you can use are described in this thread.

Menu XML - paste to a toolbar in Customize mode
<?xml version="1.0"?>
<button backcol="none" display="label" label_pos="left" min_width="yes" textcol="none" type="menu">
	<label>&lt;%stars:1/1&gt;</label>
	<tip>Set Rating</tip>
	<icon1>#newmenu</icon1>
	<button backcol="none" display="label" textcol="none">
		<label>&lt;%stars:0/5&gt;</label>
		<icon1>#newcommand</icon1>
		<function type="normal">
			<instruction>SetAttr META rating:0</instruction>
		</function>
	</button>
	<button backcol="none" display="label" textcol="none">
		<label>&lt;%stars:1/5&gt;</label>
		<icon1>#newcommand</icon1>
		<function type="normal">
			<instruction>SetAttr META rating:1</instruction>
		</function>
	</button>
	<button backcol="none" display="label" textcol="none">
		<label>&lt;%stars:2/5&gt;</label>
		<icon1>#newcommand</icon1>
		<function type="normal">
			<instruction>SetAttr META rating:2</instruction>
		</function>
	</button>
	<button backcol="none" display="label" textcol="none">
		<label>&lt;%stars:3/5&gt;</label>
		<icon1>#newcommand</icon1>
		<function type="normal">
			<instruction>SetAttr META rating:3</instruction>
		</function>
	</button>
	<button backcol="none" display="label" textcol="none">
		<label>&lt;%stars:4/5&gt;</label>
		<icon1>#newcommand</icon1>
		<function type="normal">
			<instruction>SetAttr META rating:4</instruction>
		</function>
	</button>
	<button backcol="none" display="label" textcol="none">
		<label>&lt;%stars:5/5&gt;</label>
		<icon1>#newcommand</icon1>
		<function type="normal">
			<instruction>SetAttr META rating:5</instruction>
		</function>
	</button>
</button>
5 Likes