macosx: Remove private API for sort indicator images
[vlc.git] / modules / gui / macosx / VLCImageButton.m
blobd891b25ad53d41d99d155888d067bf0d89938ff5
1 /*****************************************************************************
2  * VLCImageButton.m
3  *****************************************************************************
4  * Copyright (C) 2017 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: Cameron Mozie <camsw0rld14@gmail.com>
8  *          Marvin Scholz <epirat07 at gmail dot com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
25 #import "VLCImageButton.h"
27 @implementation VLCImageButton
29 @synthesize toggle = _toggle;
31 - (instancetype)initWithCoder:(NSCoder *)coder
33     self =  [super initWithCoder:coder];
34     if (self) {
35         _toggle = NO;
36     }
37     return self;
40 - (void)awakeFromNib
42     [(NSButtonCell*)[self cell] setHighlightsBy:NSPushInCellMask];
43     [(NSButtonCell*)[self cell] setShowsStateBy:(_toggle) ? NSContentsCellMask : NSNoCellMask];
46 - (void)setToggle:(BOOL)toggle
48     _toggle = toggle;
49     [(NSButtonCell*)[self cell] setShowsStateBy:(_toggle) ? NSContentsCellMask : NSNoCellMask];
52 @end