pidgin/pidgin

Remove pidgin_get_dim_grey_string

2022-02-03, Gary Kramlich
64805b295a5c
Parents 3bad98fa1f0c
Children 330cfcc1404d
Remove pidgin_get_dim_grey_string

This should probably be replaced with CSS or something, but it was only used to
display topics for chats and status names in the status box, both of which are
probably going to get their ui's overhauled in the near future anyways.

Testing Done:
Compiled and ran locally.

Reviewed at https://reviews.imfreedom.org/r/1285/
--- a/ChangeLog.API Thu Feb 03 22:13:28 2022 -0600
+++ b/ChangeLog.API Thu Feb 03 22:14:31 2022 -0600
@@ -877,6 +877,7 @@
* pidgin_dialog_get_vbox_with_properties
* pidgin_dialogs_alias_contact
* pidgin_dialogs_log
+ * pidgin_get_dim_grey_string
* PIDGIN_ICON_SIZE_*
* PIDGIN_ICON_THEME
* PIDGIN_ICON_THEME_CLASS
--- a/pidgin/gtkconv.c Thu Feb 03 22:13:28 2022 -0600
+++ b/pidgin/gtkconv.c Thu Feb 03 22:14:31 2022 -0600
@@ -2666,12 +2666,11 @@
unaliased_esc = unaliased ? g_markup_escape_text(unaliased, -1) : NULL;
title_esc = g_markup_escape_text(title, -1);
- markup = g_strdup_printf("%s%s<span size='smaller'>%s</span>%s<span color='%s' size='smaller'>%s</span>",
+ markup = g_strdup_printf("%s%s<span size='smaller'>%s</span>%s<span size='smaller'>%s</span>",
title_esc,
unaliased_esc ? " " : "",
unaliased_esc ? unaliased_esc : "",
topic_esc && *topic_esc ? "\n" : "",
- pidgin_get_dim_grey_string(gtkconv->infopane),
topic_esc ? topic_esc : "");
g_free(title_esc);
--- a/pidgin/gtkstatusbox.c Thu Feb 03 22:13:28 2022 -0600
+++ b/pidgin/gtkstatusbox.c Thu Feb 03 22:14:31 2022 -0600
@@ -433,7 +433,6 @@
static void
pidgin_status_box_refresh(PidginStatusBox *status_box)
{
- const char *aa_color;
PurpleSavedStatus *saved_status;
char *primary, *secondary, *text;
const char *icon_name = NULL;
@@ -493,15 +492,14 @@
icon_name = pidgin_icon_name_from_status_primitive(prim, "user-offline");
}
- aa_color = pidgin_get_dim_grey_string(GTK_WIDGET(status_box));
if (status_box->account != NULL) {
- text = g_strdup_printf("%s - <span size=\"smaller\" color=\"%s\">%s</span>",
+ text = g_strdup_printf("%s - <span size=\"smaller\">%s</span>",
purple_account_get_username(status_box->account),
- aa_color, secondary ? secondary : primary);
+ secondary ? secondary : primary);
emblem = pidgin_create_protocol_icon(status_box->account, PIDGIN_PROTOCOL_ICON_SMALL);
} else if (secondary != NULL) {
- text = g_strdup_printf("%s<span size=\"smaller\" color=\"%s\"> - %s</span>",
- primary, aa_color, secondary);
+ text = g_strdup_printf("%s<span size=\"smaller\"> - %s</span>",
+ primary, secondary);
} else {
text = g_strdup(primary);
}
@@ -1599,16 +1597,12 @@
}
else
{
- const char *aa_color;
gchar *escaped_title, *escaped_desc;
- aa_color = pidgin_get_dim_grey_string(GTK_WIDGET(status_box));
-
escaped_title = g_markup_escape_text(title, -1);
escaped_desc = g_markup_escape_text(desc, -1);
- text = g_strdup_printf("%s - <span color=\"%s\" size=\"smaller\">%s</span>",
- escaped_title,
- aa_color, escaped_desc);
+ text = g_strdup_printf("%s - <span size=\"smaller\">%s</span>",
+ escaped_title, escaped_desc);
g_free(escaped_title);
g_free(escaped_desc);
}
--- a/pidgin/gtkutils.c Thu Feb 03 22:13:28 2022 -0600
+++ b/pidgin/gtkutils.c Thu Feb 03 22:14:31 2022 -0600
@@ -1712,30 +1712,6 @@
return result;
}
-const char *pidgin_get_dim_grey_string(GtkWidget *widget) {
- static char dim_grey_string[8] = "";
- GtkStyleContext *context;
- GdkRGBA fg, bg;
-
- if (!widget)
- return "dim grey";
-
- context = gtk_widget_get_style_context(widget);
- if (!context)
- return "dim grey";
-
- gtk_style_context_get_color(context, gtk_style_context_get_state(context),
- &fg);
- gtk_style_context_get_background_color(context,
- gtk_style_context_get_state(context),
- &bg);
- g_snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x",
- (unsigned int)((fg.red + bg.red) * 0.5 * 255),
- (unsigned int)((fg.green + bg.green) * 0.5 * 255),
- (unsigned int)((fg.blue + bg.blue) * 0.5 * 255));
- return dim_grey_string;
-}
-
static void
combo_box_changed_cb(GtkComboBoxText *combo_box, GtkEntry *entry)
{
--- a/pidgin/gtkutils.h Thu Feb 03 22:13:28 2022 -0600
+++ b/pidgin/gtkutils.h Thu Feb 03 22:14:31 2022 -0600
@@ -364,17 +364,6 @@
const gchar *key, GtkTreeIter *iter, gpointer data);
/**
- * pidgin_get_dim_grey_string:
- * @widget: The widget to return dim grey for
- *
- * Returns an HTML-style color string for use as a dim grey
- * string
- *
- * Returns: The dim grey string
- */
-const char *pidgin_get_dim_grey_string(GtkWidget *widget);
-
-/**
* pidgin_text_combo_box_entry_new:
* @default_item: Initial contents of GtkEntry
* @items: (element-type utf8): GList containing strings to add to GtkComboBox