2012-01-10, 12:34 AM
Try using a UIStatic instead of a UIElement:
Screensaver.xml:
Screensaver.cs (only showing differences)
Ideally though, I would resize _Content and just put the background rectangle there. That way you only have to render _Content.
Screensaver.xml:
Code:
<Skin>
[B][I][COLOR="#FF0000"]<Element name="SSBG" location="0,0" size="100,100" alpha="255">
<Rect location="0,0" size="100,100" fillColor="Black"/>
</Element>[/COLOR][/I][/B]
<Element name="Content" location="0,0" size="75,75" alpha="255">
...
</Element>
</Skin>
Code:
private UiElement _Black = null;
[I][B][color=#FF0000]private UiStatic _Black2 = null;[/color][/B][/I]
private UiStatic _Content = null;
public ScreensaverPopup(SkinHelper skinHelper, string backgroundElementName, Hashtable args, IPluginCallback callback)
: base(skinHelper, backgroundElementName, args, callback)
{
...
_Black = new UiElement("screensaver-black", new RectangleF(0, 0, 100, 100), black, 255);
[I] [B][color=#FF0000]_Black2 = new UiStatic("SSBG", new Hashtable(), skinHelper);[/color][/B][/I]
_Content = new UiStatic("Content", _Args, skinHelper);
...
}
public override List<UiElement> GetRenderList()
{
System.Diagnostics.Debug.WriteLine("TESTREDRAW: GetRenderList (popup) " + DateTime.Now.Second);
Logger.Info("TESTREDRAW: GetRenderList (popup) " + DateTime.Now.Second);
List<UiElement> renderList = base.GetRenderList();
[I][B][COLOR="#FF0000"]//renderList.Add(_Black);
renderList.AddRange(_Black2.GetRenderList());[/COLOR][/B][/I]
renderList.AddRange(_Content.GetRenderList());
return renderList;
}
Ideally though, I would resize _Content and just put the background rectangle there. That way you only have to render _Content.