From d3ca3e30303956655d546eee8d54253ca07dbd0a Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 05 Nov 2017 13:36:16 -0500 Subject: about:profiles: Add "current" class to of current profile --- (limited to 'src/schemes/about/profiles.c') 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 * . */ @@ -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)), -- cgit v0.9.1