Set automatic via else block

This commit is contained in:
Kevin Sawicki 2017-03-10 10:11:10 -08:00
parent 3349e32196
commit 5b1d5b39a2

View file

@ -400,7 +400,7 @@ static NSTouchBarItemIdentifier SegmentedControlIdentifier = @"com.electron.touc
}
- (NSTouchBarItem*)makeSegmentedControlForID:(NSString*)id
withIdentifier:(NSString*)identifier {
withIdentifier:(NSString*)identifier {
std::string s_id([id UTF8String]);
if (![self hasItemWithID:s_id]) return nil;
@ -420,15 +420,13 @@ static NSTouchBarItemIdentifier SegmentedControlIdentifier = @"com.electron.touc
}
- (void)updateSegmentedControl:(NSCustomTouchBarItem*)item
withSettings:(const mate::PersistentDictionary&)settings {
withSettings:(const mate::PersistentDictionary&)settings {
NSSegmentedControl* control = item.view;
std::string segmentStyle;
settings.Get("segmentStyle", &segmentStyle);
if (segmentStyle == "automatic")
control.segmentStyle = NSSegmentStyleAutomatic;
else if (segmentStyle == "rounded")
if (segmentStyle == "rounded")
control.segmentStyle = NSSegmentStyleRounded;
else if (segmentStyle == "textured-rounded")
control.segmentStyle = NSSegmentStyleTexturedRounded;