positioningItem => positioning_item
This commit is contained in:
parent
ea9b0cfed0
commit
360266ba5b
5 changed files with 12 additions and 11 deletions
|
@ -52,8 +52,9 @@ class Menu : public mate::TrackableObject<Menu>,
|
||||||
void MenuWillShow(ui::SimpleMenuModel* source) override;
|
void MenuWillShow(ui::SimpleMenuModel* source) override;
|
||||||
|
|
||||||
virtual void Popup(Window* window) = 0;
|
virtual void Popup(Window* window) = 0;
|
||||||
virtual void PopupAt(Window* window, int x, int y,
|
virtual void PopupAt(Window* window,
|
||||||
int positioningItem = 0) = 0;
|
int x = -1, int y = -1,
|
||||||
|
int positioning_item = 0) = 0;
|
||||||
|
|
||||||
scoped_ptr<AtomMenuModel> model_;
|
scoped_ptr<AtomMenuModel> model_;
|
||||||
Menu* parent_;
|
Menu* parent_;
|
||||||
|
|
|
@ -20,7 +20,7 @@ class MenuMac : public Menu {
|
||||||
MenuMac();
|
MenuMac();
|
||||||
|
|
||||||
void Popup(Window* window) override;
|
void Popup(Window* window) override;
|
||||||
void PopupAt(Window* window, int x, int y, int positioningItem = 0) override;
|
void PopupAt(Window* window, int x, int y, int positioning_item = 0) override;
|
||||||
|
|
||||||
base::scoped_nsobject<AtomMenuController> menu_controller_;
|
base::scoped_nsobject<AtomMenuController> menu_controller_;
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ void MenuMac::Popup(Window* window) {
|
||||||
forView:web_contents->GetContentNativeView()];
|
forView:web_contents->GetContentNativeView()];
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuMac::PopupAt(Window* window, int x, int y, int positioningItem) {
|
void MenuMac::PopupAt(Window* window, int x, int y, int positioning_item) {
|
||||||
NativeWindow* native_window = window->window();
|
NativeWindow* native_window = window->window();
|
||||||
if (!native_window)
|
if (!native_window)
|
||||||
return;
|
return;
|
||||||
|
@ -64,13 +64,13 @@ void MenuMac::PopupAt(Window* window, int x, int y, int positioningItem) {
|
||||||
NSView* view = web_contents->GetContentNativeView();
|
NSView* view = web_contents->GetContentNativeView();
|
||||||
|
|
||||||
// Show the menu.
|
// Show the menu.
|
||||||
if (positioningItem >= [menu numberOfItems]) {
|
if (positioning_item >= [menu numberOfItems]) {
|
||||||
positioningItem = [menu numberOfItems] - 1;
|
positioning_item = [menu numberOfItems] - 1;
|
||||||
}
|
}
|
||||||
if (positioningItem < 0) {
|
if (positioning_item < 0) {
|
||||||
positioningItem = 0;
|
positioning_item = 0;
|
||||||
}
|
}
|
||||||
[menu popUpMenuPositioningItem:[menu itemAtIndex:positioningItem]
|
[menu popUpMenupositioning_item:[menu itemAtIndex:positioning_item]
|
||||||
atLocation:NSMakePoint(x, [view frame].size.height - y)
|
atLocation:NSMakePoint(x, [view frame].size.height - y)
|
||||||
inView:view];
|
inView:view];
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ void MenuViews::Popup(Window* window) {
|
||||||
PopupAtPoint(window, gfx::Screen::GetNativeScreen()->GetCursorScreenPoint());
|
PopupAtPoint(window, gfx::Screen::GetNativeScreen()->GetCursorScreenPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuViews::PopupAt(Window* window, int x, int y, int positioningItem) {
|
void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item) {
|
||||||
NativeWindow* native_window = static_cast<NativeWindow*>(window->window());
|
NativeWindow* native_window = static_cast<NativeWindow*>(window->window());
|
||||||
if (!native_window)
|
if (!native_window)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -18,7 +18,7 @@ class MenuViews : public Menu {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Popup(Window* window) override;
|
void Popup(Window* window) override;
|
||||||
void PopupAt(Window* window, int x, int y, int positioningItem = 0) override;
|
void PopupAt(Window* window, int x, int y, int positioning_item = 0) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void PopupAtPoint(Window* window, const gfx::Point& point);
|
void PopupAtPoint(Window* window, const gfx::Point& point);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue