Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default Wrong calculation of scrollbars and margins

    Wrong calculation of scrollbars and margins


    Hello,

    i want to have a panel with a fixed width in a centerlayoutcontainer. And the centerlayoutcontainer should have scrollbars so, that the panel is always completely visible. Around the panel there should be 20px margins, so that there is a little space around the fixed panel. I can't get this work because the scrollbars aren't calculated correctly. Look at my example. If you change the height of the dialog so that the fixed panel is bigger than the dialog, the left side of the fixed panel ist gone and not visible anymore.
    Is this a bug? Can you give me an advise how i can get this work?

    I am using gwt 2.5.1 and gxt 3.0.6. The issue is reproduceable in every browser.

    Code:
            final Dialog dialog = new Dialog();
            dialog.setMaximizable(true);
    
            final BorderLayoutData eastData = new BorderLayoutData(170);
            eastData.setMargins(new Margins(0, 0, 0, 5));
            eastData.setCollapsible(true);
    
            final MarginData centerData = new MarginData();
    
            final BorderLayoutContainer blcContent = new BorderLayoutContainer();
            blcContent.setBorders(true);
    
            final VerticalLayoutContainer vlcCenter = new VerticalLayoutContainer();
            vlcCenter.setScrollMode(ScrollMode.AUTO);
    
            final CenterLayoutContainer clcCenter = new CenterLayoutContainer();
    
            final SimpleContainer con = new SimpleContainer();
            con.setPixelSize(1322, 762);
    
            final ContentPanel cpCenter = new ContentPanel();
            cpCenter.setHeadingHtml("Center");
            cpCenter.setPixelSize(1282, 722);
    
            con.add(cpCenter, new MarginData(20));
            clcCenter.add(con);
            vlcCenter.add(clcCenter, new VerticalLayoutData(1, 1));
    
            final ContentPanel cpEast = new ContentPanel();
            cpEast.setHeadingHtml("East");
    
            blcContent.setEastWidget(cpEast, eastData);
            blcContent.setCenterWidget(vlcCenter, centerData);
    
            dialog.add(blcContent);
            dialog.setPixelSize(Window.getClientWidth() - 100, Window.getClientHeight() - 100);
            dialog.show();
    
            Window.addResizeHandler(new ResizeHandler() {
                @Override
                public void onResize(ResizeEvent event) {
                    if (dialog.isMaximized()) {
                        dialog.setPixelSize(Window.getClientWidth(), Window.getClientHeight());
                    } else {
                        dialog.setPixelSize(Window.getClientWidth() - 100, Window.getClientHeight() - 100);
                    }
                }
            });

  2. #2
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default


    Any help or hint?

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    I haven't run this yet, but this code confuses me (so it probably really confuses gxt):

    Code:
            final CenterLayoutContainer clcCenter = new CenterLayoutContainer();
    
            final SimpleContainer con = new SimpleContainer();
            con.setPixelSize(1322, 762);
    
            final ContentPanel cpCenter = new ContentPanel();
            cpCenter.setHeadingHtml("Center");
            cpCenter.setPixelSize(1282, 722);
    
            con.add(cpCenter, new MarginData(20));
            clcCenter.add(con);
    Restated, this is:
    CenterLayoutContainer
    - SimpleContainer (1322 x 762)
    - - ContentPanel (1282 x 722) (margindata:20px)

    From that, the ContentPanel is all of the space in the SimpleContainer, which itself is floating inside the CenterLayoutContainer if there is room. Nothing about scrolling.

    The job of the CenterLayoutContainer is to a) take the size given from its parent (vlc, layout data says 100% of width and height), b) assume that the child is sized, and c) based on available space and size of child, center the child by setting its position. If the child is too big to fit, then it doesn't fit - we can't center something that doesn't fit. Actually, that's a lie...

    ...we can center something that doesn't fit, and we do, but it doesnt *make* it fit any better. A 400x400 object centered in a 200x200 space skips the first and last 100px of each dimension. That doesn't *really* make sense in terms of layouts though. I'm not entirely yet sure why CenterLayoutContainer is behaving the way that it is (i.e. drawing a scrollbar, etc), but I'm also not sure that it is behaving inconsistently.

    Setting the overflow on the VLC doesn't do a lot, since the VLC is being told to given *its* child (here the CenterLC) exactly the same size as the VLC has. If the VLC has 100x100, the CenterLC will have 100x100, and no amount of configuration can center an object that is 1322x762 in that space (nor will scrolling or other positioning make that centering make sense, so CenterLC doesnt do it).

    Can you describe or diagram the layout you are trying to achieve? The assembly of objects *seems* to draw what you've asked it to - draw a dialog slightly smaller than the browser window, make a big panel in that, and if space is available center it, otherwise Bad Things happen. The 20px margin should have no real effect here, except to make the space that the ContentPanel live in be larger and thus the "can't center if there isn't enough space" issue occur sooner.

Thread Participants: 1

Tags for this Thread

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