barmalei / zebkit

JavaScript library that follows easy OOP concept, provides HTML5 Canvas based Rich UI and includes Java to JavaScript converter tool
Apache License 2.0
931 stars 177 forks source link

Issue in Combo #145

Closed Gumphrie closed 6 years ago

Gumphrie commented 6 years ago

Noticed a bug in the latest version of ui.Combo that wasn't there before. If I set a custom width/height with setPreferredSize, the arrow button's height gets stretched out along with the text box (assuming you are setting a higher height than the default).

Have to use this workaround to enforce the original height (24px) of the arrow button -

var combo = new Combo(list);
combo.setPreferredSize(width, height);
// fix arrow button height
combo.kids[1].extend([
    function setSize(w, h)
    {
        this.$super(w, 24);
    },
    function setLocation(x, y)
    {
        this.$super(x, ((height-24)/2)+1);
    }
]);
barmalei commented 6 years ago

Will fix it soon with new "ArrowButton" implementation.

barmalei commented 6 years ago

Just have committed fix.