Project

General

Profile

Bug #312 » 0032-gtk4-x-Remove-use-of-format-value-signal.patch

main - Marko Lindqvist, 03/20/2024 04:33 AM

View differences:

client/gui-gtk-4.0/gamedlgs.c
return scale * pmul->step + pmul->start;
}
/**********************************************************************//**
Format value for multiplier scales
**************************************************************************/
static gchar *multiplier_value_callback(GtkScale *scale, gdouble value,
void *udata)
{
const struct multiplier *pmul = udata;
return g_strdup_printf("%d", scale_to_mult(pmul, value));
}
/**********************************************************************//**
User has responded to multipliers dialog
**************************************************************************/
......
mscale = mult_to_scale(pmul, pmul->stop) / 10;
gtk_range_set_increments(GTK_RANGE(multipliers_scale[multiplier]),
1, MAX(2, mscale));
g_signal_connect(multipliers_scale[multiplier], "format-value",
G_CALLBACK(multiplier_value_callback), pmul);
g_signal_connect(multipliers_scale[multiplier], "destroy",
G_CALLBACK(widget_destroyed),
&multipliers_scale[multiplier]);
client/gui-gtk-5.0/gamedlgs.c
return scale * pmul->step + pmul->start;
}
/**********************************************************************//**
Format value for multiplier scales
**************************************************************************/
static gchar *multiplier_value_callback(GtkScale *scale, gdouble value,
void *udata)
{
const struct multiplier *pmul = udata;
return g_strdup_printf("%d", scale_to_mult(pmul, value));
}
/**********************************************************************//**
User has responded to multipliers dialog
**************************************************************************/
......
mscale = mult_to_scale(pmul, pmul->stop) / 10;
gtk_range_set_increments(GTK_RANGE(multipliers_scale[multiplier]),
1, MAX(2, mscale));
g_signal_connect(multipliers_scale[multiplier], "format-value",
G_CALLBACK(multiplier_value_callback), pmul);
g_signal_connect(multipliers_scale[multiplier], "destroy",
G_CALLBACK(widget_destroyed),
&multipliers_scale[multiplier]);
(1-1/2)