-
Notifications
You must be signed in to change notification settings - Fork 10
/
GSStandardDecorationView+Rik.m
40 lines (36 loc) · 1.33 KB
/
GSStandardDecorationView+Rik.m
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
#import <GNUstepGUI/GSWindowDecorationView.h>
#import <GNUstepGUI/GSTheme.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(RikTheme)
@end
@implementation GSStandardWindowDecorationView(RikTheme)
- (void) updateRects
{
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];
}
}
@end