mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:10:48 +00:00
More windows menu fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5370 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ca1872bc5d
commit
661f85f0d5
2 changed files with 37 additions and 21 deletions
|
@ -1672,6 +1672,16 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Object of bad type passed as window"];
|
||||
|
||||
if (isFilename)
|
||||
{
|
||||
NSRange r = [aString rangeOfString: @" -- "];
|
||||
|
||||
if (r.length > 0)
|
||||
{
|
||||
aString = [aString substringToIndex: r.location];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Can't permit an untitled window in the window menu.
|
||||
*/
|
||||
|
|
|
@ -395,27 +395,43 @@ static NSMapTable* windowmaps = NULL;
|
|||
|
||||
- (void) setRepresentedFilename: (NSString*)aString
|
||||
{
|
||||
id old = represented_filename;
|
||||
BOOL changed = (_f.menu_exclude == NO && [aString isEqual: old] == NO);
|
||||
|
||||
ASSIGN(represented_filename, aString);
|
||||
if (changed)
|
||||
{
|
||||
[NSApp updateWindowsItem: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setTitle: (NSString*)aString
|
||||
{
|
||||
ASSIGN(window_title, aString);
|
||||
DPStitlewindow(GSCurrentContext(), [window_title cString], window_num);
|
||||
[self setMiniwindowTitle: aString];
|
||||
if ([window_title isEqual: aString] == NO)
|
||||
{
|
||||
ASSIGN(window_title, aString);
|
||||
[self setMiniwindowTitle: aString];
|
||||
DPStitlewindow(GSCurrentContext(), [aString cString], window_num);
|
||||
if (_f.menu_exclude == NO)
|
||||
{
|
||||
[NSApp changeWindowsItem: self
|
||||
title: aString
|
||||
filename: NO];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setTitleWithRepresentedFilename: (NSString*)aString
|
||||
{
|
||||
[self setRepresentedFilename: aString];
|
||||
[self setTitle: aString];
|
||||
aString = [NSString stringWithFormat:
|
||||
@"%@ -- %@", [aString lastPathComponent],
|
||||
[aString stringByDeletingLastPathComponent]];
|
||||
if ([window_title isEqual: aString] == NO)
|
||||
{
|
||||
ASSIGN(window_title, aString);
|
||||
[self setMiniwindowTitle: aString];
|
||||
DPStitlewindow(GSCurrentContext(), [aString cString], window_num);
|
||||
if (_f.menu_exclude == NO)
|
||||
{
|
||||
[NSApp changeWindowsItem: self
|
||||
title: aString
|
||||
filename: YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (unsigned int) styleMask
|
||||
|
@ -486,17 +502,7 @@ static NSMapTable* windowmaps = NULL;
|
|||
|
||||
- (void) setMiniwindowTitle: (NSString*)title
|
||||
{
|
||||
BOOL isDoc = NO;
|
||||
|
||||
ASSIGN(miniaturized_title, title);
|
||||
if (_f.is_miniaturized == NO)
|
||||
title = window_title;
|
||||
if ([title isEqual: represented_filename])
|
||||
isDoc = YES;
|
||||
if (_f.menu_exclude == NO)
|
||||
[NSApp changeWindowsItem: self
|
||||
title: title
|
||||
filename: isDoc];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue