Alexandre Lision | 6da08a8 | 2015-09-24 17:09:24 -0400 | [diff] [blame] | 1 | /* |
Alexandre Lision | 9fe374b | 2016-01-06 10:17:31 -0500 | [diff] [blame] | 2 | * Copyright (C) 2015-2016 Savoir-faire Linux Inc. |
Alexandre Lision | 6da08a8 | 2015-09-24 17:09:24 -0400 | [diff] [blame] | 3 | * 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 Lision | 6da08a8 | 2015-09-24 17:09:24 -0400 | [diff] [blame] | 19 | #import <Cocoa/Cocoa.h> |
| 20 | |
Alexandre Lision | 6da08a8 | 2015-09-24 17:09:24 -0400 | [diff] [blame] | 21 | @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 Lision | 266fca0 | 2015-09-28 14:47:05 -0400 | [diff] [blame] | 27 | * By default this values will be initialized in awakeFromNib |
| 28 | */ |
| 29 | |
| 30 | /* |
| 31 | * Background color of the button |
| 32 | * default value : [NSColor ringBlue] |
Alexandre Lision | 6da08a8 | 2015-09-24 17:09:24 -0400 | [diff] [blame] | 33 | */ |
| 34 | @property (nonatomic, strong) NSColor* bgColor; |
Alexandre Lision | 266fca0 | 2015-09-28 14:47:05 -0400 | [diff] [blame] | 35 | |
| 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 Lision | 6da08a8 | 2015-09-24 17:09:24 -0400 | [diff] [blame] | 46 | @property (nonatomic, strong) NSNumber* cornerRadius; |
| 47 | |
Alexandre Lision | 266fca0 | 2015-09-28 14:47:05 -0400 | [diff] [blame] | 48 | /* |
Alexandre Lision | 4baba4c | 2016-02-11 13:00:57 -0500 | [diff] [blame] | 49 | * Define pressed state of the button |
| 50 | */ |
| 51 | @property (atomic, getter=isPressed) BOOL pressed; |
| 52 | |
| 53 | /* |
Alexandre Lision | 266fca0 | 2015-09-28 14:47:05 -0400 | [diff] [blame] | 54 | * Padding |
| 55 | * default value : 5.0 |
| 56 | */ |
| 57 | @property CGFloat imageInsets; |
| 58 | |
Kateryna Kostiuk | 3c960bf | 2017-06-01 12:11:54 -0400 | [diff] [blame] | 59 | /* |
| 60 | * Add bluer effect behind button |
| 61 | */ |
| 62 | |
| 63 | @property NSVisualEffectView* vibrantView; |
| 64 | |
Alexandre Lision | 266fca0 | 2015-09-28 14:47:05 -0400 | [diff] [blame] | 65 | |
Alexandre Lision | 6da08a8 | 2015-09-24 17:09:24 -0400 | [diff] [blame] | 66 | @end |