Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog footer and title width #456

Open
hoseyjoe opened this issue Jun 5, 2022 · 10 comments
Open

Dialog footer and title width #456

hoseyjoe opened this issue Jun 5, 2022 · 10 comments

Comments

@hoseyjoe
Copy link
Contributor

hoseyjoe commented Jun 5, 2022

The Dialog base is

 public override function validateComponentLayout():Bool {
        var b = super.validateComponentLayout();
        dialogTitle.width = this.layout.innerWidth;
        if (_autoSizeDialog == false) {
            var offset = this.layout.paddingLeft + this.layout.paddingRight;
            if (dialogContent.width != this.width - offset) {
                dialogContent.width = this.width - offset;
            }
            if (dialogFooterContainer.width != this.width - offset) {
                dialogFooterContainer.width = this.width - offset;
            }
        }
        
        return b;
    }

This will display dialog with bottom right buttons covering the border like
image

Adjusting validateComponentLayout to

public override function validateComponentLayout():Bool {
        var b = super.validateComponentLayout();
        dialogTitle.width = this.layout.innerWidth;
        if (_autoSizeDialog == false) {
            var offset = this.layout.paddingLeft + this.layout.paddingRight;
            **dialogTitle.width = this.layout.innerWidth - offset;**
            if (dialogContent.width != this.width - offset) {
                dialogContent.width = this.width - offset;
            }
            if (dialogFooterContainer.width != **this.layout.innerWidth** - offset) {
                dialogFooterContainer.width = **this.layout.innerWidth** - offset;
            }
        }
        
        return b;
    }

I put ** around changes.
It Fixes the issue
image

I dont think that is the right fix? Let me know if you need a sample project. Kinda between things so I dont have time while I maing ticket

@ianharrigan
Copy link
Member

The buttons/title here look tiny, is that intentional?

@hoseyjoe
Copy link
Contributor Author

It was default, I thought. I'll check. Maybe that is causing the issue

@ianharrigan
Copy link
Member

Certainly looks like padding (or something) is massively smaller, that said, i dont think it should behave the way it does anyway - do you have the test app to play with?

@hoseyjoe
Copy link
Contributor Author

In truth I forgot where this came from. I'm digging and will make test app

@hoseyjoe
Copy link
Contributor Author

hoseyjoe commented Jun 17, 2022

So I found the problem???

There is a table with custom itemrenderer called MyMenuItem and has a MyMenuItem.xml. In it is

<style>
        .titleWPad{
            padding-left:10px;
        }
        MyMenuItem{
            padding:1px;
        }        
    </style>

The MyMenuItem renderer has a button that opens the dialog. Removing MyMenuItem from css and clicking the button results in:
image

Im not sure how MyMenuItem css is screwing up the dialog but removing it fixes it

@ianharrigan
Copy link
Member

Interesting, i thought i removed "node matching" - though im not sure i did, but if i did (or didnt) its doing something... its almost like its matching everything

@ianharrigan
Copy link
Member

its defo matching everything: http://haxeui.org/builder/?oopviy

That is totally wrong - nice find!

@ianharrigan
Copy link
Member

OK, so the "node based css matching everything" bug is gone - in fact, ive reintroduced node based css matching, and improved the performance (which is why i removed it in the first place). However, i still think this issue should be left open as the dialog should still look right, even if you remove all the padding.

@hoseyjoe
Copy link
Contributor Author

This is working as expected. Close on your dime

@ianharrigan
Copy link
Member

Yeah, im going to leave this open as the dialog looking weird when padding=0 is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants