mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 21:00:47 +00:00
Made images easier to be changed by themes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18647 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8ed6bbe6ab
commit
7a53fefbf0
7 changed files with 47 additions and 22 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2004-02-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Images/nsmapping.strings:
|
||||||
|
Added definition for NSMenuMixedState.
|
||||||
|
* Source/NSButtonCell.m: (-setButtonType:)
|
||||||
|
* Source/NSMenuItemCell.m: (+initialize)
|
||||||
|
* Source/NSMenuItem.m: (-initWithTitle:action:keyEquivalent:)
|
||||||
|
Use image aliases instead of file names.
|
||||||
|
* Source/GSNibCompatibility.m: Reenabled keyed archiver for
|
||||||
|
NSWindowTemplate and added missing include.
|
||||||
|
|
||||||
2004-02-20 Fred Kiefer <FredKiefer@gmx.de>
|
2004-02-20 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Headers/AppKit/NSView.h:
|
* Headers/AppKit/NSView.h:
|
||||||
|
|
|
@ -8,4 +8,5 @@ NSRadioButton = common_RadioOff;
|
||||||
NSHighlightedRadioButton = common_RadioOn;
|
NSHighlightedRadioButton = common_RadioOn;
|
||||||
AppleMenuImage = GNUstepMenuImage;
|
AppleMenuImage = GNUstepMenuImage;
|
||||||
NSMenuCheckmark = common_2DCheckMark;
|
NSMenuCheckmark = common_2DCheckMark;
|
||||||
NSMenuArrow = common_3DArrowRight;
|
NSMenuArrow = common_3DArrowRight;
|
||||||
|
NSMenuMixedState = common_2DDash;
|
|
@ -52,6 +52,7 @@
|
||||||
#include <Foundation/NSString.h>
|
#include <Foundation/NSString.h>
|
||||||
#include <Foundation/NSUserDefaults.h>
|
#include <Foundation/NSUserDefaults.h>
|
||||||
#include <Foundation/NSKeyValueCoding.h>
|
#include <Foundation/NSKeyValueCoding.h>
|
||||||
|
#include <Foundation/NSKeyedArchiver.h>
|
||||||
#include "AppKit/AppKit.h"
|
#include "AppKit/AppKit.h"
|
||||||
#include <GNUstepBase/GSObjCRuntime.h>
|
#include <GNUstepBase/GSObjCRuntime.h>
|
||||||
#include <GNUstepGUI/GSNibCompatibility.h>
|
#include <GNUstepGUI/GSNibCompatibility.h>
|
||||||
|
@ -97,16 +98,13 @@
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder *)aDecoder
|
- (id) initWithCoder: (NSCoder *)aDecoder
|
||||||
{
|
{
|
||||||
/*
|
/**/
|
||||||
if ([aDecoder allowsKeyedCoding])
|
if ([aDecoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
NSRect screenRect = [aDecoder decodeRectForKey: @"NSScreenRect"];
|
//NSRect screenRect = [aDecoder decodeRectForKey: @"NSScreenRect"];
|
||||||
NSRect windowRect = [aDecoder decodeRectForKey: @"NSWindowRect"];
|
NSRect windowRect = [aDecoder decodeRectForKey: @"NSWindowRect"];
|
||||||
NSString *viewClass = [aDecoder decodeObjectForKey: @"NSViewClass"];
|
//NSString *viewClass = [aDecoder decodeObjectForKey: @"NSViewClass"];
|
||||||
NSString *windowClass = [aDecoder decodeObjectForKey: @"NSWindowClass"];
|
NSString *windowClass = [aDecoder decodeObjectForKey: @"NSWindowClass"];
|
||||||
NSString *title = [aDecoder decodeObjectForKey: @"NSWindowTitle"];
|
|
||||||
NSView *view = [aDecoder decodeObjectForKey: @"NSWindowView"];
|
|
||||||
int flags = [aDecoder decodeIntForKey: @"NSWTFlags"];
|
|
||||||
int style = [aDecoder decodeIntForKey: @"NSWindowStyleMask"];
|
int style = [aDecoder decodeIntForKey: @"NSWindowStyleMask"];
|
||||||
int backing = [aDecoder decodeIntForKey: @"NSWindowBacking"];
|
int backing = [aDecoder decodeIntForKey: @"NSWindowBacking"];
|
||||||
|
|
||||||
|
@ -116,8 +114,16 @@
|
||||||
backing: backing
|
backing: backing
|
||||||
defer: NO
|
defer: NO
|
||||||
screen: nil];
|
screen: nil];
|
||||||
[self setContentView: view];
|
|
||||||
|
|
||||||
|
if ([aDecoder containsValueForKey: @"NSWindowView"])
|
||||||
|
{
|
||||||
|
[self setContentView:
|
||||||
|
[aDecoder decodeObjectForKey: @"NSWindowView"]];
|
||||||
|
}
|
||||||
|
if ([aDecoder containsValueForKey: @"NSWTFlags"])
|
||||||
|
{
|
||||||
|
//int flags = [aDecoder decodeIntForKey: @"NSWTFlags"];
|
||||||
|
}
|
||||||
if ([aDecoder containsValueForKey: @"NSMinSize"])
|
if ([aDecoder containsValueForKey: @"NSMinSize"])
|
||||||
{
|
{
|
||||||
NSSize minSize = [aDecoder decodeSizeForKey: @"NSMinSize"];
|
NSSize minSize = [aDecoder decodeSizeForKey: @"NSMinSize"];
|
||||||
|
@ -128,18 +134,20 @@
|
||||||
NSSize maxSize = [aDecoder decodeSizeForKey: @"NSMaxSize"];
|
NSSize maxSize = [aDecoder decodeSizeForKey: @"NSMaxSize"];
|
||||||
[self setMaxSize: maxSize];
|
[self setMaxSize: maxSize];
|
||||||
}
|
}
|
||||||
[self setTitle: title];
|
if ([aDecoder containsValueForKey: @"NSWindowTitle"])
|
||||||
|
{
|
||||||
|
[self setTitle: [aDecoder decodeObjectForKey: @"NSWindowTitle"]];
|
||||||
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*/
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_className];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &_className];
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_parentClassName];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &_parentClassName];
|
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
return [super initWithCoder: aDecoder];
|
||||||
return [super initWithCoder: aDecoder];
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) encodeWithCoder: (NSCoder *)aCoder
|
- (void) encodeWithCoder: (NSCoder *)aCoder
|
||||||
|
|
|
@ -533,8 +533,8 @@
|
||||||
case NSSwitchButton:
|
case NSSwitchButton:
|
||||||
[self setHighlightsBy: NSContentsCellMask];
|
[self setHighlightsBy: NSContentsCellMask];
|
||||||
[self setShowsStateBy: NSContentsCellMask];
|
[self setShowsStateBy: NSContentsCellMask];
|
||||||
[self setImage: [NSImage imageNamed: @"common_SwitchOff"]];
|
[self setImage: [NSImage imageNamed: @"NSSwitch"]];
|
||||||
[self setAlternateImage: [NSImage imageNamed: @"common_SwitchOn"]];
|
[self setAlternateImage: [NSImage imageNamed: @"NSHighlightedSwitch"]];
|
||||||
[self setImagePosition: NSImageLeft];
|
[self setImagePosition: NSImageLeft];
|
||||||
[self setAlignment: NSLeftTextAlignment];
|
[self setAlignment: NSLeftTextAlignment];
|
||||||
[self setBordered: NO];
|
[self setBordered: NO];
|
||||||
|
@ -544,8 +544,8 @@
|
||||||
case NSRadioButton:
|
case NSRadioButton:
|
||||||
[self setHighlightsBy: NSContentsCellMask];
|
[self setHighlightsBy: NSContentsCellMask];
|
||||||
[self setShowsStateBy: NSContentsCellMask];
|
[self setShowsStateBy: NSContentsCellMask];
|
||||||
[self setImage: [NSImage imageNamed: @"common_RadioOff"]];
|
[self setImage: [NSImage imageNamed: @"NSRadioButton"]];
|
||||||
[self setAlternateImage: [NSImage imageNamed: @"common_RadioOn"]];
|
[self setAlternateImage: [NSImage imageNamed: @"NSHighlightedRadioButton"]];
|
||||||
[self setImagePosition: NSImageLeft];
|
[self setImagePosition: NSImageLeft];
|
||||||
[self setAlignment: NSLeftTextAlignment];
|
[self setAlignment: NSLeftTextAlignment];
|
||||||
[self setBordered: NO];
|
[self setBordered: NO];
|
||||||
|
|
|
@ -392,6 +392,11 @@ backgroundColorHint:(NSColor *)bg
|
||||||
{
|
{
|
||||||
self = [NSCursor IBeamCursor];
|
self = [NSCursor IBeamCursor];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// FIXME
|
||||||
|
self = [NSCursor arrowCursor];
|
||||||
|
}
|
||||||
|
|
||||||
if ([aDecoder containsValueForKey: @"NSHotSpot"])
|
if ([aDecoder containsValueForKey: @"NSHotSpot"])
|
||||||
{
|
{
|
||||||
|
|
|
@ -127,8 +127,8 @@ static Class imageClass;
|
||||||
_enabled = YES;
|
_enabled = YES;
|
||||||
//_image = nil;
|
//_image = nil;
|
||||||
// Set the images according to the spec. On: check mark; off: dash.
|
// Set the images according to the spec. On: check mark; off: dash.
|
||||||
[self setOnStateImage: [imageClass imageNamed: @"common_2DCheckMark"]];
|
[self setOnStateImage: [imageClass imageNamed: @"NSMenuCheckmark"]];
|
||||||
[self setMixedStateImage: [imageClass imageNamed: @"common_2DDash"]];
|
[self setMixedStateImage: [imageClass imageNamed: @"NSMenuMixedState"]];
|
||||||
//_offStateImage = nil;
|
//_offStateImage = nil;
|
||||||
//_target = nil;
|
//_target = nil;
|
||||||
_action = aSelector;
|
_action = aSelector;
|
||||||
|
|
|
@ -54,7 +54,7 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
|
||||||
if (self == [NSMenuItemCell class])
|
if (self == [NSMenuItemCell class])
|
||||||
{
|
{
|
||||||
[self setVersion: 2];
|
[self setVersion: 2];
|
||||||
arrowImage = [[NSImage imageNamed: @"common_3DArrowRight"] copy];
|
arrowImage = [[NSImage imageNamed: @"NSMenuArrow"] copy];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue