-
Notifications
You must be signed in to change notification settings - Fork 19
/
INWindowButton.h
executable file
·69 lines (58 loc) · 2.15 KB
/
INWindowButton.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// INWindowButton.h
//
// Copyright 2013-2014 Vladislav Alexeev. All rights reserved.
//
// Licensed under the BSD 2-clause License. See LICENSE file distributed in the source
// code of this project.
//
#import <Cocoa/Cocoa.h>
/**
A concrete NSButton subclass that allows to mimic standard window title bar "traffic light" buttons
and replace their graphics with custom ones.
*/
@interface INWindowButton : NSButton
/**
The group identifier the receiver was initialized with.
*/
@property (nonatomic, copy, readonly) NSString *groupIdentifier;
/**
An image for the normal state.
*/
@property (nonatomic, strong) NSImage *activeImage;
/**
An image for the normal state, but displayed when receiver's window in not a key.
*/
@property (nonatomic, strong) NSImage *activeNotKeyWindowImage;
/**
An image used in disabled state.
*/
@property (nonatomic, strong) NSImage *inactiveImage;
/**
An image used when user hovers receiver with mouse pointer.
*/
@property (nonatomic, strong) NSImage *rolloverImage;
/**
An image for the pressed state.
*/
@property (nonatomic, strong) NSImage *pressedImage;
/**
@param size Designated size of the button. System size is 14x16 and you are considered to use it.
@param groupIdentifier ID of the group which will apply rollover effect to its members.
You may pass \c nil.
@see initWithSize:groupIdentifier:
*/
+ (instancetype)windowButtonWithSize:(NSSize)size groupIdentifier:(NSString *)groupIdentifier;
/**
@abstract Designated initializer.
@discussion Initializes the receiver with the given size and includes it in the group with the
given identifier.
Groups are used to apply rollover effect to all buttons that are inside the same group.
For example, close, minimize and zoom buttons should be inside the same group since they all get a
rollover effect when the mouse pointer hovers over one of these buttons.
@param size Designated size of the button. System size is 14x16 and you are considered to use it.
@param groupIdentifier ID of the group which will apply rollover effect to its members.
You may pass \c nil.
*/
- (instancetype)initWithSize:(NSSize)size groupIdentifier:(NSString *)groupIdentifier;
@end