Only read iconPosition when icon is present
This commit is contained in:
parent
526d287d25
commit
c32a723e29
1 changed files with 6 additions and 5 deletions
|
@ -307,17 +307,18 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||||
settings.Get("label", &label);
|
settings.Get("label", &label);
|
||||||
button.title = base::SysUTF8ToNSString(label);
|
button.title = base::SysUTF8ToNSString(label);
|
||||||
|
|
||||||
std::string iconPosition = "overlay";
|
|
||||||
settings.Get("iconPosition", &iconPosition);
|
|
||||||
gfx::Image image;
|
gfx::Image image;
|
||||||
if (settings.Get("icon", &image)) {
|
if (settings.Get("icon", &image)) {
|
||||||
button.image = image.AsNSImage();
|
button.image = image.AsNSImage();
|
||||||
|
|
||||||
|
std::string iconPosition;
|
||||||
|
settings.Get("iconPosition", &iconPosition);
|
||||||
if (iconPosition == "left") {
|
if (iconPosition == "left") {
|
||||||
button.imagePosition = NSImageLeft;
|
button.imagePosition = NSImageLeft;
|
||||||
} else if (iconPosition == "right") {
|
} else if (iconPosition == "right") {
|
||||||
button.imagePosition = NSImageRight;
|
button.imagePosition = NSImageRight;
|
||||||
} else {
|
} else {
|
||||||
button.imagePosition = NSImageOverlaps;
|
button.imagePosition = NSImageOverlaps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue