changeset 3041:9fa577253b56

[gaim-migrate @ 3054] hmm committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Wed, 13 Mar 2002 05:14:17 +0000
parents 910fbed99c2e
children 0819c522fc1d
files src/dialogs.c
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Wed Mar 13 04:25:32 2002 +0000
+++ b/src/dialogs.c	Wed Mar 13 05:14:17 2002 +0000
@@ -3317,6 +3317,7 @@
 	GtkWidget *bbox;
 	GSList *smilies;
 	int smiley_count = 0;
+	int total_count = 0;
 
 	if (c->smiley_dialog)
 		return;
@@ -3372,6 +3373,19 @@
 
 		smilies = c->gc->prpl->smiley_list();
 
+		while (smilies) {
+			struct _prpl_smiley *smile =
+				(struct _prpl_smiley *)smilies->data;
+
+			if (smile->show) {
+				total_count++;
+			}
+
+			smilies = g_slist_next(smilies);
+		}
+
+		smilies = c->gc->prpl->smiley_list();
+
 		smiley_box = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
 		gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0);
 
@@ -3381,7 +3395,7 @@
 
 			if (smile->show) {
 
-				if ((!(smiley_count % 4)) && (smiley_count > 0)) {
+				if ((!(smiley_count % ((int)(sqrt(total_count))))) && (smiley_count > 0)) {
 					smiley_box = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS);
 					gtk_box_pack_start(GTK_BOX(vbox), smiley_box, TRUE, TRUE, 0);
 				}