Chrome扩展开发指南(7)——Themes(主题制作)
2010-09-23 00:19
357 查看
Chrome扩展开发指南(7)——Themes(主题制作)
在Chrome中,主题当做一个特殊的插件处理。主题要像普通文件一样打包,但是主题中不包含HTML或者JavaScript代码。 你可以在主题库里找到一些主题下载。 下面只是简单介绍下主题制作,详细的内容可以参考http://code.google.com/p/chromium/wiki/ThemeCreationGuide 主题是在Manifest文件中定义的。下面是个定义主题的典型例子: { "version": "2.6", "name": "camo theme", "theme": { "images" : { "theme_frame" : "images/theme_frame_camo.png", "theme_frame_overlay" : "images/theme_frame_stripe.png", "theme_toolbar" : "images/theme_toolbar_camo.png", "theme_ntp_background" : "images/theme_ntp_background_norepeat.png", "theme_ntp_attribution" : "images/attribution.png" }, "colors" : { "frame" : [71, 105, 91], "toolbar" : [207, 221, 192], "ntp_text" : [20, 40, 0], "ntp_link" : [36, 70, 0], "ntp_section" : [207, 221, 192], "button_background" : [255, 255, 255] }, "tints" : { "buttons" : [0.33, 0.5, 0.47] }, "properties" : { "ntp_background_alignment" : "bottom" } } } 复制代码 我们看到在theme类下有几个元素,分为为images、colors、tints、properties。下面分别介绍他们。 colors 用来定义基本颜色。颜色需要用RGB格式表示,你可以在browser_theme_provider.cc查看到底可以定义哪些内容。 images 图片需要用相对地址引用,你设置browser_theme_provider.cc文件中kThemeableImages数组的所有元素。去掉IDR_并且转化成小写格式后就是你需要设置的东西,比如IDR_THEME_NTP_BACKGROUND 需要转化为theme_ntp_background。 properties 这个地方用来定义诸如背景定位方式、背景重复等属性。browser_theme_provider.cc里面可以看到有哪些属性可以定义。 tints 你可以给部分UI着色,比如按钮、框架、背景tab标签。(这里翻译可能有问题,chromechina注) |
相关文章推荐
- Chrome扩展开发指南(7)——Themes(主题制作)
- Chrome扩展开发指南(1)——入门
- 为前端开发人员制作的 Chrome 扩展 jsbeautifier
- PHP内核介绍及扩展开发指南—高级主题
- PHP内核介绍及扩展开发指南—高级主题
- Chrome扩展开发指南(3)——Browser Action(扩展图标)
- Chrome扩展开发指南(
- Chrome扩展开发指南(1)——入门
- [转]为前端开发人员制作的 Chrome 扩展 jsbeautifier
- Chrome扩展开发指南(4)——Options Pages(选项页面)
- 为前端开发人员制作chrome扩展一枚jsbeautifier
- Chrome扩展开发指南(转载)
- Chrome扩展开发指南
- Chrome扩展开发指南(1)——入门
- Chrome扩展开发指南(5)——Override Pages(重置页面)
- Chrome扩展开发指南(6)——Page Actions(地址栏图标)
- PHP内核介绍及扩展开发指南—高级主题
- 为前端开发人员制作的 Chrome 扩展 jsbeautifier
- Chrome扩展开发指南(8)——Bookmarks(书签操作)
- Chrome扩展开发指南(9)——Events(事件)