Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Issue with the Usage of "SVG Spriting", Likely a Bug

    Hello,
    I am using SmartGWT 13.1 with GWT 2.12.1 and encountering an issue with the "SVG Spriting" feature: When I create a button and set its icon to "sprite:svg:[SKIN]/stockIcons.svg#delete", upon initial display, I notice that the icon fails to render correctly due to a missing "/images" path layer in the URL. However, when hovering over the button with the mouse, it seems the path gets completed and the icon displays normally. If I manually set the path to "[SKIN]/images/stockIcons.svg#delete", the icon displays correctly initially, but upon hovering, an extra "images" path layer is added, resulting in "/images/images", which prevents the icon from displaying correctly.

    this my code:

    IButton deleteButton = new IButton("删除");
    deleteButton.setIcon("sprite:svg:[SKIN]/stockIcons.svg#delete");
    deleteButton.setHeight(26);
    deleteButton.setWidth(100);



    #2
    Thanks for the report, we'll take a look - in the meantime, you can use [SKINIMG] instead of [SKIN] and that should address the issue.

    Comment


      #3
      Yes, following the method you provided, the issue has been resolved . Thank you very much.

      Here is my current code.

      IButton deleteButton = new IButton("删除");
      deleteButton.setIcon("sprite:svg:[SKINIMG]stockIcons.svg#delete");
      deleteButton.setHeight(26);
      deleteButton.setWidth(100);

      Comment


        #4
        Out of interest, the icon you're using is a builtin icon that ships with the framework - we call these StockIcons and you can use them by name, without knowing the URL or using it in your code. Different skins might apply a different image to this StockIcon name, so it may look different in each skin. In this case, the icon you're using is called "Header_Trash"

        Code:
        deleteButton.setIcon("Header_Trash");
        You can read about StockIcons in the 13.1 docs if you want more information.
        Last edited by Isomorphic; 16 Nov 2024, 21:32.

        Comment


          #5
          Note that the underlying bug that prevented the [SKIN] path-shortcut from being properly expanded in you test-case has been fixed. Please retest with a build dated November 21 or later.

          Comment

          Working...
          X