pidgin/gtkplugin.c

changeset 22788
113ae3a1f584
parent 22785
d712839ebf36
child 23100
013db96dd9a7
equal deleted inserted replaced
22787:18842b6fda42 22788:113ae3a1f584
600 g_free(author); 600 g_free(author);
601 601
602 return TRUE; 602 return TRUE;
603 } 603 }
604 604
605 static void 605 static gboolean
606 website_button_clicked_cb(GtkButton *button, 606 website_button_motion_cb(GtkWidget *button, GdkEventCrossing *event,
607 gpointer unused) 607 gpointer unused)
608 { 608 {
609 if(plugin_website_uri) 609 if (plugin_website_uri) {
610 pidgin_set_cursor(button, GDK_HAND2);
611 return TRUE;
612 }
613 return FALSE;
614 }
615
616 static gboolean
617 website_button_clicked_cb(GtkButton *button, GdkEventButton *event,
618 gpointer unused)
619 {
620 if (plugin_website_uri) {
610 purple_notify_uri(NULL, plugin_website_uri); 621 purple_notify_uri(NULL, plugin_website_uri);
622 return TRUE;
623 }
624 return FALSE;
611 } 625 }
612 626
613 static GtkWidget * 627 static GtkWidget *
614 create_details() 628 create_details()
615 { 629 {
636 gtk_misc_set_alignment(GTK_MISC(plugin_error), 0, 0); 650 gtk_misc_set_alignment(GTK_MISC(plugin_error), 0, 0);
637 gtk_label_set_line_wrap(plugin_error, FALSE); 651 gtk_label_set_line_wrap(plugin_error, FALSE);
638 gtk_label_set_selectable(plugin_error, TRUE); 652 gtk_label_set_selectable(plugin_error, TRUE);
639 gtk_box_pack_start(vbox, GTK_WIDGET(plugin_error), FALSE, FALSE, 0); 653 gtk_box_pack_start(vbox, GTK_WIDGET(plugin_error), FALSE, FALSE, 0);
640 654
641
642 plugin_author = GTK_LABEL(gtk_label_new(NULL)); 655 plugin_author = GTK_LABEL(gtk_label_new(NULL));
643 gtk_label_set_line_wrap(plugin_author, FALSE); 656 gtk_label_set_line_wrap(plugin_author, FALSE);
644 gtk_misc_set_alignment(GTK_MISC(plugin_author), 0, 0); 657 gtk_misc_set_alignment(GTK_MISC(plugin_author), 0, 0);
645 gtk_label_set_selectable(plugin_author, TRUE); 658 gtk_label_set_selectable(plugin_author, TRUE);
646 pidgin_add_widget_to_vbox(vbox, "", sg, 659 pidgin_add_widget_to_vbox(vbox, "", sg,
647 GTK_WIDGET(plugin_author), TRUE, &label); 660 GTK_WIDGET(plugin_author), TRUE, &label);
648 gtk_label_set_markup(GTK_LABEL(label), _("<b>Written by:</b>")); 661 gtk_label_set_markup(GTK_LABEL(label), _("<b>Written by:</b>"));
649 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 662 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
650 663
651 website_button = gtk_button_new(); 664 website_button = gtk_event_box_new();
665 #if GTK_CHECK_VERSION(2,4,0)
666 gtk_event_box_set_visible_window(GTK_EVENT_BOX(website_button), FALSE);
667 #endif
668
652 plugin_website = GTK_LABEL(gtk_label_new(NULL)); 669 plugin_website = GTK_LABEL(gtk_label_new(NULL));
653 #if GTK_CHECK_VERSION(2,6,0) 670 #if GTK_CHECK_VERSION(2,6,0)
654 g_object_set(G_OBJECT(website_button), 671 g_object_set(G_OBJECT(plugin_website),
655 "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL); 672 "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL);
656 #endif 673 #endif
657 gtk_misc_set_alignment(GTK_MISC(plugin_website), 0, 0); 674 gtk_misc_set_alignment(GTK_MISC(plugin_website), 0, 0);
658 gtk_container_add(GTK_CONTAINER(website_button), 675 gtk_container_add(GTK_CONTAINER(website_button),
659 GTK_WIDGET(plugin_website)); 676 GTK_WIDGET(plugin_website));
660 gtk_button_set_relief(GTK_BUTTON(website_button), GTK_RELIEF_NONE); 677 g_signal_connect(website_button, "button-release-event",
661 g_signal_connect(website_button, "clicked", 678 G_CALLBACK(website_button_clicked_cb), NULL);
662 (GCallback)website_button_clicked_cb, NULL); 679 g_signal_connect(website_button, "enter-notify-event",
680 G_CALLBACK(website_button_motion_cb), NULL);
681 g_signal_connect(website_button, "leave-notify-event",
682 G_CALLBACK(pidgin_clear_cursor), NULL);
663 683
664 pidgin_add_widget_to_vbox(vbox, "", sg, website_button, TRUE, &label); 684 pidgin_add_widget_to_vbox(vbox, "", sg, website_button, TRUE, &label);
665 gtk_label_set_markup(GTK_LABEL(label), _("<b>Web site:</b>")); 685 gtk_label_set_markup(GTK_LABEL(label), _("<b>Web site:</b>"));
666 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 686 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
667 687

mercurial