mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
* Source/NSTabView.m (-initWithCoder:): Make non-keyed archives
call -selectTabViewItem: to select the current tab at unarchiving time (keyed archives were already doing this.) Comment: "N.B.: As a side effect, this discards the subview frame and sets it to [self contentRect]. This is desirable because the subview frame will be different depending on whether the arcive is from Cocoa or GNUstep, and which GNUstep theme was active at save time. However, it does mean that the tab view contents should be prepared to resize slightly." The immediate need for this is tab views were changed to use flipped coordinates, so the subview frames stored in existing archives are now in the wrong coordinate system. This is essentially the same idea as NSScrollView calling -tile at the end of -initWithCoder: so I hope it makes sense for tab views too. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37232 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a55c2a9189
commit
fc5c32e1b3
2 changed files with 35 additions and 3 deletions
23
ChangeLog
23
ChangeLog
|
@ -1,3 +1,26 @@
|
|||
2013-10-15 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSTabView.m (-initWithCoder:): Make non-keyed archives
|
||||
call -selectTabViewItem: to select the current tab at unarchiving
|
||||
time (keyed archives were already doing this.)
|
||||
|
||||
Comment: "N.B.: As a side effect, this discards the subview frame
|
||||
and sets it to [self contentRect].
|
||||
|
||||
This is desirable because the subview frame will be different
|
||||
depending on whether the arcive is from Cocoa or GNUstep,
|
||||
and which GNUstep theme was active at save time.
|
||||
|
||||
However, it does mean that the tab view contents should be
|
||||
prepared to resize slightly."
|
||||
|
||||
The immediate need for this is tab views were changed to use
|
||||
flipped coordinates, so the subview frames stored in existing
|
||||
archives are now in the wrong coordinate system.
|
||||
|
||||
This is essentially the same idea as NSScrollView calling -tile at the
|
||||
end of -initWithCoder: so I hope it makes sense for tab views too.
|
||||
|
||||
2013-10-14 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/GSThemeDrawing.m (-tabHeightForType:): Check for nil
|
||||
|
|
|
@ -605,6 +605,15 @@
|
|||
}
|
||||
if ([aDecoder containsValueForKey: @"NSSelectedTabViewItem"])
|
||||
{
|
||||
// N.B.: As a side effect, this discards the subview frame
|
||||
// and sets it to [self contentRect].
|
||||
//
|
||||
// This is desirable because the subview frame will be different
|
||||
// depending on whether the arcive is from Cocoa or GNUstep,
|
||||
// and which GNUstep theme was active at save time.
|
||||
//
|
||||
// However, it does mean that the tab view contents should be
|
||||
// prepared to resize slightly.
|
||||
[self selectTabViewItem: [aDecoder decodeObjectForKey:
|
||||
@"NSSelectedTabViewItem"]];
|
||||
}
|
||||
|
@ -660,9 +669,9 @@
|
|||
{
|
||||
[aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &selected_item];
|
||||
}
|
||||
|
||||
if (selected_item != NSNotFound)
|
||||
_selected = [_items objectAtIndex: selected_item];
|
||||
|
||||
// N.B. Recalculates subview frame; see comment above.
|
||||
[self selectTabViewItemAtIndex: selected_item];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue