You can specify icons for your application in either of the following methods:
- Using the appdef.xml file. It is possible to use the <icon> and <icon-selected> elements to provide the file name (including the relational path) to icons. It is possible to always use one icon (<icon>), or <icon-selected>, when the tab is selected, and <icon> when the tab is not selected. It is not possible to define only <icon-selected>. The icons must be in the same folder where appdef.xml is or in subfolders under it. The <icon> and <icon-selected> elements are supported in M-Files version 19.8.8114.7 and later. If you use these elements in earlier versions than 19.8.8114.7, it prevents you from opening the client.
- Placing the icons with predefined file names in a dashboard ID dependent folder. You can get the dashboard ID from appdef.xml. The icon file names are icon.png and icon-selected.png. For each dashboard, the icons must be placed in a folder which has the same name as the dashboard ID. For example, for a dashboard with ID "base-dashboard", the correct file names and locations would be base-dashboard\icon.png and base-dashboard\icon-selected.png. These work the same way as the first method. If there are any non-empty settings in the XML for the icons, those settings are used for that dashboard instead of any icons in the predefined locations. This method works only in M-Files May '20 Update or later. This method does not have any incompatibility issues with older versions, but with earlier versions than the M-Files May '20 Update the icons will not show.
Example |
Copy Code
|
<?xml version="1.0" encoding="utf-8"?>
<application type="client-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.m-files.com/schemas/appdef-client-v3.xsd">
<guid>7BE49057-5EC7-4FC8-9302-32C0BAA3737E</guid>
<name>Sample App</name>
<description>Sample Application</description>
<platforms>
<platform>Desktop</platform>
</platforms>
<modules>
<module environment="shellui">
<file>main.js</file>
</module>
</modules>
<dashboards>
<dashboard id="base-dashboard">
<content>Base.dashboard.html</content>
<icon>icon.png</icon>
<icon-selected>icon-selected.png</icon>
</dashboard>
</dashboards>
</application>
|
Restrictions in Both Methods
- The icon size must be 32 x 32 pixels.
- The icon format must be .png.