@@ -292,29 +292,22 @@ on generatePalette
292292 set the id of it to revIDENewIconID()
293293 end if
294294
295- local tImageID
295+ local tImageID , tFilename
296296 if sViewsData [tView ][tControlTypeID ]["icon" ] is not empty then
297- set the name of the templateimage to tControlTypeID & ".icon.png"
298- set the visible of the templateimage to false
299- set the filename of the templateimage to sViewsData [tView ][tControlTypeID ]["icon" ]
300- create image in group "images" of group "contents"
301- set the id of it to revIDENewIconID()
302- put the long id of image (tControlTypeID & ".icon.png" ) of group "images" of group "contents" into tImageID
303- revIDEResizeImageInBounds tImageID , BLOCK_SIZE * 2 ,BLOCK_SIZE
304- set the icon of the templatebutton to the ID of tImageID
297+ put sViewsData [tView ][tControlTypeID ]["icon" ] into tFilename
305298 else if there is a file (tThemePath & slash & tControlTypeID & ".icon.png" ) then
306- # If we can find an icon file in the theme, create it
307- set the name of the templateimage to tControlTypeID & ".icon.png"
308- set the visible of the templateimage to false
309- set the filename of the templateimage to tThemePath & slash & tControlTypeID & ".icon.png"
310- create image in group "images" of group "contents"
311- set the id of it to revIDENewIconID()
312- put the long id of image (tControlTypeID & ".icon.png" ) of group "images" of group "contents" into tImageID
313- revIDEResizeImageInBounds tImageID , BLOCK_SIZE * 2 ,BLOCK_SIZE
314- set the icon of the templatebutton to the ID of tImageID
315- else
316- set the icon of the templatebutton to empty
299+ put tThemePath & slash & tControlTypeID & ".icon.png" into tFilename
300+ else
301+ put revIDEDefaultExtensionIcon("widget" ) into tFilename
317302 end if
303+ set the name of the templateimage to tControlTypeID & ".icon.png"
304+ set the visible of the templateimage to false
305+ set the filename of the templateimage to tFilename
306+ create image in group "images" of group "contents"
307+ set the id of it to revIDENewIconID()
308+ put the long id of image (tControlTypeID & ".icon.png" ) of group "images" of group "contents" into tImageID
309+ revIDEResizeImageInBounds tImageID , BLOCK_SIZE * 2 ,BLOCK_SIZE
310+ set the icon of the templatebutton to the ID of tImageID
318311
319312 # If the object is a tool, set the key custom properties to make it behave like a tool
320313 local tToolType
@@ -356,6 +349,7 @@ on generatePalette
356349
357350 if sViewsData [tView ][tControlTypeID ]["svgicon" ] is empty then
358351 create button tControlTypeID in group tView of group "contents"
352+ set the cType of button tControlTypeID to tView
359353 else
360354 create widget tControlTypeID as "com.livecode.widget.svgpath" in group tView of group "contents"
361355 set the width of widget tControlTypeID to BLOCK_SIZE * 2
0 commit comments