2020国产成人精品视频,性做久久久久久久久,亚洲国产成人久久综合一区,亚洲影院天堂中文av色

分享

Chrome擴展開發(fā)指南(7)——Themes(主題制作)

 cuso4321 2010-04-13

  

Chrome擴展開發(fā)指南(7)——Themes(主題制作)

在Chrome中,主題當做一個特殊的插件處理。主題要像普通文件一樣打包,但是主題中不包含HTML或者JavaScript代碼。

你可以在主題庫里找到一些主題下載。

下面只是簡單介紹下主題制作,詳細的內容可以參考http://code.google.com/p/chromium/wiki/ThemeCreationGuide


主題是在Manifest文件中定義的。下面是個定義主題的典型例子:

  1. {
  2.   "version": "2.6",
  3.   "name": "camo theme",
  4.   "theme": {
  5.     "images" : {
  6.       "theme_frame" : "images/theme_frame_camo.png",
  7.       "theme_frame_overlay" : "images/theme_frame_stripe.png",
  8.       "theme_toolbar" : "images/theme_toolbar_camo.png",
  9.       "theme_ntp_background" : "images/theme_ntp_background_norepeat.png",
  10.       "theme_ntp_attribution" : "images/attribution.png"
  11.     },
  12.     "colors" : {
  13.       "frame" : [71, 105, 91],
  14.       "toolbar" : [207, 221, 192],
  15.       "ntp_text" : [20, 40, 0],
  16.       "ntp_link" : [36, 70, 0],
  17.       "ntp_section" : [207, 221, 192],
  18.       "button_background" : [255, 255, 255]
  19.     },
  20.     "tints" : {
  21.       "buttons" : [0.33, 0.5, 0.47]
  22.     },
  23.     "properties" : {
  24.       "ntp_background_alignment" : "bottom"
  25.     }
  26.   }
  27. }
復制代碼

我們看到在theme類下有幾個元素,分為為images、colors、tints、properties。下面分別介紹他們。


colors

用來定義基本顏色。顏色需要用RGB格式表示,你可以在browser_theme_provider.cc查看到底可以定義哪些內容。


images

圖片需要用相對地址引用,你設置browser_theme_provider.cc文件中kThemeableImages數(shù)組的所有元素。去掉IDR_并且轉化成小寫格式后就是你需要設置的東西,比如IDR_THEME_NTP_BACKGROUND 需要轉化為theme_ntp_background。


properties

這個地方用來定義諸如背景定位方式、背景重復等屬性。browser_theme_provider.cc里面可以看到有哪些屬性可以定義。


tints

你可以給部分UI著色,比如按鈕、框架、背景tab標簽。(這里翻譯可能有問題,chromechina注)

原文 http://code.google.com/chrome/extensions/themes.htmlChromeChina翻譯,轉載注明出處http://dev./


  

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多