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

Group
 
 

bug #34493: layout of loaded XIBs messed up

Submitter:  julian <julian_>
Submitted:  Thu 06 Oct 2011 11:40:57 AM UTC
Votes: 15
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Wont Fix
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 30 Oct 2020 02:03:06 PM UTC, comment #4: 

Per Fred's comment and the final comment by Eric I am closing this.

Gregory John Casamento <gcasa>
Group administrator
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>
Group 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>
Group Member
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_>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 15 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-30 gcasa StatusNone Wont Fix
        Open/ClosedOpen Closed
    2011-11-02 FredKiefer Assigned toNone FredKiefer
    2011-10-06 julian_ Carbon-Copy- Added julian_
    2011-10-06 julian_ Attached File- Added gnustepbug.zip, #24113

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code