Talk:Theme Management API

From WebOS Internals
Jump to: navigation, search

The original idea is a bit lacking with regards to file path restrictions. If we are going to create a legit Theme API, we should do it right and start off with an easy to read and create config file. Let's discuss what this should look like

Organization

I suppose we could list all the Parts of themeing and how we want to separate/organize:

Wallpaper
Launch Icons
System Images
Global CSS classes
Emoticons
Fonts

Theme API Config File

egaudet v4

theme_config.json sans required quotes Launch Point Icons are given a launchPointId, which by default is simply the <appid>_default. Something like sprint portal is set up with launchPointId 12022008 seemingly via /usr/luna/launchpoints/12022008 file. If no launchPointId is given, <appid>_default will be set.

{ 
  applications:
  [
      { appId: com.palm.package1, icon: relative/path/to/icon, cssFileName: relative/path/to/css },
      { appId: com.palm.package2, icon: relative/path/to/icon },
      { appId: com.palm.browser, launchPointId: 12022008, icon: relative/path/to/icon }
  ],

  global:
  {
    cssFileName: relative/path/to/global/css 
  },

  wallpaper:
  {
    image: relative/path/to/image
  },

  emoticons, fonts, top/bottom bar size (luna.conf and other /etc/palm configuration options etc...)
}

Does this assume that the css files pointed to will be sparse? rboatright 06:19, 31 January 2010 (UTC)

---

I've done some testing and I've now verified the CSS loading model. Currently every app (including top-bar and app-launcher) call the single framework function Mojo.loadStylesheetsWithLink when loaded. This goes through and loads all the global css from the framework first and then all the app specific css. I patched this function to read the theme_config.json and load the global cssFileName (if exists) followed by the app specific cssFileName AFTER all the existing css loading is done (i.e. all global and app css). So this will allow overwriting as little or as much CSS as desired in the entire system. Egaudet 08:34, 31 January 2010 (UTC)

PuffTheMagic v3

applications:
{
  com.palm.package1:
  {
    launcherIcon = relative/path/to/icon1;
  }
  com.palm.package2:
  {
    css = relative/path/to/css2;
  }
  com.palm.package3:
  {
    css = relative/path/to/cs3;
    launcherIcon = relative/path/to/icon3;
  }
};

rboatright =

global css replacements not related to apps

{
  cssFileName:  relative/path/to/replacement/cssFile.css
}

zsoc

HOW DID THIS GET HERE I AM NOT GOOD WITH COMPUTER