[Approved] - Fixed vertical and horizontal scrollbars

Discussion in 'Archive' started by pilehave, February 1, 2011.

  1. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
    As mentioned in https://forum.team-mediaportal.com/...-proper-horizontal-scrollbar-filmstrip-92861/ I have now also fixed the vertical scrollbar.

    There were several fixes:


    • scrollbars now scales to screen resolution
    • when selecteditem was the first one, the percentage was not always zero, but sometimes an obscure value like 0.019281 (really close to zero, but not quite).
    • there was a mismatch between the itemcount of the list and the max percentage, which meant that 100% could never be reached. It would always be missing the percentage of the last listitem.



     

    Attached Files:

  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. SilentException
    • Premium Supporter

    SilentException Retired Team Member

    Joined:
    October 27, 2008
    Messages:
    2,617
    Likes Received:
    1,125
    Gender:
    Male
    Location:
    Rijeka, Croatia
    Ratings:
    +1,129 / 0
    Home Country:
    Croatia Croatia
    Patch was missing a line fix in GUIPlayListItemListControl.cs (RenderScrollbar(timePassed, dwPosX) -> RenderScrollbar(timePassed)) and you had some comments left. I fixed that.

    Some things I'm wondering tho:

    Vertical Scrollbar:

    Code (Text):
    1.       _imageBackground.Height = iHeight;
    2.       _imageBackground.Render(timePassed);
    3.  
    4.       float fPercent = (float)_percentage;
    5.       float fPosYOff = (fPercent / 100.0f);
    6.  
    7.       // Scale handle-parts for resolution
    8.  
    9.       int backgroundWidth = _imageBackground.TextureWidth;
    10.       GUIGraphicsContext.ScaleVertical(ref backgroundWidth);
    11.       _imageBackground.Width = backgroundWidth;
    Isn't it more logical to set width and stuff first, then do render on _imageBackground?


    Same thing is in Horizontal Scrollbar, you don't even do ScaleVertical there.
     
  4. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
    Ah, must have missed that one, sorry :(

    I'm sure it will be just fine to put the render part in after resizing the handle (knob). If it makes the code easier to read, we should do that.

    About the ScaleVertical, I'm not sure what you mean, but I do scale the handle-parts:

    Code (Text):
    1.  
    2.       // Scale handle-parts for resolution. Background is already scaled in parent control
    3.       int handleHeight = _imageLeft.TextureHeight;
    4.       GUIGraphicsContext.ScaleVertical(ref handleHeight);
    5.       _imageLeft.Height = handleHeight;
    6.       _imageRight.Height = handleHeight;
    7.  
    8.       int handleWidth = _imageLeft.TextureWidth;
    9.       GUIGraphicsContext.ScaleVertical(ref handleWidth);
    10.       _imageLeft.Width = handleWidth;
    11.       _imageRight.Width = handleWidth;
    12.  
    The background is already scaled by the buddy-control
     
  5. elliottmc
    • Premium Supporter

    elliottmc Retired Team Member

    Joined:
    August 7, 2005
    Messages:
    14,927
    Likes Received:
    4,011
    Gender:
    Male
    Location:
    Cardiff, UK
    Ratings:
    +5,503 / 13
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Hi,

    I see this is now in mantis, but the patch is not submitted.

    I was wondering where we are with this. Are we waiting for an updated patch from pilehave?

    Thanks,

    Mark
     
  6. pilehave
    • Premium Supporter

    pilehave Community Skin Designer

    Joined:
    April 2, 2008
    Messages:
    2,566
    Likes Received:
    500
    Gender:
    Male
    Occupation:
    Technical consultant, marketing
    Location:
    Hornslet
    Ratings:
    +517 / 0
    Home Country:
    Denmark Denmark
    If you are waiting for me, I have attached a reworked patch which includes the change to GUIPlayListItemListControl.cs that SilentException noted here:
    https://forum.team-mediaportal.com/...tical-horizontal-scrollbars-93059/#post715627

    Code (Text):
    1.  
    2. -      RenderScrollbar(timePassed, dwPosY);
    3. +      RenderScrollbar(timePassed);
    4.  
    and where I have moved the rendering of the scrollbar-background to after all the size-calculation and resizing is done. Improves readability a bit.

    :D
     

    Attached Files:

    • Like Like x 1
  7. SilentException
    • Premium Supporter

    SilentException Retired Team Member

    Joined:
    October 27, 2008
    Messages:
    2,617
    Likes Received:
    1,125
    Gender:
    Male
    Location:
    Rijeka, Croatia
    Ratings:
    +1,129 / 0
    Home Country:
    Croatia Croatia
    Hi, I wasn't waiting for anyone but myself to get some free time :) These days I really have full schedule but I'll try to get something done tonight :)
     
    • Like Like x 1
  8. SilentException
    • Premium Supporter

    SilentException Retired Team Member

    Joined:
    October 27, 2008
    Messages:
    2,617
    Likes Received:
    1,125
    Gender:
    Male
    Location:
    Rijeka, Croatia
    Ratings:
    +1,129 / 0
    Home Country:
    Croatia Croatia
    r27576, thanks and sorry for the delay! :)
     
    • Like Like x 3
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!