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 (#17334)
  • Loading branch information
trop[bot] authored and MarshallOfSound committed Mar 12, 2019
1 parent 2f31302 commit 6a93200
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 6a93200

Please sign in to comment.