selectedColor not in effect (1 Viewer)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Denmark Denmark
    • Thread starter
    • Moderator
    • #1
    MediaPortal Version: 1.1.0 final
    MediaPortal Skin: Maya
    Windows Version: Windows 7 x64
    CPU Type: AMD Athlon II x2 240e 2.8 GHz 45w TDP
    HDD: OCZ Agility SSD 30 GB
    Memory: 4 GB DDR2 800 MHz Dual-Channel
    Motherboard: Gigabyte GA-MA78GM-S2H (rev 1.0)
    Video Card: Onboard AMD Radeon HD 3200
    Video Card Driver: Catalyst 10.3
    Sound Card: Onboard ALC889A
    Sound Card AC3: optical out
    Sound Card Driver:
    1. TV Card: Terratec Cinergy 2400i DT PCI
    1. TV Card Type: DVB-T
    1. TV Card Driver:
    2. TV Card:
    2. TV Card Type:
    2. TV Card Driver:
    3. TV Card:
    3. TV Card Type:
    3. TV Card Driver:
    4. TV Card:
    4. TV Card Type:
    4. TV Card Driver:
    MPEG2 Video Codec: PowerDVD9
    MPEG2 Audio Codec:
    h.264 Video Codec: DivX HD
    Satelite/CableTV Provider:
    HTPC Case:
    Cooling:
    Power Supply: picuPSU 120W
    Remote: Logitech 885
    TV: LG 42PM1MA
    TV - HTPC Connection: HDMI

    According to MediaPortal1_Development/SkinArchitecture/listcontrol - MediaPortal Manual Documentation

    Code:
    <selectedColor>red</selectedColor>
    should enable you to change the colour of the selected item in a list.

    Editing references.xml with the following attributes does, however, not work properly:

    <selectedColor>red</selectedColor>
    <playedColor>yellow</playedColor>
    <textcolor>blue</textcolor>
    <textcolor2>pink</textcolor2>
    <textcolor3>black</textcolor3>
    <colordiffuse>maroon</colordiffuse>
    <remoteColor>amber</remoteColor>
    <downloadColor>green</downloadColor>

    The MP skin-engine does understand generic colours. But it looks like they are not in effect for the selected item.

    This problem has been there as long back I can remember.

    If you do not believe there is a problem, I challenge you to create a listview where the selected colour is red and other items are blue. ;)
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,697
    7,081
    Sydney
    Australia Australia
    Country flag
    Isn't selected color handled in code. Last I checked it's used to identify the currentselected item. In a menu this would be the current choice, in a Playlist this would be thecurrent playing item.

    This works for me as expected just not that obvious from name.
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Denmark Denmark
    • Thread starter
    • Moderator
    • #4
    I'm not sure what you mean be "handled in code" but what I am looking for, is a way to colour all text of the listitems in blue, and the one item that has focus, in red. As far as I can tell, this isn't possible. Surely this would be one of the most basic things of a list to do, just like you can change the texture of the focused item and the non-focused item.

    In the ideal world I would like to be able to change the focused font and non-focused font, but that's another story. :)
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,697
    7,081
    Sydney
    Australia Australia
    Country flag
    What I mean is that a plugin needs to set item.selected property for the skin to react to the <selectedColor> skin property.

    Here is an example of how Selected Color is used.
     

    Attachments

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    36
    Austria
    Austria Austria
    I had a look at this and here's your problem

    GUIListControl ln582
    Code:
          if (buttonNr == _cursorX && IsFocused && _listType == ListType.CONTROL_LIST)
          {
            bSelected = true;
          }
    checks if the item in the list is selected, but when setting the color

    Code:
            if (pItem.Selected)
            {
              dwColor = _selectedColor2;
            }
    is used, which is always false (As ltfarme suggested, this would have to be set in code). That's the problem, so I thought: "easy fix" and changed it to

    Code:
          if (buttonNr == _cursorX && IsFocused && _listType == ListType.CONTROL_LIST)
          {
            bSelected = true;
          }
          pItem.Selected = bSelected;
    which results in the selected labels not being drawn at all... :confused::confused:

    25112010_114357.png

    Since I couldn't pinpoint the reason for this, I'll let someone else with more experience handle this, but it should be on mantis at least imo.
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Croatia Croatia
    Country flag
    Previous observations are correct.

    - listcontrol holds a list of GUIListItem objects
    - those objects have Selected property which can be set to true/false FROM THE CODE (plugin). This property has nothing to do with selection in GUI.
    - <selecteditem> color is used only for GUIListItem's that have Selected property set to true

    Facts are, this is working as intended, and there is no skin property skinners can use for requested functionality.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    United Kingdom United Kingdom
    Country flag
    So is a bug that it is not set in our plugins?
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Croatia Croatia
    Country flag
    Not exactly. You don't want to be setting Selected property every time item is selected. If this was the purpose of the property it would work automatically in that way.

    I suppose the original usage for this property was that you can select - mark multiple items in the list (for example before deletion). There are other usages as well.

    But there is no skin property to color the GUI selected item.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    Top Bottom