You found a bug! We've classified it as EXTGWT-2119 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2010
    Posts
    128
    Vote Rating
    2
    audra is on a distinguished road

      0  

    Default slider horizontal appearance issue

    slider horizontal appearance issue


    Hi,

    There is a variable for the int halfThumb in Slider.css, but it seems to be hardcoded in the render() and setThumbPosition() methods in the horizontalsliderbaseappearance....

    I overrode the methods in my appearance but it would be nice if these methods just referenced the int defined in the css...

    Code:
      @Override  public void render(double fractionalValue, int width, int height, SafeHtmlBuilder sb) {
        if (width == -1) {
          // default
          width = 200;
        }
        
        // padding
        width -= 7;
        
        int offset = (int) (fractionalValue * (width - 21)) - 7;
        
        offset = Math.max(-7, offset);
        
        SafeStyles offsetStyles = SafeStylesUtils.fromTrustedString("left:" + offset + "px;");
        SafeStyles widthStyle = SafeStylesUtils.fromTrustedString("");
    
    
        widthStyle = SafeStylesUtils.fromTrustedString("width: " + width + "px;");
        sb.append(template.template(resources.style(), widthStyle, offsetStyles));
      }
    
    
      @Override
      public void setThumbPosition(Element parent, int pos) {
        XElement thumbElement = XElement.as(getThumb(parent));
        pos = Math.max(-7, pos);
        thumbElement.getStyle().setLeft(pos, Unit.PX);
      }

  2. #2
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402
    Vote Rating
    2
    WesleyMoy is on a distinguished road

      0  

    Default


    Thanks for pointing this out. This is something that makes a lot of sense to take another look at. I've filed a review ticket against the team and will update here with any changes that we make.

Thread Participants: 1