mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
2010-07-22 19:35-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Source/GSTheme.m: Call method _setArchiveByName: with YES so that images loaded by a theme will not be persisted as image data, but rather as references. This will avoid an issue with saving theme images when saving files in Gorm while a theme is loaded. * Source/NSImage.m: Added method _setArchiveByName:. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31021 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2eb0a85405
commit
6d682ee88e
3 changed files with 28 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
|||
2010-07-22 19:35-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/GSTheme.m: Call method _setArchiveByName: with YES so that
|
||||
images loaded by a theme will not be persisted as image data, but
|
||||
rather as references. This will avoid an issue with saving theme
|
||||
images when saving files in Gorm while a theme is loaded.
|
||||
* Source/NSImage.m: Added method _setArchiveByName:.
|
||||
|
||||
2010-07-15 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSMenuView.m (-setWindowFrameForAttachingToRect...):
|
||||
|
|
|
@ -209,6 +209,7 @@ GSStringFromBorderType(NSBorderType borderType)
|
|||
|
||||
@interface NSImage (GSTheme)
|
||||
+ (NSImage*) _setImage: (NSImage*)image name: (NSString*)name;
|
||||
- (void) _setArchiveByName: (BOOL)flag;
|
||||
@end
|
||||
|
||||
@interface GSTheme (Private)
|
||||
|
@ -493,6 +494,15 @@ typedef struct {
|
|||
* any previous/default image of the same name.
|
||||
*/
|
||||
[_images setObject: image forKey: imageName];
|
||||
|
||||
/* Force the image to be archived by name. This prevents
|
||||
* problems such as when/if gorm is being used with a theme
|
||||
* active, it will not save the image which was loaded
|
||||
* here and will, instead save the name so that the proper
|
||||
* image gets loaded in the future.
|
||||
*/
|
||||
[image _setArchiveByName: YES];
|
||||
|
||||
RELEASE(image);
|
||||
old = [NSImage imageNamed: imageName];
|
||||
if (old == nil)
|
||||
|
|
|
@ -2156,4 +2156,14 @@ iterate_reps_for_types(NSArray* imageReps, SEL method)
|
|||
return (NSImage*)proxy;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows the theme system to specify that an image
|
||||
* should be archived using the reference to it's name only.
|
||||
* This prevents saving theme specific image data into the
|
||||
* images in an archive.
|
||||
*/
|
||||
- (void) _setArchiveByName: (BOOL)flag;
|
||||
{
|
||||
_flags.archiveByName = flag;
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue