File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919@property (nonatomic , readwrite ) NSString *markdown;
2020@property (nonatomic , readonly ) NSString *html;
2121
22+ - (IBAction )zoomIn : (id )sender ;
23+ - (IBAction )zoomOut : (id )sender ;
24+
2225@end
Original file line number Diff line number Diff line change @@ -1788,9 +1788,6 @@ - (void)updatePreviewBackgroundColorCache
17881788
17891789- (void )scaleWebview
17901790{
1791- if (!self.preferences .previewZoomRelativeToBaseFontSize )
1792- return ;
1793-
17941791 CGFloat fontSize = self.preferences .editorBaseFontSize ;
17951792 if (fontSize <= 0.0 )
17961793 return ;
@@ -1803,6 +1800,24 @@ - (void)scaleWebview
18031800 self.preview .pageZoom = scale;
18041801}
18051802
1803+ - (IBAction )zoomIn : (id )sender
1804+ {
1805+ NSFont *currentFont = self.preferences .editorBaseFont ;
1806+ CGFloat newSize = currentFont.pointSize + 1.0 ;
1807+ NSFont *newFont = [NSFont fontWithName: currentFont.fontName size: newSize];
1808+ self.preferences .editorBaseFont = newFont;
1809+ [self scaleWebview ];
1810+ }
1811+
1812+ - (IBAction )zoomOut : (id )sender
1813+ {
1814+ NSFont *currentFont = self.preferences .editorBaseFont ;
1815+ CGFloat newSize = MAX (currentFont.pointSize - 1.0 , 8.0 );
1816+ NSFont *newFont = [NSFont fontWithName: currentFont.fontName size: newSize];
1817+ self.preferences .editorBaseFont = newFont;
1818+ [self scaleWebview ];
1819+ }
1820+
18061821- (void )updateHeaderLocationsWithCompletion : (void (^)(void ))completion
18071822{
18081823 // Cache the locations of all of the reference nodes in the editor view.
Original file line number Diff line number Diff line change 407407 </connections >
408408 </menuItem >
409409 <menuItem isSeparatorItem =" YES" id =" QMZ-Ld-Nza" />
410+ <menuItem title =" Zoom In" keyEquivalent =" +" id =" zIn-01-ABC" >
411+ <connections >
412+ <action selector =" zoomIn:" target =" -1" id =" zIn-02-DEF" />
413+ </connections >
414+ </menuItem >
415+ <menuItem title =" Zoom Out" keyEquivalent =" -" id =" zOt-01-GHI" >
416+ <connections >
417+ <action selector =" zoomOut:" target =" -1" id =" zOt-02-JKL" />
418+ </connections >
419+ </menuItem >
420+ <menuItem isSeparatorItem =" YES" id =" zSp-01-MNO" />
410421 <menuItem title =" Enter Full Screen" keyEquivalent =" f" id =" 1gz-YB-DZE" >
411422 <modifierMask key =" keyEquivalentModifierMask" control =" YES" command =" YES" />
412423 <connections >
You can’t perform that action at this time.
0 commit comments