bugGNUstep - Bugs: bug #34493, layout of loaded XIBs messed up

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #34493: layout of loaded XIBs messed up

Submitted by:  julian <julian_>
Submitted on:  Thu 06 Oct 2011 11:40:57 AM UTC  
Votes:  15  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: None
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Open

Thu 17 Oct 2013 10:46:14 PM UTC, comment #3:

"the autoresize mask should only come into play if the view is resized, and since the NSTabView containing the items is not resizeable, this should not have any effect. "

The autoresizing mask comes into play because GNUstep doesn't assign the same size to the NSTabView subviews as Cocoa. i.e. the theme metrics of the default theme don't match Cocoa's, so it's as if you are resizing the tab view slightly.

So for now, you have to make the tab contents look good when resized, even if you don't want the tabview itself to be resizable.

With this in mind, current gnustep trunk is doing everything correctly as far as I can see. e.g. the "objectives" box on tab 1 being shifted up, "enemies / rounds / difficulty" being shifted up on tab 2, and "enable core breaches" being shifted up on tab 4 are all expected: If you open the xib in Xcode and make the window and outer tabview resizable, and expand the window slightly to simulate the difference in tabview metrics between the GS theme and Cocoa, you get the same results.

On tab 2, the highscores tabview touching the "space ship" box is a separate issue: we draw right to the edge of the frame of a tab view, whereas cocoa leaves a lot of empty space.

So to sum up, there are two separate problems here:
- difference between view frame and the visible border of the view for some NSView subclasses on GNUstep and Cocoa (the layout rect vs frame problem.) Cocoa leaves empty space between the control's visible border and the frame, whereas GNUstep draws right up to the frame. Fred, Quentin and I are having a discussion about how to solve this problem right now.
- even if the first problem were fixed, we have the problem of different amounts of space in Cocoa and GNUstep between the frame of a composite view like NSTabView, NSBox, etc. and the subviews. This is why the autoresizing masks of things inside the tabs matters. The only fix for this is adjusting the default theme to have the same metrics as Cocoa.

Fred: as far as I can see, we can disable the hack that changes the subview autoresizing mask to NSWidthSizable|NSHeightSizable. Although, I don't see how that should have any effect, since immediately after doing that we call setFrame on the subview.

Eric Wasylishen <ericw>
Project Member
Wed 02 Nov 2011 10:49:23 PM UTC, comment #2:

I investigated this issue and it turns out that we mess up the lay out on purpose :-(

When loading a NSTabView from a NIB or XIB file we change the auto resize behaviour of the views within the NSTabViewItems and adjust them to the size of the NSTabView, which will be a bit different in GNUstep than it is on Cocoa. Part of that layout difference is due to the different styles used in GNUstep, but partly it is also a result of GNUstep not defining the isFlipped method on NSTabView.

We need to fix this first and this means to rewrite all the NStabView drawing code (potentially in the themes as well). And after that it should be possible to remove the changes to the resize behaviour. What we will need to keep is the setting of the content rectangle for the active view and this may still result in a changed layout.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Thu 06 Oct 2011 04:40:36 PM UTC, comment #1:

please note that some problems go away when making the autoresize masks of all items the same (but its a bug in itself that the autoresize mask has any effect here)

e.g. the boxes on tab 1 are now starting at the same y coordinate

but some problems don't go away

e.g. the tab view on tab 2 still touches the box although it should be 10 pixels away

julian <julian_>
Thu 06 Oct 2011 11:40:57 AM UTC, original submission:

i have a sample XIB that looks quite different in gnustep than it does in GNUstep, the relative positioning of some items is quite messed up.

i know that different autoresizemasks for the items could be responsible for changes in the relative positioning of the affected views, but the autoresize mask should only come into play if the view is resized, and since the NSTabView containing the items is not resizeable, this should not have any effect.

observe the problems with nice screenshots here:

http://imageshack.us/g/192/45188259.png/

sample project exhibiting the issue attached.

julian <julian_>

 

Attached Files
file #24113:  gnustepbug.zip added by julian_ (103kB - application/zip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ericw (Posted a comment)
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by julian_ (Voted in favor of this item)
  • -unavailable- added by julian_ (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 15 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 02 Nov 2011 10:49:23 PM UTCFredKieferAssigned toNone=>FredKiefer
    Thu 06 Oct 2011 12:21:51 PM UTCjulian_Carbon-Copy-=>Added julian_
    Thu 06 Oct 2011 11:40:57 AM UTCjulian_Attached File-=>Added gnustepbug.zip, #24113

    Back to the top


    Powered by Savane 3.1-cleanup