mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 20:17:38 +00:00
Patch by German Arias <german@xelalug.org>.
Allows to get icon placement from separate process. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29153 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4433753e94
commit
fc783c92d6
6 changed files with 214 additions and 9 deletions
|
@ -79,6 +79,7 @@
|
|||
#include "AppKit/NSScreen.h"
|
||||
#include "AppKit/PSOperators.h"
|
||||
|
||||
#include "GSIconManager.h"
|
||||
#include "GNUstepGUI/GSDisplayServer.h"
|
||||
#include "GNUstepGUI/GSServicesManager.h"
|
||||
#include "GSGuiPrivate.h"
|
||||
|
@ -466,7 +467,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
{
|
||||
NSSize iconSize, retSize;
|
||||
|
||||
iconSize = [GSCurrentServer() iconSize];
|
||||
iconSize = GSGetIconSize();
|
||||
retSize.width = imageSize.width * iconSize.width / 64;
|
||||
retSize.height = imageSize.height * iconSize.height / 64;
|
||||
return retSize;
|
||||
|
@ -477,7 +478,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
NSImage *tileImage;
|
||||
NSSize iconSize;
|
||||
|
||||
iconSize = [GSCurrentServer() iconSize];
|
||||
iconSize = GSGetIconSize();
|
||||
/* _appIconInit will set our image */
|
||||
dragCell = [[NSCell alloc] initImageCell: nil];
|
||||
[dragCell setBordered: NO];
|
||||
|
@ -515,7 +516,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
|
|||
|
||||
- (void) drawRect: (NSRect)rect
|
||||
{
|
||||
NSSize iconSize = [GSCurrentServer() iconSize];
|
||||
NSSize iconSize = GSGetIconSize();
|
||||
|
||||
[tileCell drawWithFrame: NSMakeRect(0, 0, iconSize.width, iconSize.height)
|
||||
inView: self];
|
||||
|
@ -3391,6 +3392,7 @@ struct _DelegateWrapper
|
|||
|
||||
if (termination == NSTerminateNow)
|
||||
{
|
||||
GSRemoveIcon(_app_icon_window);
|
||||
[self replyToApplicationShouldTerminate: YES];
|
||||
}
|
||||
/*
|
||||
|
@ -3668,8 +3670,7 @@ struct _DelegateWrapper
|
|||
- _appIconInit
|
||||
{
|
||||
NSAppIconView *iv;
|
||||
NSSize iconSize = [GSCurrentServer() iconSize];
|
||||
NSRect iconRect = NSMakeRect(0, 0, iconSize.width, iconSize.height);
|
||||
NSRect iconRect;
|
||||
unsigned mask = NSIconWindowMask;
|
||||
BOOL suppress;
|
||||
|
||||
|
@ -3682,12 +3683,15 @@ struct _DelegateWrapper
|
|||
}
|
||||
#endif
|
||||
|
||||
_app_icon_window = [[NSIconWindow alloc] initWithContentRect: iconRect
|
||||
_app_icon_window = [[NSIconWindow alloc] initWithContentRect: NSZeroRect
|
||||
styleMask: mask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: NO
|
||||
screen: nil];
|
||||
|
||||
iconRect = GSGetIconFrame(_app_icon_window);
|
||||
[_app_icon_window setFrame: iconRect display: YES];
|
||||
|
||||
iv = [[NSAppIconView alloc] initWithFrame: iconRect];
|
||||
[iv setImage: _app_icon];
|
||||
[_app_icon_window setContentView: iv];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue