1

我创建了两个架子按钮和图标,但在我发布的图片附件中,您可以看到黄色图标似乎工作正常,但至于蓝色图标,它粘在其左上角'空间'

我为黄色图标创建的初始尺寸是 32 x 32 像素,而蓝色图标是 20 x 20 像素

两个货架属性几乎相同,但我无法让蓝色图标大小匹配或位于中心。

因此,有没有其他方法可以调整它的大小,让它像黄色一样具有合理的大小,而无需创建另一个 32 x 32 像素的新图像?

// -------- 32 x 32 pixels --------
shelfButton
    -enableCommandRepeat 0
    -enable 1
    -width 34
    -height 34
    -manage 1
    -visible 1
    -label "Yellow Icon"
    -image "icon_yellow.png"
    -style "iconOnly"
    ;

// -------- 20 x 20 pixels --------
shelfButton
    -enableCommandRepeat 0
    -enable 1
    -width 34
    -height 34
    -manage 1
    -visible 1
    -label "Blue Icon"
    -image1 "icon_blue.png"
    -style "iconOnly"
;
4

1 回答 1

2

您需要删除 -label 标志并添加 -scaleIcon 和 iconAndTextHorizo​​ntal 样式。在 2016 版本上测试。

// -------- 20 x 20 pixels --------
shelfButton
    -enableCommandRepeat 0
    -enable 1
    -width 34
    -height 34
    -manage 1
    -visible 1
    -image1 "icon_blue.png"
    -scaleIcon // scale
    -style "iconAndTextHorizontal"// need for scale
;

http://i.gyazo.com/ff5b398b3ea5de3b11e404565059e4b8.png

于 2015-05-05T16:15:42.307 回答