mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 21:40:36 +00:00
Add method to ask if the menu should show the icon. In some themes it
is redundant. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32829 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
924b24dde4
commit
828bc672f6
3 changed files with 33 additions and 12 deletions
|
@ -1125,8 +1125,17 @@ withRepeatedImage: (NSImage*)image
|
||||||
controlViewWindow: (NSWindow *)cvWin
|
controlViewWindow: (NSWindow *)cvWin
|
||||||
preferredEdge: (NSRectEdge)edge
|
preferredEdge: (NSRectEdge)edge
|
||||||
selectedItem: (int)selectedItem;
|
selectedItem: (int)selectedItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process events for popups.
|
||||||
|
*/
|
||||||
- (BOOL) doesProcessEventsForPopUpMenu;
|
- (BOOL) doesProcessEventsForPopUpMenu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the menu icon in the application.
|
||||||
|
*/
|
||||||
|
- (BOOL) menuShouldShowIcon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes menu events for the theme. The default implementation
|
* Processes menu events for the theme. The default implementation
|
||||||
* does nothing.
|
* does nothing.
|
||||||
|
|
|
@ -169,5 +169,10 @@
|
||||||
return NO; // themes that handle events in a popUpMenu should return YES
|
return NO; // themes that handle events in a popUpMenu should return YES
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) menuShouldShowIcon
|
||||||
|
{
|
||||||
|
return YES; // override whether or not to show the icon in the menu.
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -274,16 +274,19 @@ static BOOL menuBarVisible = YES;
|
||||||
NSMutableArray *itemsToMove;
|
NSMutableArray *itemsToMove;
|
||||||
NSImage *ti;
|
NSImage *ti;
|
||||||
float bar;
|
float bar;
|
||||||
|
|
||||||
|
if([[GSTheme theme] menuShouldShowIcon])
|
||||||
|
{
|
||||||
|
ti = [[NSApp applicationIconImage] copy];
|
||||||
|
if (ti == nil)
|
||||||
|
{
|
||||||
|
ti = [[NSImage imageNamed: @"GNUstep"] copy];
|
||||||
|
}
|
||||||
|
[ti setScalesWhenResized: YES];
|
||||||
|
bar = [NSMenuView menuBarHeight] - 4;
|
||||||
|
[ti setSize: NSMakeSize(bar, bar)];
|
||||||
|
}
|
||||||
|
|
||||||
ti = [[NSApp applicationIconImage] copy];
|
|
||||||
if (ti == nil)
|
|
||||||
{
|
|
||||||
ti = [[NSImage imageNamed: @"GNUstep"] copy];
|
|
||||||
}
|
|
||||||
[ti setScalesWhenResized: YES];
|
|
||||||
bar = [NSMenuView menuBarHeight] - 4;
|
|
||||||
[ti setSize: NSMakeSize(bar, bar)];
|
|
||||||
|
|
||||||
itemsToMove = [NSMutableArray new];
|
itemsToMove = [NSMutableArray new];
|
||||||
|
|
||||||
if (appMenu == nil)
|
if (appMenu == nil)
|
||||||
|
@ -309,9 +312,13 @@ static BOOL menuBarVisible = YES;
|
||||||
RELEASE (appItem);
|
RELEASE (appItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[appItem setImage: ti];
|
|
||||||
RELEASE(ti);
|
if([[GSTheme theme] menuShouldShowIcon])
|
||||||
|
{
|
||||||
|
[appItem setImage: ti];
|
||||||
|
RELEASE(ti);
|
||||||
|
}
|
||||||
|
|
||||||
// Collect all simple items plus "Info" and "Services"
|
// Collect all simple items plus "Info" and "Services"
|
||||||
for (i = 1; i < [_items count]; i++)
|
for (i = 1; i < [_items count]; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue