pidgin/gtkimhtmltoolbar.c

branch
cpw.qulogic.gtk3-required
changeset 33182
a7f503e12c8b
parent 33177
d5af963e67c9
child 33661
2ebcb105e606
equal deleted inserted replaced
33181:0d5d682c57f7 33182:a7f503e12c8b
676 gtk_container_add(GTK_CONTAINER(button), image); 676 gtk_container_add(GTK_CONTAINER(button), image);
677 677
678 g_object_set_data(G_OBJECT(button), "smiley_text", face); 678 g_object_set_data(G_OBJECT(button), "smiley_text", face);
679 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(insert_smiley_text), toolbar); 679 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(insert_smiley_text), toolbar);
680 680
681 #if GTK_CHECK_VERSION(2,12,0)
682 gtk_widget_set_tooltip_text(button, face); 681 gtk_widget_set_tooltip_text(button, face);
683 #else
684 gtk_tooltips_set_tip(toolbar->tooltips, button, face, NULL);
685 #endif
686 682
687 /* these look really weird with borders */ 683 /* these look really weird with borders */
688 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); 684 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
689 685
690 psmiley = purple_smileys_find_by_shortcut(smiley->smile); 686 psmiley = purple_smileys_find_by_shortcut(smiley->smile);
694 if (supports_custom && psmiley && !(smiley->flags & GTK_IMHTML_SMILEY_CUSTOM)) { 690 if (supports_custom && psmiley && !(smiley->flags & GTK_IMHTML_SMILEY_CUSTOM)) {
695 gchar tip[128]; 691 gchar tip[128];
696 g_snprintf(tip, sizeof(tip), 692 g_snprintf(tip, sizeof(tip),
697 _("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"), 693 _("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"),
698 face); 694 face);
699 #if GTK_CHECK_VERSION(2,12,0)
700 gtk_widget_set_tooltip_text(button, tip); 695 gtk_widget_set_tooltip_text(button, tip);
701 #else
702 gtk_tooltips_set_tip(toolbar->tooltips, button, tip, NULL);
703 #endif
704 gtk_widget_set_sensitive(button, FALSE); 696 gtk_widget_set_sensitive(button, FALSE);
705 } else if (psmiley) { 697 } else if (psmiley) {
706 /* Remove the button if the smiley is destroyed */ 698 /* Remove the button if the smiley is destroyed */
707 g_signal_connect_object(G_OBJECT(psmiley), "destroy", G_CALLBACK(gtk_widget_destroy), 699 g_signal_connect_object(G_OBJECT(psmiley), "destroy", G_CALLBACK(gtk_widget_destroy),
708 button, G_CONNECT_SWAPPED); 700 button, G_CONNECT_SWAPPED);
1283 button = pidgin_pixbuf_toolbar_button_from_stock(buttons[iter].stock); 1275 button = pidgin_pixbuf_toolbar_button_from_stock(buttons[iter].stock);
1284 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(gtk_imhtmltoolbar_popup_menu), toolbar); 1276 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(gtk_imhtmltoolbar_popup_menu), toolbar);
1285 g_signal_connect(G_OBJECT(button), "clicked", 1277 g_signal_connect(G_OBJECT(button), "clicked",
1286 G_CALLBACK(buttons[iter].callback), toolbar); 1278 G_CALLBACK(buttons[iter].callback), toolbar);
1287 *(buttons[iter].button) = button; 1279 *(buttons[iter].button) = button;
1288 #if GTK_CHECK_VERSION(2,12,0)
1289 gtk_widget_set_tooltip_text(button, buttons[iter].tooltip); 1280 gtk_widget_set_tooltip_text(button, buttons[iter].tooltip);
1290 #else
1291 gtk_tooltips_set_tip(toolbar->tooltips, button, buttons[iter].tooltip, NULL);
1292 #endif
1293 } else 1281 } else
1294 button = gtk_vseparator_new(); 1282 button = gtk_vseparator_new();
1295 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 1283 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1296 } 1284 }
1297 1285

mercurial