乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

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

       cuso4321 2010-04-13

        

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

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

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

      下面只是簡單介紹下主題制作,詳細(xì)的內(nèi)容可以參考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. }
      復(fù)制代碼

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


      colors

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


      images

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


      properties

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


      tints

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

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


        

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

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多