blob: 29402a782b569d511b4d85300dc21680ec392700 [file] [log] [blame]
Alexandre Lision6da08a82015-09-24 17:09:24 -04001/*
Alexandre Lision9fe374b2016-01-06 10:17:31 -05002 * Copyright (C) 2015-2016 Savoir-faire Linux Inc.
Alexandre Lision6da08a82015-09-24 17:09:24 -04003 * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
Alexandre Lision6da08a82015-09-24 17:09:24 -040019#import <Cocoa/Cocoa.h>
20
Alexandre Lision6da08a82015-09-24 17:09:24 -040021@interface IconButton : NSButton
22
23@property (nonatomic) BOOL mouseDown;
24
25/*
26 * This properties can be overriden in IB in User Defined Runtime Attributes
Alexandre Lision266fca02015-09-28 14:47:05 -040027 * By default this values will be initialized in awakeFromNib
28 */
29
30/*
31 * Background color of the button
32 * default value : [NSColor ringBlue]
Alexandre Lision6da08a82015-09-24 17:09:24 -040033 */
34@property (nonatomic, strong) NSColor* bgColor;
Alexandre Lision266fca02015-09-28 14:47:05 -040035
36/*
37 * Background color of the button when highlighted
38 * default value : view frame width / 2 (circle)
39 */
40@property (nonatomic, strong) NSColor* highlightColor;
41
42/*
43 * Background color of the button when highlighted
44 * default value : view frame width / 2 (circle)
45 */
Alexandre Lision6da08a82015-09-24 17:09:24 -040046@property (nonatomic, strong) NSNumber* cornerRadius;
47
Alexandre Lision266fca02015-09-28 14:47:05 -040048/*
Alexandre Lision4baba4c2016-02-11 13:00:57 -050049 * Define pressed state of the button
50 */
51@property (atomic, getter=isPressed) BOOL pressed;
52
53/*
Alexandre Lision266fca02015-09-28 14:47:05 -040054 * Padding
Andreas Traczyk252a94a2018-04-20 16:36:20 -040055 * default value : 8.0
Alexandre Lision266fca02015-09-28 14:47:05 -040056 */
57@property CGFloat imageInsets;
58
Kateryna Kostiuk3c960bf2017-06-01 12:11:54 -040059/*
60 * Add bluer effect behind button
61 */
62
63@property NSVisualEffectView* vibrantView;
64
Kateryna Kostiuk958cd072017-07-14 15:56:35 -040065/*
66 * Button image color
67 * default value : [NSColor white];
68 */
69
70@property (nonatomic, strong) NSColor* imageColor;
71
Kateryna Kostiukdb95b472018-04-17 16:35:57 -040072/*
73 * Image color when button is disabled
74 * default value : [[NSColor grayColor] colorWithAlphaComponent:0.3];
75 */
76
77@property (nonatomic, strong) NSColor* buttonDisableColor;
78
Kateryna Kostiukefc665d2018-09-17 15:42:43 -040079/*
80 * Color of the button corners. Draw circle with cornerRadius filled with bgColor
81 * and fill corner with cornerColor
82 */
83@property (nonatomic, strong) NSColor* cornerColor;
84
Kateryna Kostiuk4f37d952018-12-04 13:19:17 -050085/*
86 * Font size of the button title.
87 */
88@property CGFloat fontSize;
89
Kateryna Kostiukefc665d2018-09-17 15:42:43 -040090
Alexandre Lision266fca02015-09-28 14:47:05 -040091
Alexandre Lision6da08a82015-09-24 17:09:24 -040092@end