-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGSStandardDecorationView+Milk.m
More file actions
55 lines (51 loc) · 1.92 KB
/
GSStandardDecorationView+Milk.m
File metadata and controls
55 lines (51 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#import <GNUstepGUI/GSWindowDecorationView.h>
#import <GNUstepGUI/GSTheme.h>
#import "Milk.h"
#define TITLEBAR_BUTTON_SIZE 15
#define TITLEBAR_PADDING_LEFT 10.5
#define TITLEBAR_PADDING_RIGHT 10.5
#define TITLEBAR_PADDING_TOP 5.5
@interface GSStandardWindowDecorationView(MilkTheme)
- (void) MILKupdateRects;
@end
@implementation Milk(GSStandardWindowDecorationView)
- (void) _overrideGSStandardWindowDecorationViewMethod_updateRects {
GSStandardWindowDecorationView* xself = (GSStandardWindowDecorationView*)self;
MILKLOG(@"GSStandardDecorationView+Milk updateRects");
[xself MILKupdateRects];
}
@end
@implementation GSStandardWindowDecorationView(MilkTheme)
- (void) MILKupdateRects
{
GSTheme *theme = [GSTheme theme];
if (hasTitleBar)
{
CGFloat titleHeight = [theme titlebarHeight];
titleBarRect = NSMakeRect(0.0, [self bounds].size.height - titleHeight,
[self bounds].size.width, titleHeight);
}
if (hasResizeBar)
{
resizeBarRect = NSMakeRect(0.0, 0.0, [self bounds].size.width, [theme resizebarHeight]);
}
if (hasCloseButton)
{
closeButtonRect = NSMakeRect(
[self bounds].size.width - TITLEBAR_BUTTON_SIZE - TITLEBAR_PADDING_RIGHT, [self bounds].size.height - TITLEBAR_BUTTON_SIZE - TITLEBAR_PADDING_TOP, TITLEBAR_BUTTON_SIZE, TITLEBAR_BUTTON_SIZE);
[closeButton setFrame: closeButtonRect];
}
if (hasMiniaturizeButton)
{
miniaturizeButtonRect = NSMakeRect(
TITLEBAR_PADDING_LEFT, [self bounds].size.height - TITLEBAR_BUTTON_SIZE - TITLEBAR_PADDING_TOP, TITLEBAR_BUTTON_SIZE, TITLEBAR_BUTTON_SIZE);
[miniaturizeButton setFrame: miniaturizeButtonRect];
}
/* if (hasZoomButton)
{
zoomButtonRect = NSMakeRect(
TITLEBAR_PADDING_LEFT * 2, [self bounds].size.height - TITLEBAR_BUTTON_SIZE - TITLEBAR_PADDING_TOP, TITLEBAR_BUTTON_SIZE, TITLEBAR_BUTTON_SIZE);
[zoomButton setFrame: zoomButtonRect];
}*/
}
@end