diff --git a/ChangeLog b/ChangeLog index 05a9ae8bc..da562063a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,15 @@ 2010-01-27 Quentin Mathe - * NSApplication.m (-_postAndSendEvent:): Added. + * Headers/GNUstepGUI/GSTheme.h: + * Source/GSThemeDrawing.m: + (-titleViewClassForMenuView:): Added the possibility to customize the + title view with this new method. + * Source/NSMenuView.m (-update): Modified to loop uk the title view + class through the active theme rather than just using GSTitleView. + +2010-01-27 Quentin Mathe + + * Source/NSApplication.m (-_postAndSendEvent:): Added. * Source/GSDragView (-_sendLocalEvent:action:position:timestamp:toWindow:): Dispatch drag events -[NSApp _postAndSendEvent:] to match Mac OS X behavior. diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index 0b1141608..02718d4ca 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -839,7 +839,13 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification; inView: (NSView *)controlView state: (GSThemeControlState)state isHorizontal: (BOOL)isHorizontal; - +/** + * Returns the class used to create the title bar in the given menu view. + * + * By default, returns GSTitleView.
+ * A subclass can be returned to customize the title view look and behavior. + */ +- (Class) titleViewClassForMenuView: (NSMenuView *)aMenuView; // NSColorWell drawing method - (NSRect) drawColorWellBorder: (NSColorWell*)well diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 3be52eb8d..bb20beedc 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -46,6 +46,7 @@ #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSToolbarView.h" +#import "GNUstepGUI/GSTitleView.h" @implementation GSTheme (Drawing) @@ -717,6 +718,11 @@ } } +- (Class) titleViewClassForMenuView: (NSMenuView *)aMenuView +{ + return [GSTitleView class]; +} + // NSColorWell drawing method - (NSRect) drawColorWellBorder: (NSColorWell*)well withBounds: (NSRect)bounds diff --git a/Source/NSMenuView.m b/Source/NSMenuView.m index 3c9db7c62..b57250c20 100644 --- a/Source/NSMenuView.m +++ b/Source/NSMenuView.m @@ -42,6 +42,7 @@ #include "AppKit/PSOperators.h" #include "AppKit/NSImage.h" +#include "GNUstepGUI/GSTheme.h" #include "GNUstepGUI/GSTitleView.h" #include @@ -600,7 +601,8 @@ static NSMapTable *viewInfo = 0; if (needTitleView == YES && _titleView == nil) { - _titleView = [[GSTitleView alloc] initWithOwner: _attachedMenu]; + Class titleViewClass = [[GSTheme theme] titleViewClassForMenuView: self]; + _titleView = [[titleViewClass alloc] initWithOwner: _attachedMenu]; [self addSubview: _titleView]; RELEASE(_titleView); }