mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:47:39 +00:00
Titlebar state change code added
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6194 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6a2530c043
commit
5950d6f837
6 changed files with 113 additions and 11 deletions
|
@ -481,7 +481,8 @@ static NSMapTable* windowmaps = NULL;
|
|||
NSNonRetainedObjectMapValueCallBacks, 20);
|
||||
|
||||
/* Initialize attributes and flags */
|
||||
[self cleanInit];
|
||||
[super init];
|
||||
[self _initDefaults];
|
||||
|
||||
backing_type = bufferingType;
|
||||
style_mask = aStyle;
|
||||
|
@ -791,7 +792,7 @@ static NSMapTable* windowmaps = NULL;
|
|||
[first_responder becomeKeyWindow];
|
||||
|
||||
_f.is_key = YES;
|
||||
DPSsetinputfocus(GSCurrentContext(), window_num);
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarKey);
|
||||
[self resetCursorRects];
|
||||
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
|
||||
}
|
||||
|
@ -804,6 +805,10 @@ static NSMapTable* windowmaps = NULL;
|
|||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
_f.is_main = YES;
|
||||
if (_f.is_key == NO)
|
||||
{
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarMain);
|
||||
}
|
||||
[nc postNotificationName: NSWindowDidBecomeMainNotification object: self];
|
||||
}
|
||||
}
|
||||
|
@ -1058,6 +1063,15 @@ static NSMapTable* windowmaps = NULL;
|
|||
//[first_responder resignKeyWindow];
|
||||
|
||||
_f.is_key = NO;
|
||||
|
||||
if (_f.is_main == YES)
|
||||
{
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarMain);
|
||||
}
|
||||
else
|
||||
{
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarNormal);
|
||||
}
|
||||
[self discardCursorRects];
|
||||
|
||||
[nc postNotificationName: NSWindowDidResignKeyNotification object: self];
|
||||
|
@ -1071,7 +1085,14 @@ static NSMapTable* windowmaps = NULL;
|
|||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
_f.is_main = NO;
|
||||
|
||||
if (_f.is_key == YES)
|
||||
{
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
DPSsetinputstate(GSCurrentContext(), window_num, GSTitleBarNormal);
|
||||
}
|
||||
[nc postNotificationName: NSWindowDidResignMainNotification object: self];
|
||||
}
|
||||
}
|
||||
|
@ -3211,14 +3232,6 @@ resetCursorRectsForView(NSView *theView)
|
|||
_f.has_closed = NO;
|
||||
}
|
||||
|
||||
- (id) cleanInit
|
||||
{
|
||||
[super init];
|
||||
|
||||
[self _initDefaults];
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue