Always set properties in update calls
This commit is contained in:
parent
2680ee9f8f
commit
b879872317
1 changed files with 7 additions and 9 deletions
|
@ -222,9 +222,8 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string label;
|
std::string label;
|
||||||
if (settings.Get("label", &label)) {
|
settings.Get("label", &label);
|
||||||
button.title = base::SysUTF8ToNSString(label);
|
button.title = base::SysUTF8ToNSString(label);
|
||||||
}
|
|
||||||
|
|
||||||
gfx::Image image;
|
gfx::Image image;
|
||||||
if (settings.Get("icon", &image)) {
|
if (settings.Get("icon", &image)) {
|
||||||
|
@ -341,18 +340,17 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
- (void)updatePopover:(NSPopoverTouchBarItem*)item
|
- (void)updatePopover:(NSPopoverTouchBarItem*)item
|
||||||
withSettings:(const mate::PersistentDictionary&)settings {
|
withSettings:(const mate::PersistentDictionary&)settings {
|
||||||
std::string label;
|
std::string label;
|
||||||
if (settings.Get("label", &label)) {
|
settings.Get("label", &label);
|
||||||
item.collapsedRepresentationLabel = base::SysUTF8ToNSString(label);
|
item.collapsedRepresentationLabel = base::SysUTF8ToNSString(label);
|
||||||
}
|
|
||||||
gfx::Image image;
|
gfx::Image image;
|
||||||
if (settings.Get("icon", &image)) {
|
if (settings.Get("icon", &image)) {
|
||||||
item.collapsedRepresentationImage = image.AsNSImage();
|
item.collapsedRepresentationImage = image.AsNSImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool showCloseButton = true;
|
bool showCloseButton = true;
|
||||||
if (settings.Get("showCloseButton", &showCloseButton)) {
|
settings.Get("showCloseButton", &showCloseButton);
|
||||||
item.showsCloseButton = showCloseButton;
|
item.showsCloseButton = showCloseButton;
|
||||||
}
|
|
||||||
|
|
||||||
mate::PersistentDictionary child;
|
mate::PersistentDictionary child;
|
||||||
std::vector<mate::PersistentDictionary> items;
|
std::vector<mate::PersistentDictionary> items;
|
||||||
|
|
Loading…
Reference in a new issue