New idea for scrolling (borrowed from XBMC) (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    Hi!

    I have crafted a small mod for MediaPortal to allow this:

    Show the first letter of #selectedindex as an independent label when scrolling. The label is only shown when you hold the up or down key down:

    scroller.jpg

    This is a common feature in XBMC, where they use a property called "Container.Scrolling" that indicates if the user is scrolling. If you have tried XBMC and used the built-in skin Confluence you will know this:

    xbmc.jpg

    The code in the skin for this new feature is this:

    Code:
        <control>
            <description>listscroller bg</description>
            <type>image</type>
            <id>1</id>
            <posX>600</posX>
            <posY>678</posY>
            <width>78</width>
            <height>90</height>
            <texture>listscroller_bg.png</texture>
            <visible>facadeview.list+string.contains(#scrolling.up,yes)|string.contains(#scrolling.down,yes)</visible>
            <animation effect="slide" start="0,50" end="0,0" time="200">visible</animation>
        </control>
        
        <control>
            <type>label</type>
            <id>1</id>
            <posX>600</posX>
            <posY>680</posY>
            <width>78</width>
            <height>90</height>
            <label>#selecteditem.firstchar</label>
            <textcolor>6aa5cb</textcolor>
            <font>Segoe Light20</font>
            <visible>facadeview.list+string.contains(#scrolling.up,yes)|string.contains(#scrolling.down,yes)</visible>
            <animation effect="slide" start="0,50" end="0,0" time="200">visible</animation>
            <align>center</align>
            <valign>middle</valign>
        </control>

    The result of my mod is shown in the screenshot with Maya, and my video on YouTube. Now, my changes were put directly in the GUIListControl.cs and they are probably not the most elegant way (using a timer for hiding the label again when user stops scrolling). But it seems simple to me, just as a proof of concept.

    I would love to see a more general change to MediaPortal, to expose to the skin when the user is scrolling.

    Video on YouTube

    Please let me know if you think this is a good idea, or you know a better way to do it ;)
     

    Attachments

    • my patch against SVN 26455.patch
      3.2 KB

    bodiroga

    Portal Pro
    January 1, 2008
    241
    46
    Home Country
    Spain Spain
    Great!!!! That XBMC feature is really cool and useful when you have long lists to scroll through.

    Can't this be moven to "Submit: code patches" subforum?

    Thanks for your work Pilehave and best regards,

    Aitor
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #3
    Great!!!! That XBMC feature is really cool and useful when you have long lists to scroll through.

    Can't this be moven to "Submit: code patches" subforum?

    Thanks for your work Pilehave and best regards,

    Aitor

    I placed it here on purpose, because I don't feel it's a proper patch yet.

    It should be coded more...elegant. Right now the patch takes "#selecteditem" from the exposed skin-properties, this is better done in the code by taking the actual label instead. But maybe if someone with a little more MP coding experience takes it on...

    :D:D
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    Hi,

    this would be a great addition to MP, this is a really useful feature of XBMC...

    I tested your patch and it works fine.

    The result of my mod is shown in the screenshot with Maya, and my video on YouTube. Now, my changes were put directly in the GUIListControl.cs and they are probably not the most elegant way (using a timer for hiding the label again when user stops scrolling). But it seems simple to me, just as a proof of concept.

    Do you even need a timer for this, couldn't the same effect be done using skin animations?

    :D
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #6
    Do you even need a timer for this, couldn't the same effect be done using skin animations?

    :D

    I think so, because the animation is triggered by the user pressing the up/down key, and there is no way of calling a function when the key is released, as far as I can tell anyway...
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #7
    Right, new patch attached that doesn't use a timer to hide the skin property. Should be even simper to fine-tune.

    Is the "RenderLabel" function the right place to place a GUIPropertyManager.SetProperty call? The way I see it it's the only placed that is updated when selected item changes...

    The XML needs to have a delay on the animation, so it should look like this instead:

    Code:
        <control>
            <description>listscroller bg</description>
            <type>image</type>
            <id>1</id>
            <posX>600</posX>
            <posY>678</posY>
            <width>78</width>
            <height>90</height>
            <texture>listscroller_bg.png</texture>
            <visible>facadeview.list+string.contains(#scrolling.up,yes)|string.contains(#scrolling.down,yes)</visible>
            <animation effect="slide" start="0,50" end="0,0" delay="200" time="200">visible</animation>
        </control>
        
        <control>
            <animation effect="fade" time="100">WindowOpen</animation>
            <animation effect="fade" time="100">WindowClose</animation>
            <type>label</type>
            <id>1</id>
            <posX>600</posX>
            <posY>680</posY>
            <width>78</width>
            <height>90</height>
            <label>#selecteditem.firstchar</label>
            <textcolor>6aa5cb</textcolor>
            <font>Segoe Light20</font>
            <visible>facadeview.list+string.contains(#scrolling.up,yes)|string.contains(#scrolling.down,yes)</visible>
            <animation effect="slide" start="0,50" end="0,0" delay="200" time="200">visible</animation>
            <align>center</align>
            <valign>middle</valign>
        </control>

    Can't see that my changes have affected CPU or memory-usage.
     

    Attachments

    • new_patch_again_SVN_26455.patch
      2.5 KB

    Users who are viewing this thread

    Top Bottom