CommandButton custom Icon size

 From:  Michael Gibson
7860.2 In reply to 7860.1 
Hi Marco, although the PNG image files for command buttons are 64x64 pixels in size, the actual size in the UI is relative to your current UI font size (set under Options > General > UI Size), and the images are shrunken or stretched as needed.

So just changing the PNG images to be a smaller size will not have any effect, other than to make them more blurry.

The command button icon size is controlled by this part of the moi.css file:

code:
moi\:CommandButton > img, moi\:CommandMenuButton > img, moi\:CommandSplitButton > img {
	width:3.25em;
	height:3.25em;
}


The "em" units used there are relative to the current font size, 1 em = font size in points.

To make a custom command button with a smaller icon you could add in a new entry in the moi.css file right below the above one, and have it say something like this:

code:
moi\:CommandButton.small_icon > img {
	width:2.25em;
	height:2.25em;
}


That means that a command button with a CSS class of "small_icon" will override the regular width and height with a smaller one. Then modify the command buttons that you want to have smaller by putting in class="small_icon" in them something like this:

code:
    <moi:CommandButton icon="icons/ConeIcon.png" class="small_icon" command="cone"><moi:Text textid="Cone"/></moi:CommandButton>


The PNG file itself does not have to be smaller, they can remain at 64x64 pixels, the UI will automatically shrink it to fit in the smaller space.

- Michael