RANDR - Factor out function to generate strings for refresh rate like '60 Hz'
Signed-off-by: Federico Mena Quintero <federico@novell.com>
This commit is contained in:
parent
dc62815db2
commit
bba301ff9c
1 changed files with 9 additions and 3 deletions
|
@ -378,6 +378,12 @@ rebuild_rotation_combo (App *app)
|
||||||
combo_select (app->rotation_combo, _("Normal"));
|
combo_select (app->rotation_combo, _("Normal"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
make_rate_string (int hz)
|
||||||
|
{
|
||||||
|
return g_strdup_printf (_("%d Hz"), hz);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rebuild_rate_combo (App *app)
|
rebuild_rate_combo (App *app)
|
||||||
{
|
{
|
||||||
|
@ -412,7 +418,7 @@ rebuild_rate_combo (App *app)
|
||||||
height == app->current_output->height)
|
height == app->current_output->height)
|
||||||
{
|
{
|
||||||
add_key (app->refresh_combo,
|
add_key (app->refresh_combo,
|
||||||
idle_free (g_strdup_printf (_("%d Hz"), rate)),
|
idle_free (make_rate_string (rate)),
|
||||||
0, 0, rate, -1);
|
0, 0, rate, -1);
|
||||||
|
|
||||||
if (rate > best)
|
if (rate > best)
|
||||||
|
@ -420,8 +426,8 @@ rebuild_rate_combo (App *app)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!combo_select (app->refresh_combo, idle_free (g_strdup_printf (_("%d Hz"), app->current_output->rate))))
|
if (!combo_select (app->refresh_combo, idle_free (make_rate_string (app->current_output->rate))))
|
||||||
combo_select (app->refresh_combo, idle_free (g_strdup_printf (_("%d Hz"), best)));
|
combo_select (app->refresh_combo, idle_free (make_rate_string (best)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue