[Approved] GUIListControl, popup first letter when scrolling (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    The purpose of this patch is already described in https://forum.team-mediaportal.com/...re-48/new-idea-scrolling-borrowed-xbmc-87938/ so I'll add the description from this thread.

    The attached patch is a bit simpler than the original ones were.

    Purpose:
    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:

    scroller2.jpg

    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

    Solution:
    Patch GUIListControl.cs to output the firstcharacter of #selecteditem as #selecteditem.firstchar and the properties of #scrolling.up and/or #scrolling.down to values "yes" or "no"


    The result of my patch is shown in the screenshots with Blue3Wide and Maya, and in my video on YouTube (with Maya as skin).

    Video on YouTube

    To get this working with Blue3Wide:
    1. Apply patch (duh) and compile MediaPortal

    2. Copy the attached PNG listscroller_bg.png to the "Media" folder of Blue3Wide

    3. Copy this code into the screens where you want the listscroller to show up. In these examples I have used mymusicsongs.xml and myvideo.xml. To see the control in use, you must use the "Shares" view of MyMusic or just MyVideos and select "List":

    Code:
    	<control>
            <description>listscroller bg</description>
            <type>image</type>
            <id>1</id>
            <posX>486</posX>
            <posY>620</posY>
            <width>69</width>
            <height>104</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="250" time="150" reversible="true">visiblechange</animation>
        </control>
        
        <control>
            <type>label</type>
            <id>1</id>
            <posX>482</posX>
            <posY>620</posY>
            <width>78</width>
            <height>90</height>
            <label>#selecteditem.firstchar</label>
            <textcolor>6aa5cb</textcolor>
            <visible>facadeview.list+string.contains(#scrolling.up,yes)|string.contains(#scrolling.down,yes)</visible>
            <animation effect="slide" start="0,50" end="0,0" delay="250" time="150" reversible="true">visiblechange</animation>
            <align>center</align>
            <valign>middle</valign>
        </control>

    Hope you all support my idea :)
     

    Attachments

    • listscroller_bg.png
      listscroller_bg.png
      1.8 KB
    • Patch to allow popup of first letter SVN 26565.patch
      2.2 KB

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    Could you please also attach the fully skin files? Makes it much easier to test than having to search for the controls in the xml files...

    Awesome patch btw :)

    :D
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #5
    Could you please also attach the fully skin files? Makes it much easier to test than having to search for the controls in the xml files...

    Awesome patch btw :)

    :D

    I have attached files for music and videos for testing purposes :)
     

    Attachments

    • mymusicsongs.xml
      13.9 KB
    • myvideo.xml
      12.3 KB

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: GUIListControl, popup first letter when scrolling

    +1 vote for this patch
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,863
    10,992
    Königstein (Taunus)
    Home Country
    Germany Germany
    AW: GUIListControl, popup first letter when scrolling

    Nice gimmick, we should integrate it after 1.2.0 Alpha ;)
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Not at a machine where I can look at this but a couple of questions.


    1. Is this configurable so could be turned off if wanted?
    2. What happens if view is not sorted alphabetically?
    3. What happens if view is not textual (eg a list of years in music)
    4. Does this check for the control being null (ie. not implemented in skin?)
    Thanks
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    40
    Austria
    Home Country
    Austria Austria
    Tested it and it's working very well but jameson_uk had a few pretty good points:

    Not at a machine where I can look at this but a couple of questions.


    1. Is this configurable so could be turned off if wanted?
    2. What happens if view is not sorted alphabetically?
    3. What happens if view is not textual (eg a list of years in music)
    4. Does this check for the control being null (ie. not implemented in skin?)
    Thanks

    1) Depends on the skin, in the current patch there is no config option (do we need one?).
    2) It becomes pretty useless (@pilehave: can you disable it when sorted other then alphabetically?)
    3) It will display the first character.
    4) the patch doesn't introduce a new control, just skin properties (#scrolling.up, #scrolling.down, #selecteditem.firstchar)

    This is an addition of a really neat feature that xmbc already has, so we should definately include this for 1.2 beta...

    :D
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    • Thread starter
    • Moderator
    • #10
    Tested it and it's working very well but jameson_uk had a few pretty good points:

    1) Depends on the skin, in the current patch there is no config option (do we need one?).
    2) It becomes pretty useless (@pilehave: can you disable it when sorted other then alphabetically?)
    3) It will display the first character.
    4) the patch doesn't introduce a new control, just skin properties (#scrolling.up, #scrolling.down, #selecteditem.firstchar)

    This is an addition of a really neat feature that xmbc already has, so we should definately include this for 1.2 beta...

    :D

    As far as I can tell it should be possible to expose the sortmethod in this function from GUIListControl.cs:

    Code:
        public void Sort(IComparer<GUIListItem> comparer)
        {
          try
          {
            _listItems.Sort(comparer);
          }
          catch (Exception) { }
          _refresh = true;
        }

    There you can disable the scrollcode if it is not sorted by name (which is alphabetically). But I'm not sure of how it would be correct to do it :confused:
     

    Users who are viewing this thread

    Top Bottom