Commit 538eb829 authored by Murray Cumming's avatar Murray Cumming
Browse files

gmenu: Add attach_to_widget() calls for context menus.

This makes them actually work.
parent fa0c6597
......@@ -528,6 +528,7 @@ void Box_Data_Calendar_Related::setup_menu(Gtk::Widget* /* this */)
menu->append(_("_Layout"), "context.layout");
m_pMenuPopup = new Gtk::Menu(menu);
m_pMenuPopup->attach_to_widget(*this);
#ifndef GLOM_ENABLE_CLIENT_ONLY
if(pApp)
......
......@@ -265,7 +265,7 @@ void DbAddDel::setup_menu(Gtk::Widget* /* widget */)
#endif
m_pMenuPopup = new Gtk::Menu(menu);
m_pMenuPopup->attach_to_widget(*this);
if(get_allow_user_actions())
{
......
......@@ -877,6 +877,7 @@ void Window_PrintLayout_Edit::setup_context_menu()
g_warning("GMenu not found");
m_context_menu = new Gtk::Menu(gmenu);
m_context_menu->attach_to_widget(*this);
}
bool Window_PrintLayout_Edit::on_canvas_motion_notify_event(GdkEventMotion* event)
......
......@@ -451,14 +451,8 @@ void Dialog_RelationshipsOverview::on_table_show_context(guint button, guint32 a
sigc::bind( sigc::mem_fun(*this, &Dialog_RelationshipsOverview::on_context_menu_edit_relationships), table ));
}
if(!m_context_menu->get_attach_widget())
{
m_context_menu->attach_to_widget(*this);
}
if(m_context_menu)
m_context_menu->popup(button, activate_time);
}
void Dialog_RelationshipsOverview::setup_context_menu()
......@@ -479,6 +473,7 @@ void Dialog_RelationshipsOverview::setup_context_menu()
g_warning("GMenu not found");
m_context_menu = new Gtk::Menu(gmenu);
m_context_menu->attach_to_widget(*this);
}
void Dialog_RelationshipsOverview::on_context_menu_edit_fields(const Glib::VariantBase& /* parameter */, Glib::RefPtr<CanvasGroupDbTable> table)
......
......@@ -293,6 +293,7 @@ void Canvas_PrintLayout::setup_context_menu()
menu->append(_("_Formatting"), "context.formatting");
menu->append(_("_Delete"), "context.delete");
m_context_menu = new Gtk::Menu(menu);
m_context_menu->attach_to_widget(*this);
}
......
......@@ -251,6 +251,7 @@ void AddDel::setup_menu(Gtk::Widget* /* widget */)
menu->append(_("_Delete"), "context.delete");
m_pMenuPopup = new Gtk::Menu(menu);
m_pMenuPopup->attach_to_widget(*this);
}
bool AddDel::on_button_press_event_Popup(GdkEventButton *event)
......
......@@ -185,6 +185,7 @@ private:
//Get the menu:
m_context_menu = new Gtk::Menu(menu);
m_context_menu->attach_to_widget(*this);
}
Gtk::Menu* m_context_menu;
......
......@@ -961,6 +961,7 @@ void ImageGlom::setup_menu_usermode()
menu->append(_("_Clear"), "context.clear");
m_pMenuPopup_UserMode = new Gtk::Menu(menu);
m_pMenuPopup_UserMode->attach_to_widget(*this);
}
void ImageGlom::do_choose_image()
......@@ -981,11 +982,6 @@ void ImageGlom::popup_menu(guint button, guint32 activate_time)
return;
}
if(!m_pMenuPopup_UserMode->get_attach_widget())
{
m_pMenuPopup_UserMode->attach_to_widget(*this);
}
m_pMenuPopup_UserMode->popup(button, activate_time);
m_refActionSelectFile->set_enabled();
......
......@@ -127,6 +127,7 @@ void LayoutWidgetMenu::setup_menu(Gtk::Widget* widget)
m_pMenuPopup = new Gtk::Menu(menu);
m_pMenuPopup->attach_to_widget(*widget);
if(pApp)
m_refContextLayout->set_enabled(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER);
......
......@@ -59,6 +59,7 @@ void LayoutWidgetUtils::setup_util_menu(Gtk::Widget* widget)
menu->append(_("_Delete"), "context.delete");
m_pPopupMenuUtils = new Gtk::Menu(menu);
m_pPopupMenuUtils->attach_to_widget(*widget);
#endif
}
......
......@@ -125,6 +125,7 @@ void NotebookLabel::setup_menu(Gtk::Widget* /* widget */)
menu->append(_("_Delete"), "context.delete");
m_pPopupMenu = new Gtk::Menu(menu);
m_pPopupMenu->attach_to_widget(*this);
}
bool NotebookLabel::on_button_press_event(GdkEventButton *event)
......
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