pidgin/pidgin

Use icon names for chat emblems

2021-10-12, Elliott Sales de Andrade
13d97dcd0e67
Parents 1599afdbe1d7
Children a0be5525d8bd
Use icon names for chat emblems

Testing Done:
Joined devel@conference.pidgin.im and saw op/half-op/voice emblems on chat list. Not sure about the unassigned emblem as nobody has no role there.

Reviewed at https://reviews.imfreedom.org/r/1035/
Binary file pidgin/data/icons/hicolor/16x16/emblems/emblem-founder.png has changed
Binary file pidgin/data/icons/hicolor/16x16/emblems/emblem-half-operator.png has changed
Binary file pidgin/data/icons/hicolor/16x16/emblems/emblem-operator.png has changed
Binary file pidgin/data/icons/hicolor/16x16/emblems/emblem-voice.png has changed
--- a/pidgin/gtkconv.c Tue Oct 12 03:22:28 2021 -0500
+++ b/pidgin/gtkconv.c Tue Oct 12 03:50:01 2021 -0500
@@ -2442,22 +2442,20 @@
static const char *
get_chat_user_status_icon(PurpleChatConversation *chat, const char *name, PurpleChatUserFlags flags)
{
- const char *image = NULL;
+ const gchar *icon_name = NULL;
if (flags & PURPLE_CHAT_USER_FOUNDER) {
- image = PIDGIN_STOCK_STATUS_FOUNDER;
+ icon_name = "pidgin-status-founder";
} else if (flags & PURPLE_CHAT_USER_OP) {
- image = PIDGIN_STOCK_STATUS_OPERATOR;
+ icon_name = "pidgin-status-operator";
} else if (flags & PURPLE_CHAT_USER_HALFOP) {
- image = PIDGIN_STOCK_STATUS_HALFOP;
+ icon_name = "pidgin-status-halfop";
} else if (flags & PURPLE_CHAT_USER_VOICE) {
- image = PIDGIN_STOCK_STATUS_VOICE;
+ icon_name = "pidgin-status-voice";
} else if ((!flags) && purple_chat_conversation_is_ignored_user(chat, name)) {
- image = PIDGIN_STOCK_STATUS_IGNORED;
- } else {
- return NULL;
+ icon_name = "pidgin-status-ignored";
}
- return image;
+ return icon_name;
}
static void
@@ -2470,7 +2468,7 @@
GtkTreeModel *tm;
GtkListStore *ls;
GtkTreePath *newpath;
- const char *stock;
+ const gchar *icon_name;
GtkTreeIter iter;
gboolean is_buddy;
const gchar *name, *alias;
@@ -2493,7 +2491,7 @@
tm = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list));
ls = GTK_LIST_STORE(tm);
- stock = get_chat_user_status_icon(chat, name, flags);
+ icon_name = get_chat_user_status_icon(chat, name, flags);
is_buddy = purple_chat_user_is_buddy(cb);
@@ -2512,7 +2510,7 @@
* Inserting in the "wrong" location has no visible ill effects. - F.P.
*/
-1, /* "row" */
- CHAT_USERS_ICON_STOCK_COLUMN, stock,
+ CHAT_USERS_ICON_NAME_COLUMN, icon_name,
CHAT_USERS_ALIAS_COLUMN, alias,
CHAT_USERS_ALIAS_KEY_COLUMN, alias_key,
CHAT_USERS_NAME_COLUMN, name,
@@ -2920,7 +2918,7 @@
"stock-size", gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL),
NULL);
col = gtk_tree_view_column_new_with_attributes(NULL, rend,
- "stock-id", CHAT_USERS_ICON_STOCK_COLUMN, NULL);
+ "icon-name", CHAT_USERS_ICON_NAME_COLUMN, NULL);
gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
gtk_tree_view_append_column(GTK_TREE_VIEW(list), col);
ul_width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/conversations/chat/userlist_width");
--- a/pidgin/gtkconv.h Tue Oct 12 03:22:28 2021 -0500
+++ b/pidgin/gtkconv.h Tue Oct 12 03:50:01 2021 -0500
@@ -64,7 +64,7 @@
CHAT_USERS_FLAGS_COLUMN,
CHAT_USERS_COLOR_COLUMN,
CHAT_USERS_WEIGHT_COLUMN,
- CHAT_USERS_ICON_STOCK_COLUMN,
+ CHAT_USERS_ICON_NAME_COLUMN,
CHAT_USERS_COLUMNS
};
--- a/pidgin/pidginstock.c Tue Oct 12 03:22:28 2021 -0500
+++ b/pidgin/pidginstock.c Tue Oct 12 03:50:01 2021 -0500
@@ -114,12 +114,6 @@
const SizedStockIcon sized_stock_icons [] = {
- { PIDGIN_STOCK_STATUS_IGNORED, "emblems", "emblem-blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_STATUS_FOUNDER, "emblems", "emblem-founder.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_STATUS_OPERATOR, "emblems", "emblem-operator.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_STATUS_HALFOP, "emblems", "emblem-half-operator.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
- { PIDGIN_STOCK_STATUS_VOICE, "emblems", "emblem-voice.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
-
{ PIDGIN_STOCK_TOOLBAR_BGCOLOR, "actions", "change-bgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
{ PIDGIN_STOCK_TOOLBAR_BLOCK, "emblems", "emblem-blocked.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
{ PIDGIN_STOCK_TOOLBAR_FGCOLOR, "actions", "change-fgcolor.png", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
--- a/pidgin/pidginstock.h Tue Oct 12 03:22:28 2021 -0500
+++ b/pidgin/pidginstock.h Tue Oct 12 03:50:01 2021 -0500
@@ -86,13 +86,6 @@
#define PIDGIN_STOCK_STATUS_PERSON "pidgin-status-person"
#define PIDGIN_STOCK_STATUS_MESSAGE "pidgin-status-message"
-/* Chat room emblems */
-#define PIDGIN_STOCK_STATUS_IGNORED "pidgin-status-ignored"
-#define PIDGIN_STOCK_STATUS_FOUNDER "pidgin-status-founder"
-#define PIDGIN_STOCK_STATUS_OPERATOR "pidgin-status-operator"
-#define PIDGIN_STOCK_STATUS_HALFOP "pidgin-status-halfop"
-#define PIDGIN_STOCK_STATUS_VOICE "pidgin-status-voice"
-
/* Toolbar (and menu) icons */
#define PIDGIN_STOCK_TOOLBAR_ACCOUNTS "pidgin-accounts"
#define PIDGIN_STOCK_TOOLBAR_BGCOLOR "pidgin-bgcolor"
Binary file pidgin/resources/icons/16x16/emblems/pidgin-status-founder.png has changed
Binary file pidgin/resources/icons/16x16/emblems/pidgin-status-halfop.png has changed
Binary file pidgin/resources/icons/16x16/emblems/pidgin-status-ignored.png has changed
Binary file pidgin/resources/icons/16x16/emblems/pidgin-status-operator.png has changed
Binary file pidgin/resources/icons/16x16/emblems/pidgin-status-voice.png has changed
--- a/pidgin/resources/pidgin.gresource.xml Tue Oct 12 03:22:28 2021 -0500
+++ b/pidgin/resources/pidgin.gresource.xml Tue Oct 12 03:50:01 2021 -0500
@@ -41,5 +41,10 @@
<file>icons/16x16/status/pidgin-user-invisible.png</file>
<file>icons/16x16/status/pidgin-user-offline.png</file>
<file>icons/16x16/status/pidgin-user-unavailable.png</file>
+ <file>icons/16x16/emblems/pidgin-status-founder.png</file>
+ <file>icons/16x16/emblems/pidgin-status-halfop.png</file>
+ <file>icons/16x16/emblems/pidgin-status-ignored.png</file>
+ <file>icons/16x16/emblems/pidgin-status-operator.png</file>
+ <file>icons/16x16/emblems/pidgin-status-voice.png</file>
</gresource>
</gresources>