Hybrid View

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    robotnic is on a distinguished road

      0  

    Default Unanswered: Window grows on each show() when setting padding to body/top

    Unanswered: Window grows on each show() when setting padding to body/top


    Hello,

    I'm using Window with my own custom style via <replace-with..> replacing: ContentPanelAppearance, WindowAppearance, FramedPanelAppearance
    I've added: "padding: 8px" for the body and top elements.

    The problem is that when I hide the window and then show it, it grows in height and width. If I remove the padding the size remains the same.

    Have no idea how to debug this.
    Thanks.

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    robotnic is on a distinguished road

      0  

    Default Happens in MessageBox with default Appearance as well

    Happens in MessageBox with default Appearance as well


    Ok, here's a simple example of this problem with AlertMessageBox:

    Code:
    AlertMessageBox messageBox = new AlertMessageBox("Title", "Content");
    messageBox.setBodyStyle("margin: 8px;");
    
    // show several times, without creating a new MessageBox
    messageBox.show();
    The message box grows between consequent calls to show().
    It doesn't happen when setting padding style.

    Can you suggest me a workaround for this?
    Couldn't find anything.

    Thanks!

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    robotnic is on a distinguished road

      0  

    Default MessageBox grows when setting margin

    MessageBox grows when setting margin


    Hello,

    This is my simple test to open a message box several times (without creating a new one):
    Code:
    final AlertMessageBox messageBox = new AlertMessageBox("title", "content");
    messageBox.setBodyStyle("margin: 20px;");
    
    Button butt on2 = new Button("Click me too!");
    button2.addClickHandler(new ClickHandler() {
          @Override
           public void onClick(ClickEvent clickEvent) {
                   messageBox.show();
           }
    });
    The message box just keeps growing (in height).
    I've asked about it, thinking at first that it's something to do with my custom window style.

    I'd appreciate help solving this/a workaround.
    Thanks!

  4. #4
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402
    Vote Rating
    2
    WesleyMoy is on a distinguished road

      0  

    Default


    There is an interaction occurring between the logic that sizes the message box and the margin that you've set. Without stepping through the code in too much detail, it seems that the result of the calculation for the size to be given to the content area is adjusted by 20 px to accomodate for the margin when the frame is drawn. This, in turn, causes the message box to size the content area up by 20 px each time it is shown.

    However, the underlying reason this fails is that assigning a margin to the content area is basically nonsensical. You don't want a gap of nothingness between the content area and the frame. The frame should wrap the content area. You'll likely get better results if you assign a 20 px padding to the content area instead, as the padding will be part of the content area itself.

    Try swapping out your margin for padding and testing. A quick run in development mode in Firefox 11 seems to work fine.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    4
    Vote Rating
    0
    robotnic is on a distinguished road

      0  

    Default


    Hello,

    Well, you see, setting margin:20 px is not really what I'm doing. I do add margin, and padding -- it's part of a design I need to achieve.
    I need the dialog to have a lighter section around the body and the title. It looks great the first time I open it.
    For now, I'm creating all my windows/dialogs every time I need to show them.

    Can you point me to where should I look for/debug?

    Thanks

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi