前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP Fiori图标(icon)设计原理

SAP Fiori图标(icon)设计原理

作者头像
Jerry Wang
发布2020-08-12 10:39:02
6340
发布2020-08-12 10:39:02
举报

When you are creating a new button and assign an icon to it, there is no way for you to know exactly what does this “add” icon look like.

Even if you use the star symbol in launchpad designer, there is still no convenient way to find this add icon.

Since all icons are listed in F4 help, there is no filter there:

Instead we can use this useful tool to find the icon you need efficiently: Currently there are 535 icons available.

We can easily find the icon we need by search button.

And in the right-bottom part of the page, there is an id “e000” displayed for icon “accidental-leave”. We will explain the meaning of this id in the end part of this blog.

How is icon rendered in Fiori

Originally I thought that the binary content of all icons are stored in the server side. And in the runtime when an icon is to be rendered, there is a conversion done, transferring the internal url like “sap-icon://XXX” to absolute path like “https://XXXX” which points to the icon stored in the server. However I am wrong.

代码语言:javascript
复制
         Figure: how the traditional image is displayed in Fiori

If you use the element inspection function in Chrome development tool, you will find the corresponding html element for image in the final html source code does not contain any attribute like src. Instead, it has an attribute defined by SAP which seems to have something to do with image content: data-sap-ui-icon-content.

The value of this attribute is filled by IconRenderer when the icon is to be displayed in UI. The variable oIconInfo.content stores the actual value.

Check the source code of this js file, where all the supported icons together with their icon name and icon code are hard coded.

So the icon id for icon “accidental-leave” we find in icon browser page, e000, is just its corresponding code hard coded in IconPool.js.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-08-11 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • How is icon rendered in Fiori
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档