Skip to content

Commit

Permalink
fix: remove label/image from segment if they are mutated to undefined…
Browse files Browse the repository at this point in the history
…/null (#17323)
  • Loading branch information
MarshallOfSound committed Mar 11, 2019
1 parent b43e4b8 commit c7a4532
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion atom/browser/ui/cocoa/atom_touch_bar.mm
Expand Up @@ -623,9 +623,14 @@ - (void)updateSegmentedControl:(NSCustomTouchBarItem*)item
segments[i].Get("enabled", &enabled);
if (segments[i].Get("label", &label)) {
[control setLabel:base::SysUTF8ToNSString(label) forSegment:i];
} else if (segments[i].Get("icon", &image)) {
} else {
[control setLabel:@"" forSegment:i];
}
if (segments[i].Get("icon", &image)) {
[control setImage:image.AsNSImage() forSegment:i];
[control setImageScaling:NSImageScaleProportionallyUpOrDown forSegment:i];
} else {
[control setImage:nil forSegment:i];
}
[control setEnabled:enabled forSegment:i];
}
Expand Down

0 comments on commit c7a4532

Please sign in to comment.