7,924
edits
Line 104: | Line 104: | ||
== XR App Customization == | == XR App Customization == | ||
If you followed the previous steps, you now have a working Sugar activity. | |||
It launches in full screen and is able to quit. | |||
Now, in order to comply with the Sugar HIG, you would consider some of the following UI adjustment. | |||
The easiest way to do so is by: | |||
* Using a dedicated skin and set it as default for your Sugar build | |||
* Using switches in your Javascript code. | |||
You can detect a Sugar client with the following: | |||
<pre>isSugar: function() { | |||
var environment = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment); | |||
return environment.exists("SUGAR_BUNDLE_PATH"); | |||
}</pre> | |||
=== U.I Adjustments === | |||
* '''Remove menubar'''. There is no menubar in Sugar apps. | |||
=== Native Activity === | |||
An alternative to spending a lot of time adjusting your U.I, is to write a Sugar activity from scratch and embed Gecko. | |||
If you don't use much of XUL/Javascript for your interface, it's a good solution as it gives you native widgets. | |||
We did not go this way as we have a lot of U.I code and we can't afford to maintain duplicate code in separate languages (Sugar activities are to be written in python). | |||
=== Toolbars === | === Toolbars === | ||
* Stock icons | * Stock icons |
edits