As part of mythtv's on-going development effort, a new UI library (called libmythui) is being developed and everything is slowly being rewritten to use this. This new library allows multiple 'painters' that do the actual drawing - OpenGL and Qt based painters have been written. Using the OpenGL painter, a more modern/advanced UI is possible. At the same time, the process of rewriting/converting Myth's UI to this new library will allow everything to be made more consistent.
MythUI for themers
The existing UI limits the creativity of themers and mythui seeks to change that. Mythui will spoil themers for choice and also make it even easier to create new themes.
Mythui aims to make theme creation easier by introducing the concept of inheritance. The basic style of widgets can be defined once and then copied from each other or from global definitions. This reduces the amount of copying and pasting required and means that theme-wide changes can be made by editing just a couple of lines.
<textarea name="basetextarea"> <area>100,200,300,40</area> <font>large</font> <align>left</align> <multiline>yes</multiline> <cutdown>yes</cutdown> <scroll>lefttoright</scroll> </textarea> <textarea name="newtextarea" from="basetextarea"> <position>400,300</position> <align>right</align> </textarea>
In the above example the textarea called "newtextarea" shares all the properties of basetextarea except for the position and alignment which have been overridden.
Another change which should make life easier for themers is a reduction in the number of widgets. One of the key goals of mythui was to keep a small set of very powerful widgets which means themers do not need to remember the differences between a pushbutton and textbutton, a listtreearea and managedtreelist etc.
More Versatility and options
In mythui the widgets are more flexible and more powerful. For example, the "buttonlist" can operate in different layouts - Vertical, horizontal or grid. The layout of information within a list item can be customised to produce some very unique styles.
There are more choices for alignment, behaviour and effects.
Mythui adds some basic animation capabilities to the MythTV UI including object movement and image animation. These will be basic at first, however more will be added as time goes on.
MythUI for programmers
MythUI brings a lot of code simplifications, migration of plugins to mythui has so far eliminated thousands of lines of code. It seeks to remove layout and behaviour responsibility from the programmer, handing it to the themer instead. There are fewer widgets to understand and there will be greater consistency across screens.
MythUI Coding Standards
This section will evolve as soon as some basic rules are decided upon. As we move to the new code we have the opportunity to establish some basic framework and rules for screen design and dealing with mythui.
- Do not force layout, style, widgets or behaviour on themers. Make as much as possible optional and offer more widgets to the themer even if they aren't used in the default theme.
- Do not create new widgets, see how the existing widgets can be made to do what you want and discuss it with other developers first.
- Try to copy the layout and code of existing screens. This will make maintaining MythTV easier for everyone.