Project

General

Profile

Bug #1630 » 1630_gtk3.22.patch

Dean Brown, 09/15/2025 12:03 AM

View differences:

client/gui-gtk-3.22/menu.c
static void worklists_callback(GtkMenuItem *item, gpointer data);
static void client_lua_script_callback(GtkMenuItem *item, gpointer data);
static void leave_callback(GtkMenuItem *item, gpointer data);
static void volume_up_callback(GtkMenuItem *item, gpointer data);
static void volume_down_callback(GtkMenuItem *item, gpointer data);
static void quit_callback(GtkMenuItem *item, gpointer data);
static void map_view_callback(GtkMenuItem *item, gpointer data);
static void report_units_callback(GtkMenuItem *item, gpointer data);
......
{ "MAPIMG_SAVE_AS", N_("Save _Map Image As..."), 0, 0,
G_CALLBACK(save_mapimg_as_callback), MGROUP_SAFE },
{ "LEAVE", N_("_Leave"), 0, 0, G_CALLBACK(leave_callback), MGROUP_SAFE },
{ "VOLUME_UP", N_("_Volume Up"), GDK_KEY_greater, 0,
G_CALLBACK(volume_up_callback), MGROUP_SAFE },
{ "VOLUME_DOWN", N_("_Volume Down"), GDK_KEY_less, 0,
G_CALLBACK(volume_down_callback), MGROUP_SAFE },
{ "QUIT", N_("_Quit"), GDK_KEY_q, ACCL_MOD_KEY,
G_CALLBACK(quit_callback), MGROUP_SAFE },
{ "FIND_CITY", N_("_Find City"), GDK_KEY_f, ACCL_MOD_KEY,
......
}
}
/************************************************************************//**
Item "VOLUME_UP" callback.
****************************************************************************/
static void volume_up_callback(GtkMenuItem *item, gpointer data)
{
struct option *poption = optset_option_by_name(client_optset, "sound_effects_volume");
gui_options.sound_effects_volume += 10;
gui_options.sound_effects_volume = CLIP(0, gui_options.sound_effects_volume, 100);
option_changed(poption);
}
/************************************************************************//**
Item "VOLUME_DOWN" callback.
****************************************************************************/
static void volume_down_callback(GtkMenuItem *item, gpointer data)
{
struct option *poption = optset_option_by_name(client_optset, "sound_effects_volume");
gui_options.sound_effects_volume -= 10;
gui_options.sound_effects_volume = CLIP(0, gui_options.sound_effects_volume, 100);
option_changed(poption);
}
/************************************************************************//**
Item "QUIT" callback.
****************************************************************************/
data/gtk3.22_menus.xml
<child>
<object class="GtkMenuItem" id="LEAVE" />
</child>
<child>
<object class="GtkSeparatorMenuItem" />
</child>
<child>
<object class="GtkMenuItem" id="VOLUME_UP" />
</child>
<child>
<object class="GtkMenuItem" id="VOLUME_DOWN" />
</child>
<child>
<object class="GtkSeparatorMenuItem" />
</child>
<child>
<object class="GtkMenuItem" id="QUIT" />
</child>
(1-1/4)