Commit 17a722aa authored by Felix Paul Kühne's avatar Felix Paul Kühne

NSFontManager's setTarget isn't defined in 10.4u, so we need to intercept the...

NSFontManager's setTarget isn't defined in 10.4u, so we need to intercept the firstResponder chain in order to get notified of the font change.

Yes, better don't ask. and no, NSFontManager doesn't provide changeFont as a delegate facility. That's incorrect documentation if you look at the header..
parent 4f0f2c2c
......@@ -166,6 +166,11 @@
"o_video_view" = id;
};
SUPERCLASS = NSObject;
},
{
CLASS = VLCSimplePrefsWindow;
LANGUAGE = ObjC;
SUPERCLASS = NSWindow;
}
);
IBVersion = 1;
......
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>69 69 356 240 0 0 1280 778 </string>
<string>75 91 356 240 0 0 1280 778 </string>
<key>IBEditorPositions</key>
<dict>
<key>2311</key>
......@@ -23,11 +23,11 @@
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>1530</integer>
<integer>2668</integer>
<integer>2677</integer>
<integer>2330</integer>
<integer>2265</integer>
<integer>2668</integer>
<integer>1530</integer>
<integer>2677</integer>
</array>
<key>IBSystem Version</key>
<string>9E17</string>
......
......@@ -196,6 +196,7 @@
- (IBAction)osdSettingChanged:(id)sender;
- (IBAction)showFontPicker:(id)sender;
- (void)showOSDSettings;
- (void)changeFont:(id)sender;
/* input & codecs */
- (IBAction)inputSettingChanged:(id)sender;
......@@ -213,3 +214,7 @@
@interface VLCHotkeyChangeWindow : NSWindow
@end
@interface VLCSimplePrefsWindow : NSWindow
@end
......@@ -1132,7 +1132,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
NSFont * font = [NSFont fontWithDescriptor:[fd fontDescriptorWithFamily:fontFamilyName] textTransform:nil];
[[NSFontManager sharedFontManager] setSelectedFont:font isMultiple:NO];
}
[[NSFontManager sharedFontManager] setTarget:self];
[[NSFontManager sharedFontManager] setDelegate: self];
[o_sprefs_win makeFirstResponder: o_sprefs_win];
[[NSFontPanel sharedFontPanel] orderFront:self];
}
......@@ -1319,3 +1320,16 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
}
@end
@implementation VLCSimplePrefsWindow
- (BOOL)acceptsFirstResponder
{
return YES;
}
- (void)changeFont:(id)sender
{
[[[VLCMain sharedInstance] getSimplePreferences] changeFont: sender];
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment