summaryrefslogtreecommitdiff
path: root/cocoa/FormSelectMenu.m
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-11-13 22:15:32 +0000
committerVincent Sanders <vince@kyllikki.org>2014-11-13 22:15:32 +0000
commita50d2035a72e1b90ecd267b17a9809a10e5cbeae (patch)
treea31d2a9323a3d258b64fdc778f3243db50d426b0 /cocoa/FormSelectMenu.m
parent79e501075a0c301f435cf579518900e393be6fbf (diff)
downloadnetsurf-a50d2035a72e1b90ecd267b17a9809a10e5cbeae.tar.gz
netsurf-a50d2035a72e1b90ecd267b17a9809a10e5cbeae.tar.bz2
Fix cocoa usage of render internals
Diffstat (limited to 'cocoa/FormSelectMenu.m')
-rw-r--r--cocoa/FormSelectMenu.m11
1 files changed, 9 insertions, 2 deletions
diff --git a/cocoa/FormSelectMenu.m b/cocoa/FormSelectMenu.m
index 842d5108d..27156bcae 100644
--- a/cocoa/FormSelectMenu.m
+++ b/cocoa/FormSelectMenu.m
@@ -22,6 +22,13 @@
#import "desktop/browser.h"
#import "render/form.h"
+static inline NSRect cocoa_rect_for_control( struct browser_window *bw, struct form_control *control)
+{
+ struct rect r;
+ form_control_bounding_rect(control, &r);
+ return cocoa_scaled_rect(browser_window_get_scale(bw), r.x0, r.y0, r.x1, r.y1 );
+}
+
@interface FormSelectMenu ()
- (void) itemSelected: (id) sender;
@@ -79,8 +86,8 @@
cell = [[NSPopUpButtonCell alloc] initTextCell: @"" pullsDown: YES];
[cell setMenu: menu];
-
- const NSRect rect = cocoa_rect_for_box( browser, control->box );
+
+ const NSRect rect = cocoa_rect_for_control(browser, control);
[cell attachPopUpWithFrame: rect inView: view];
[cell performClickWithFrame: rect inView: view];