Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: How to prevent default screen background?

  1. #1
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    482

    How to prevent default screen background?

    I am trying to get a solid black background for my screen (implements IScreenPlugin directly). If I have nothing in my skin file the default background image and date/clock are displayed. If I have a skin element that is a black rectangle covering the whole screen, the clock is still drawn on top of everything. How do you prevent this? Sorry if I am missing something obvious.

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,309
    Quote Originally Posted by cncb View Post
    If I have nothing in my skin file the default background image and date/clock are displayed.
    This was intentional to give things a more consistent look. If you'd seen the old GBPVR you'd know why.

    If I have a skin element that is a black rectangle covering the whole screen, the clock is still drawn on top of everything. How do you prevent this? Sorry if I am missing something obvious.
    There isnt an 'obvious' solution to this, but there is a trick that screensavers use that would work. For you black rectangle, give the element a name starting with "screensaver" and it'll not add the date/time or now-playing on top.

    Maybe something like this:
    Code:
    private UiElement blackUiElement;
    
    in init function:
                Bitmap black = new Bitmap(32,32);
                Graphics g = Graphics.FromImage(black);
                g.Clear(Color.Black);
                g.Dispose();
                blackUiElement = new UiElement("screensaver-black", new RectangleF(0, 0, 100, 100), black);
    
    GetRenderList:
            public List<UiElement> GetRenderList()
            {
                List<UiElement> renderList = new List<UiElement>();
                renderList.Add(blackUiElement);
                ...other elements...
                return renderList;
            }

  3. #3
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    482
    Thanks - I followed your instructions but with an empty skin file the clock is still being displayed over the black rectangle for me?

  4. #4
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,309
    Unfirtunately my build is no longer compatible with 2.1, so I'm not well placed to give you a patch with more logging, but can you add something like this to the end of your GetRenderList() and post the snippet of log:

    Code:
    Logger.Debug("render list contains");
    foreach (UiElement element in popupRenderList)
    {
       Logger.Debug(" - " + element.name);
    }

  5. #5
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    482
    Here is the log:

    Code:
    2011-08-17 16:01:41.224	[DEBUG][1]	ACTIVATE_PLUGIN: SS
    2011-08-17 16:01:41.229	[DEBUG][1]	OnKeyDown() done. Took 11.000599861145 ms
    2011-08-17 16:01:41.481	[DEBUG][1]	FadeThroughTransitionHelper.GetRenderList() transition complete
    2011-08-17 16:01:41.481	[DEBUG][1]	render list contains
    2011-08-17 16:01:41.481	[DEBUG][1]	 - screensaver-black
    2011-08-17 16:01:45.427	[DEBUG][1]	render list contains
    2011-08-17 16:01:45.427	[DEBUG][1]	 - screensaver-black
    2011-08-17 16:01:45.428	[DEBUG][1]	storing Position (1):220,26
    2011-08-17 16:01:45.428	[DEBUG][1]	storing Size (1):1400,902
    2011-08-17 16:01:45.446	[INFO][1]	Exiting...
    2011-08-17 16:01:45.446	[INFO][1]	Done.

  6. #6
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,309
    I worked out why this didnt work. I forgot the screen savers work as popups rather than screens. I've adjusted to the logic for the next release to also work in your situation. Instead of "screensaver" though, it'll use a "block-extras" element name to tell it to not add the background or datetime.

    Unfortunately its bad timing in the release cycle, and I'm not able to give you a patch for this at the moment, so you might need to use your imagination an just pretend the default background and clock aren't there until the next release is available. It should be available in the next week or two.

  7. #7
    Join Date
    Jun 2007
    Location
    Scotland
    Posts
    2,382
    Quote Originally Posted by sub View Post
    I've adjusted to the logic for the next release to also work in your situation. Instead of "screensaver" though, it'll use a "block-extras" element name to tell it to not add the background or datetime.
    Will that suppress the nowPlaying info too?

  8. #8
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,309
    Yes. It wont suppress the ShowMessage overlay though.

  9. #9
    Join Date
    Jun 2007
    Location
    Scotland
    Posts
    2,382
    Quote Originally Posted by sub View Post
    Yes. It wont suppress the ShowMessage overlay though.
    Great...

  10. #10
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    482
    Quote Originally Posted by sub View Post
    Unfortunately its bad timing in the release cycle, and I'm not able to give you a patch for this at the moment, so you might need to use your imagination an just pretend the default background and clock aren't there until the next release is available.
    No problem - thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •