Implement view menu items, and support zoom
This commit is contained in:
parent
dcd04e53d9
commit
e560bc8720
|
@ -71,6 +71,11 @@ struct form_control;
|
||||||
-(void)findPrevious: (NSString*)needle matchCase: (BOOL)matchCase sender: (id)sender;
|
-(void)findPrevious: (NSString*)needle matchCase: (BOOL)matchCase sender: (id)sender;
|
||||||
-(void)showAll: (NSString*)needle matchCase: (BOOL)matchCase sender: (id)sender;
|
-(void)showAll: (NSString*)needle matchCase: (BOOL)matchCase sender: (id)sender;
|
||||||
-(void)bookmarkPage: (id)sender;
|
-(void)bookmarkPage: (id)sender;
|
||||||
|
-(void)zoomIn: (id)sender;
|
||||||
|
-(void)zoomOut: (id)sender;
|
||||||
|
-(void)resetZoom: (id)sender;
|
||||||
|
-(void)reload: (id)sender;
|
||||||
|
-(void)stopLoading: (id)sender;
|
||||||
|
|
||||||
-(void)showDropdownMenuWithOptions: (NSArray*)options atLocation: (NSPoint)location inTab: (id)tab control: (struct form_control*)control;
|
-(void)showDropdownMenuWithOptions: (NSArray*)options atLocation: (NSPoint)location inTab: (id)tab control: (struct form_control*)control;
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ static id newTabTarget;
|
||||||
}
|
}
|
||||||
-(void)updateBrowserExtentForTab: (id)tab {
|
-(void)updateBrowserExtentForTab: (id)tab {
|
||||||
int width, height;
|
int width, height;
|
||||||
browser_window_get_extents([tab browser], false, &width, &height);
|
browser_window_get_extents([tab browser], true, &width, &height);
|
||||||
NSLog(@"set frame to size: %d, %d", width, height);
|
NSLog(@"set frame to size: %d, %d", width, height);
|
||||||
[[tab plotView] setFrame: NSMakeRect(0, 0, width, height)];
|
[[tab plotView] setFrame: NSMakeRect(0, 0, width, height)];
|
||||||
}
|
}
|
||||||
|
@ -353,6 +353,27 @@ static id newTabTarget;
|
||||||
[bmController release];
|
[bmController release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(void)zoomIn: (id)sender {
|
||||||
|
[plotView zoomIn: sender];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)zoomOut: (id)sender {
|
||||||
|
[plotView zoomOut: sender];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)resetZoom: (id)sender {
|
||||||
|
[plotView resetZoom: sender];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)reload: (id)sender {
|
||||||
|
[plotView reload: sender];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)stopLoading: (id)sender {
|
||||||
|
[plotView stopReloading: sender];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
-(NSString*)visibleUrl {
|
-(NSString*)visibleUrl {
|
||||||
return [[self currentWebsiteForTab: activeTab] url];
|
return [[self currentWebsiteForTab: activeTab] url];
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,4 +17,7 @@
|
||||||
-(void)reload: (id)sender;
|
-(void)reload: (id)sender;
|
||||||
-(void)stopReloading: (id)sender;
|
-(void)stopReloading: (id)sender;
|
||||||
-(void)showDropdownMenuWithOptions: (NSArray*)options atLocation: (NSPoint)location control: (struct form_control*)control;
|
-(void)showDropdownMenuWithOptions: (NSArray*)options atLocation: (NSPoint)location control: (struct form_control*)control;
|
||||||
|
-(void)zoomIn: (id)sender;
|
||||||
|
-(void)zoomOut: (id)sender;
|
||||||
|
-(void)resetZoom: (id)sender;
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -328,11 +328,6 @@ static const struct plotter_table gnustep_plotters = {
|
||||||
|
|
||||||
- (NSPoint) convertMousePoint: (NSEvent *)event {
|
- (NSPoint) convertMousePoint: (NSEvent *)event {
|
||||||
NSPoint location = [self convertPoint: [event locationInWindow] fromView: nil];
|
NSPoint location = [self convertPoint: [event locationInWindow] fromView: nil];
|
||||||
float bscale = browser_window_get_scale(browser);
|
|
||||||
|
|
||||||
location.x /= bscale;
|
|
||||||
location.y /= bscale;
|
|
||||||
|
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,4 +812,16 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) {
|
||||||
NSLog(@"Failed to process selection");
|
NSLog(@"Failed to process selection");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(void)resetZoom: (id)sender {
|
||||||
|
browser_window_set_scale(browser, 1.0, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)zoomIn: (id)sender {
|
||||||
|
browser_window_set_scale(browser, 0.05, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)zoomOut: (id)sender {
|
||||||
|
browser_window_set_scale(browser, -0.05, false);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -19,16 +19,21 @@
|
||||||
"didTapNewWindow:",
|
"didTapNewWindow:",
|
||||||
"findNext:",
|
"findNext:",
|
||||||
"findPrevious:",
|
"findPrevious:",
|
||||||
"newTab:",
|
|
||||||
"newFolder:",
|
"newFolder:",
|
||||||
|
"newTab:",
|
||||||
|
"reload:",
|
||||||
"remove:",
|
"remove:",
|
||||||
"removeAll:",
|
"removeAll:",
|
||||||
|
"resetZoom:",
|
||||||
"showAll:",
|
"showAll:",
|
||||||
"showBookmarksWindow:",
|
"showBookmarksWindow:",
|
||||||
"showDownloadsWindow:",
|
"showDownloadsWindow:",
|
||||||
"showFindPanel:",
|
"showFindPanel:",
|
||||||
"showHistoryWindow:",
|
"showHistoryWindow:",
|
||||||
"showPreferencesWindow:"
|
"showPreferencesWindow:",
|
||||||
|
"stopLoading:",
|
||||||
|
"zoomIn:",
|
||||||
|
"zoomOut:"
|
||||||
);
|
);
|
||||||
Super = NSObject;
|
Super = NSObject;
|
||||||
};
|
};
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue