mirror of
https://github.com/textmate/textmate.git
synced 2026-01-22 13:17:55 -05:00
Refactor theme selection to pass through OakDocumentView
This commit is contained in:
committed by
Allan Odgaard
parent
c0f65b6101
commit
dc810607b2
@@ -29,6 +29,8 @@
|
||||
- (IBAction)toggleLineNumbers:(id)sender;
|
||||
- (IBAction)takeThemeUUIDFrom:(id)sender;
|
||||
|
||||
- (void)setThemeWithUUID:(NSString*)themeUUID;
|
||||
|
||||
- (void)addAuxiliaryView:(NSView*)aView atEdge:(NSRectEdge)anEdge;
|
||||
- (void)removeAuxiliaryView:(NSView*)aView;
|
||||
@end
|
||||
|
||||
@@ -562,8 +562,12 @@ private:
|
||||
|
||||
- (IBAction)takeThemeUUIDFrom:(id)sender
|
||||
{
|
||||
NSString* themeUUID = [sender representedObject];
|
||||
if(bundles::item_ptr themeItem = bundles::lookup(to_s(themeUUID)))
|
||||
[self setThemeWithUUID:[sender representedObject]];
|
||||
}
|
||||
|
||||
- (void)setThemeWithUUID:(NSString*)themeUUID
|
||||
{
|
||||
if(bundles::item_ptr const& themeItem = bundles::lookup(to_s(themeUUID)))
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:themeUUID forKey:kUserDefaultsThemeUUIDKey];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
@@ -800,7 +800,8 @@ static std::string shell_quote (std::vector<std::string> paths)
|
||||
|
||||
case bundles::kItemTypeTheme:
|
||||
{
|
||||
[self setTheme:parse_theme(item)];
|
||||
OakDocumentView* documentView = (OakDocumentView*)[[self enclosingScrollView] superview];
|
||||
[documentView setThemeWithUUID:[NSString stringWithCxxString:item->uuid()]];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user