⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qtopiathemeing.html

📁 qtopiaphone英文帮助,用于初学者和开发人员,初学者可以用来学习,开发人员可以用来资料查询.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/edba/dist/qtopia/main-Sunday/qtopia/doc/themeing.doc:1 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Qtopia Theming</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="200" align="left" valign="top"><a href="index.html"><img height="27" width="472" src="dochead.png" border="0"></a><br><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" align="center" size=32>Qtopia</font>   <a href="index.html">Home</a> - <a href="qtopiaclasses.html">Classes</a> - <a href="qtopiaannotated.html">Annotated</a> - <a href="qtopiafunctions.html">Functions</a> - <a href="qtindex.html">Qt Embedded</a></td><td align="right" valign="top">  <table border="0" cellpadding="0" cellspacing="0" width="137">  <tr>  <td><a href="http://www.trolltech.com/company/about/trolls.html"><img height="100" width="100" src="face.png" border="0"></a></td>  <td><img height="100" width="100" src="qtlogo.png" align="top" border="0"></td>  </tr>  </table></td></tr></table><h1 align=center>Qtopia Theming</h1><p> <p> Contents<!-- toc --><ul><li><a href="#1"> Introduction</a><li><a href="#2"> Qtopia - Theming the Phone Edition</a><li><a href="#3"> Themed Views</a><ul><li><a href="#3-1"> Common Attributes</a><ul><li><a href="#3-1-1"> Naming Elements</a><li><a href="#3-1-2"> Positioning Elements</a><li><a href="#3-1-3"> Showing/hiding elements</a><li><a href="#3-1-4"> Specifying Colors</a><li><a href="#3-1-5"> Alignment</a><li><a href="#3-1-6"> Stretching Images</a></ul><li><a href="#3-2"> Themed View Elements</a><ul><li><a href="#3-2-1"> page</a><li><a href="#3-2-2"> rect</a><li><a href="#3-2-3"> line</a><li><a href="#3-2-4"> text</a><li><a href="#3-2-5"> image</a><li><a href="#3-2-6"> anim</a><li><a href="#3-2-7"> status</a><li><a href="#3-2-8"> level</a><li><a href="#3-2-9"> plugin</a><li><a href="#3-2-10"> layout</a><li><a href="#3-2-11"> exclusive</a></ul><li><a href="#3-3"> Known Elements</a></ul><li><a href="#4"> Window Decorations</a></ul><!-- endtoc --><p> <h2> Introduction</h2><a name="1"></a><p> The Qtopia Phone Edition has a powerful theming engine, allowing muchof the user interface to be customized and personalized.<p> <h2> Qtopia - Theming the Phone Edition</h2><a name="2"></a><p> The following can be themed:<p> <ul><li> Color scheme<li> Font<li> Title area<li> Home screen<li> Context bar<li> Window decorations<li> Widget style<li> Icons<li> Media player</ul><p> The color scheme, fonts and background image can be selected by the user inthe Appearance settings.  It also allows a theme to be selected.  Thethemes presented in the Appearance settings modify one or more of the title,home screen, context bar, widget style and icons.  The Media playertheme can be selected independantly in the media player settings.<p> In order to create a well integrated theme it will usually be necessaryto implement the Title area, Home screen, Context bar and Window decorations.Widget style and icons can help to finish the effect, however since theseare far more time consuming to produce it is common to use those providedby an existing theme.<p> A theme is defined by a desktop file in $QPEDIR/etc/themes/.  Thetheme desktop file contains:<p> <pre>[Theme]Name = &lt;name of theme (translatable)&gt;Style = &lt;name of the Style plugin that handles widget drawing&gt;WidgetsConfig = &lt;path for the configuration file (for the themed widget style)&gt;TitleConfig = &lt;path to the title configuration file&gt;HomeConfig = &lt;path to the home screen configuration file&gt;ContextConfig = &lt;path to the context bar configuration file&gt;DecorationConfig = &lt;path to the window decoration configuration file&gt;IconPath = &lt;list of semi-colon separated paths to substitute icons&gt;</pre> <p> For example, the Portal theme is defined by: $QPEDIR/etc/themes/portal.desktop:<p> <pre>[Theme]Name = PortalStyle = QtopiaTitleConfig = portal/title.xmlHomeConfig = portal/home.xmlContextConfig = portal/context.xmlDecorationConfig = portal/decorationrc</pre> <p> The title, home screen and context bar share the same theming format.  Thewindow decoration and widget themes have their own formats.<p> <h2> Themed Views</h2><a name="3"></a><p> Themed views are used by the title, home screen and context bar.  The Qtopiasystem interacts with the themed views to display status information,text, animations, etc.  The themed views are represented by XML files whichdescribe a heirachical group of visual and formatting elements.<p> <h3> Common Attributes</h3><a name="3-1"></a><p> There are a number of attributes common to many of the elements.  Theseaffect the placement of elements and their visual appearance.<p> <h4> Naming Elements</h4><a name="3-1-1"></a><p> Qtopia Phone interacts with elements using their <tt>name</tt>.  All elementscan be named, however only one element of each type should have the same name.For a list of the elements that Qtopia can interact with see theKnown Elements section.<p> This attribute is available in all elements.<p> <h4> Positioning Elements</h4><a name="3-1-2"></a><p> Elements are placed according to <i>rect</i> attributes.  The rects arerelative to their parent's geometry.  The rect attributes can have one oftwo forms:<ul><li> <tt>x,y,wxh</tt> - specifies the top, left corner and the width and height.<li> <tt>x1,y1,x2,y2</tt> - specifies the top, left and bottom, right corners.</ul><p> If any of the top or left coordinates are negative, they are relative to theright/bottom of the parent element. If bottom or right coordinates areless than or equal to zero, they are relative to the right/bottom of theparent element.<p> This allows the theme to scale.  For example, to place a rect element thatscales as the view gets wider:<p> <pre>&lt;rect rect="20,10,-20,50" color="Highlight" brush="Highlight"/&gt;</pre> <p> This places a rectangle, using the Highlight color, at 20,10 with heightof 40 pixels and the y2 coordinate 20 pixels from the parent element'sright side.<p> This attribute is available in all elements.<p> <h4> Showing/hiding elements</h4><a name="3-1-3"></a><p> The Qtopia phone system may show or hide elements as appropriate dependingupon the state of the system.  These elements can be specified by setting the<tt>transient</tt> attribute to "yes".  The <tt>active</tt> attributedetermines whether the element will initially be visible.  The defaultis to show the element.  To hide the element set active to "no".  Theelements which can be transient are listed in the Known Elements section.<p> This attribute is available in all elements.<p> <h4> Specifying Colors</h4><a name="3-1-4"></a><p> Colors can be specifed by either their hex color code of the form #RRGGBB,by their Qt QColorGroup color roles:<p> <ul><li> <tt>None</tt> - do not paint/blend with any color.<li> <tt>Background</tt> - general background color.<li> <tt>Foreground</tt> - general foreground color.<li> <tt>Base</tt> - used as background color for e.g. text entry widgets,usually white or another light color.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -