diff options
Diffstat (limited to 'src/schemes')
-rw-r--r-- | src/schemes/about/profiles.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/schemes/about/profiles.c b/src/schemes/about/profiles.c index eb9454b..a31110a 100644 --- a/src/schemes/about/profiles.c +++ b/src/schemes/about/profiles.c @@ -34,14 +34,16 @@ static gchar * generate_div(MqProfiles *profiles, gchar *id) { - gchar *name; - gchar *color; - gchar *editing_str; - gchar *name_str; - gchar *default_str; - gchar *delete_str; - gchar *save_str; - gchar *div; + gchar *name; + gchar *color; + gchar *editing_str; + gchar *name_str; + gchar *default_str; + gchar *delete_str; + gchar *save_str; + gchar *div; + gchar *current; + gboolean is_current; /* name is freed by the mq_html_container() call to generate the name * <span>. */ @@ -59,11 +61,16 @@ generate_div(MqProfiles *profiles, gchar *id) delete_str = g_strconcat("delete_", id, NULL); save_str = g_strconcat("save_", id, NULL); + current = mq_profiles_get_current(profiles); + is_current = (g_strcmp0(id, current) == 0); + g_free(current); + div = mq_html_container("div", "profile", mq_html_input_radio("editing", editing_str, id, NULL, id == NULL), mq_profile_icon_new(color), - mq_html_container("span", NULL, name, NULL), + mq_html_container("span", is_current ? "current" : NULL, name, + NULL), mq_html_input_text(name_str, NULL, name), mq_html_submit(default_str, "Make Default", !id || mq_profiles_is_default(profiles, id)), |