mirror of https://github.com/snes9xgit/snes9x.git
GTK: Add right-click menu.
This commit is contained in:
parent
83505d88c2
commit
54ba8798b5
|
@ -276,19 +276,32 @@ event_button_press (GtkWidget *widget,
|
||||||
GdkEventButton *event,
|
GdkEventButton *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
auto window = (Snes9xWindow *)user_data;
|
||||||
|
|
||||||
|
if (S9xIsMousePluggedIn())
|
||||||
|
{
|
||||||
switch (event->button)
|
switch (event->button)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
S9xReportButton (BINDING_MOUSE_BUTTON0, 1);
|
S9xReportButton(BINDING_MOUSE_BUTTON0, 1);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
S9xReportButton (BINDING_MOUSE_BUTTON1, 1);
|
S9xReportButton(BINDING_MOUSE_BUTTON2, 1);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
S9xReportButton (BINDING_MOUSE_BUTTON2, 1);
|
S9xReportButton(BINDING_MOUSE_BUTTON1, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (event->button == 3)
|
||||||
|
{
|
||||||
|
#if GTK_MAJOR_VERSION >= 3
|
||||||
|
gtk_menu_popup_at_pointer(GTK_MENU(window->get_widget("view_menu_menu")), NULL);
|
||||||
|
#else
|
||||||
|
gtk_menu_popup(GTK_MENU(window->get_widget("view_menu_menu")), NULL,
|
||||||
|
NULL, NULL, NULL, 3, event->time);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1660,7 +1660,7 @@
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImageMenuItem" id="hide_ui">
|
<object class="GtkImageMenuItem" id="hide_ui">
|
||||||
<property name="label" translatable="yes">_Hide Menu</property>
|
<property name="label" translatable="yes">_Toggle Menubar</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
|
|
Loading…
Reference in New Issue