diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-05 13:36:16 (EST) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-05 13:36:16 (EST) |
commit | d3ca3e30303956655d546eee8d54253ca07dbd0a (patch) | |
tree | f6f93a85d8701564f92badecf1aea6ee956a3724 /src | |
parent | 40a1aefd92651b1f4faf387b7cb30f6c7f58ca0a (diff) | |
download | marquee-d3ca3e30303956655d546eee8d54253ca07dbd0a.zip marquee-d3ca3e30303956655d546eee8d54253ca07dbd0a.tar.gz marquee-d3ca3e30303956655d546eee8d54253ca07dbd0a.tar.bz2 |
about:profiles: Add "current" class to <span> of current profile
Diffstat (limited to 'src')
-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)), |