haxeui-core icon indicating copy to clipboard operation
haxeui-core copied to clipboard

Button - iconPosition center doesn't work

Open flashultra opened this issue 5 years ago • 11 comments

When set iconPosition = "center"; and have textAlign = "center"; on button , both ( text and icon ) are set on the left side of the button. ( using new-component-model , haxeui-openfl -> html5 )

flashultra avatar Feb 09 '19 18:02 flashultra

What is the effect you are looking for with center / center? The text being in the center of the button icon?

ianharrigan avatar Mar 30 '19 10:03 ianharrigan

No. Icon to be on the center and text to be after the icon or maybe icon + text with some offset to be at center. Here is example at the moment with:

  1. icon = left , text = center haxeui-center-left
  2. icon = center , text = center haxeui-center-center

So maybe center , center should look more like 1 ) ? Defiantly 2) looks wrong

flashultra avatar Mar 30 '19 18:03 flashultra

right, so i think left / center is the whole "thing" (icon and text) centered. Basically, the icon position is relative to the label position, so "right" means "right of the label", "top" means "top of the label", etc. I cant add some type of handling for center / center, but im not sure what it should look like... the text in the center of the icon and the whole thing centered in the button? I agree that #2 certainly doesnt look right - its just a question of what does for those params.

Ian

ianharrigan avatar Mar 30 '19 18:03 ianharrigan

I see - icon position is relative to label position . I just test left - left and looks ok i.e first show icon after that text . I think center should do the same - icon on the center and after that arrow ( as I mention above maybe same as left - center ? ) Here is left - left ( looks ok ) : haxeui-left-left

Here is right - right which looks more like right - center ( for text) haxeui-right-right

One more ( text - center , icon - right ) haxeui-center-right

flashultra avatar Mar 30 '19 18:03 flashultra

Yeah, you are right... makes sense... those two are not consistent.

ianharrigan avatar Mar 30 '19 18:03 ianharrigan

So for me : 1, left- left is ok 2. right - right - maybe icon and text should be at the right side of the button ? 3, center ( text ) - left ( icon ) - ok 4, center ( text ) - right (icon ) - ok 5, center - center - wrong

flashultra avatar Mar 30 '19 18:03 flashultra

Cool - ill have a look at them, work out all the variants and see what looks off... but yeah, the fact they are inconsistent means something should be done about it

ianharrigan avatar Mar 30 '19 18:03 ianharrigan

I forgot about variant when icon is center , so

  1. text = left, icon = center haxeui-left-center
  2. text = right, icon = center haxeui-right-center

Both doesn't looks right too

flashultra avatar Mar 30 '19 18:03 flashultra

I guess the best test app for this is:

    <grid columns="6">
        <label />
        <label text="left" horizontalAlign="center" />
        <label text="center" horizontalAlign="center" />
        <label text="right" horizontalAlign="center" />
        <label text="top" horizontalAlign="center" />
        <label text="bottom" horizontalAlign="center" />
        
        <label text="left" verticalAlign="center" />
        <button text="Text" width="100" height="100" iconPosition="left" textAlign="left" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="right" textAlign="left" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="center" textAlign="left" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="top" textAlign="left" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="bottom" textAlign="left" icon="haxeui-core/styles/default/haxeui_small.png" />
        
        <label text="center" verticalAlign="center" />
        <button text="Text" width="100" height="100" iconPosition="left" textAlign="center" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="right" textAlign="center" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="center" textAlign="center" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="top" textAlign="center" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="bottom" textAlign="center" icon="haxeui-core/styles/default/haxeui_small.png" />
        
        <label text="right" verticalAlign="center" />
        <button text="Text" width="100" height="100" iconPosition="left" textAlign="right" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="right" textAlign="right" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="center" textAlign="right" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="top" textAlign="right" icon="haxeui-core/styles/default/haxeui_small.png" />
        <button text="Text" width="100" height="100" iconPosition="bottom" textAlign="right" icon="haxeui-core/styles/default/haxeui_small.png" />
    </grid>

certainly inconsistencies:

image

ianharrigan avatar Mar 30 '19 19:03 ianharrigan

Are you sure about center - center ? It's different from my test. On your test you have : left, right , center , top , bottom , but you name it wrong - left, center, right, top , bottom

flashultra avatar Mar 30 '19 19:03 flashultra

Yes, the top labeling should read left, right, center, top, bottom. I can confirm that the issues with iconPosition center still exist.

intoxopox avatar Dec 12 '19 20:12 intoxopox