hasTBDict -> hasItemWithID
This commit is contained in:
parent
48515d9ecc
commit
cf7cd1f32b
2 changed files with 8 additions and 8 deletions
|
@ -34,7 +34,7 @@
|
||||||
- (void)clear;
|
- (void)clear;
|
||||||
|
|
||||||
- (NSString*)idFromIdentifier:(NSString*)identifier withPrefix:(NSString*)prefix;
|
- (NSString*)idFromIdentifier:(NSString*)identifier withPrefix:(NSString*)prefix;
|
||||||
- (bool)hasTBDict:(const std::string&)id;
|
- (bool)hasItemWithID:(const std::string&)id;
|
||||||
- (NSColor*)colorFromHexColorString:(const std::string&)colorString;
|
- (NSColor*)colorFromHexColorString:(const std::string&)colorString;
|
||||||
|
|
||||||
// Selector actions
|
// Selector actions
|
||||||
|
|
|
@ -150,7 +150,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
return [identifier substringFromIndex:[prefix length]];
|
return [identifier substringFromIndex:[prefix length]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (bool)hasTBDict:(const std::string&)id {
|
- (bool)hasItemWithID:(const std::string&)id {
|
||||||
return item_id_map.find(id) != item_id_map.end();
|
return item_id_map.find(id) != item_id_map.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
- (NSTouchBarItem*)makeButtonForID:(NSString*)id
|
- (NSTouchBarItem*)makeButtonForID:(NSString*)id
|
||||||
withIdentifier:(NSString*)identifier {
|
withIdentifier:(NSString*)identifier {
|
||||||
std::string s_id([id UTF8String]);
|
std::string s_id([id UTF8String]);
|
||||||
if (![self hasTBDict:s_id]) return nil;
|
if (![self hasItemWithID:s_id]) return nil;
|
||||||
|
|
||||||
mate::PersistentDictionary options = item_id_map[s_id];
|
mate::PersistentDictionary options = item_id_map[s_id];
|
||||||
NSCustomTouchBarItem* item = [[NSClassFromString(@"NSCustomTouchBarItem") alloc] initWithIdentifier:identifier];
|
NSCustomTouchBarItem* item = [[NSClassFromString(@"NSCustomTouchBarItem") alloc] initWithIdentifier:identifier];
|
||||||
|
@ -214,7 +214,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
- (NSTouchBarItem*)makeLabelForID:(NSString*)id
|
- (NSTouchBarItem*)makeLabelForID:(NSString*)id
|
||||||
withIdentifier:(NSString*)identifier {
|
withIdentifier:(NSString*)identifier {
|
||||||
std::string s_id([id UTF8String]);
|
std::string s_id([id UTF8String]);
|
||||||
if (![self hasTBDict:s_id]) return nil;
|
if (![self hasItemWithID:s_id]) return nil;
|
||||||
|
|
||||||
mate::PersistentDictionary item = item_id_map[s_id];
|
mate::PersistentDictionary item = item_id_map[s_id];
|
||||||
NSCustomTouchBarItem* customItem = [[NSClassFromString(@"NSCustomTouchBarItem") alloc] initWithIdentifier:identifier];
|
NSCustomTouchBarItem* customItem = [[NSClassFromString(@"NSCustomTouchBarItem") alloc] initWithIdentifier:identifier];
|
||||||
|
@ -240,7 +240,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
- (NSTouchBarItem*)makeColorPickerForID:(NSString*)id
|
- (NSTouchBarItem*)makeColorPickerForID:(NSString*)id
|
||||||
withIdentifier:(NSString*)identifier {
|
withIdentifier:(NSString*)identifier {
|
||||||
std::string s_id([id UTF8String]);
|
std::string s_id([id UTF8String]);
|
||||||
if (![self hasTBDict:s_id]) return nil;
|
if (![self hasItemWithID:s_id]) return nil;
|
||||||
|
|
||||||
mate::PersistentDictionary options = item_id_map[s_id];
|
mate::PersistentDictionary options = item_id_map[s_id];
|
||||||
NSColorPickerTouchBarItem* item = [[NSClassFromString(@"NSColorPickerTouchBarItem") alloc] initWithIdentifier:identifier];
|
NSColorPickerTouchBarItem* item = [[NSClassFromString(@"NSColorPickerTouchBarItem") alloc] initWithIdentifier:identifier];
|
||||||
|
@ -261,7 +261,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
- (NSTouchBarItem*)makeSliderForID:(NSString*)id
|
- (NSTouchBarItem*)makeSliderForID:(NSString*)id
|
||||||
withIdentifier:(NSString*)identifier {
|
withIdentifier:(NSString*)identifier {
|
||||||
std::string s_id([id UTF8String]);
|
std::string s_id([id UTF8String]);
|
||||||
if (![self hasTBDict:s_id]) return nil;
|
if (![self hasItemWithID:s_id]) return nil;
|
||||||
|
|
||||||
mate::PersistentDictionary options = item_id_map[s_id];
|
mate::PersistentDictionary options = item_id_map[s_id];
|
||||||
NSSliderTouchBarItem* item = [[NSClassFromString(@"NSSliderTouchBarItem") alloc] initWithIdentifier:identifier];
|
NSSliderTouchBarItem* item = [[NSClassFromString(@"NSSliderTouchBarItem") alloc] initWithIdentifier:identifier];
|
||||||
|
@ -297,7 +297,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
- (NSTouchBarItem*)makePopoverForID:(NSString*)id
|
- (NSTouchBarItem*)makePopoverForID:(NSString*)id
|
||||||
withIdentifier:(NSString*)identifier {
|
withIdentifier:(NSString*)identifier {
|
||||||
std::string s_id = std::string([id UTF8String]);
|
std::string s_id = std::string([id UTF8String]);
|
||||||
if (![self hasTBDict:s_id]) return nil;
|
if (![self hasItemWithID:s_id]) return nil;
|
||||||
|
|
||||||
mate::PersistentDictionary options = item_id_map[s_id];
|
mate::PersistentDictionary options = item_id_map[s_id];
|
||||||
NSPopoverTouchBarItem* item = [[NSClassFromString(@"NSPopoverTouchBarItem") alloc] initWithIdentifier:identifier];
|
NSPopoverTouchBarItem* item = [[NSClassFromString(@"NSPopoverTouchBarItem") alloc] initWithIdentifier:identifier];
|
||||||
|
@ -334,7 +334,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
- (NSTouchBarItem*)makeGroupForID:(NSString*)id
|
- (NSTouchBarItem*)makeGroupForID:(NSString*)id
|
||||||
withIdentifier:(NSString*)identifier {
|
withIdentifier:(NSString*)identifier {
|
||||||
std::string s_id([id UTF8String]);
|
std::string s_id([id UTF8String]);
|
||||||
if (![self hasTBDict:s_id]) return nil;
|
if (![self hasItemWithID:s_id]) return nil;
|
||||||
mate::PersistentDictionary options = item_id_map[s_id];
|
mate::PersistentDictionary options = item_id_map[s_id];
|
||||||
|
|
||||||
std::vector<mate::PersistentDictionary> items;
|
std::vector<mate::PersistentDictionary> items;
|
||||||
|
|
Loading…
Reference in a new issue