Ticket #127: nd-close-button.patch
-
src/themes/standard/theme.c
old new 667 667 GtkWidget *alignment; 668 668 AtkObject *atkobj; 669 669 WindowData *windata; 670 GtkRcStyle *rcstyle; 671 GtkRequisition size; 670 672 #ifdef USE_COMPOSITE 671 673 GdkColormap *colormap; 672 674 GdkScreen *screen; … … 762 764 atk_object_set_description(atkobj, "Notification summary text."); 763 765 764 766 /* Add the close button */ 767 alignment = gtk_alignment_new(1.0, 0.0, 0.0, 0.0); 768 gtk_widget_show(alignment); 769 gtk_box_pack_start(GTK_BOX(hbox), alignment, FALSE, FALSE, 0); 770 765 771 close_button = gtk_button_new(); 766 772 gtk_widget_show(close_button); 767 gtk_ box_pack_start(GTK_BOX(hbox), close_button, FALSE, FALSE, 0);773 gtk_container_add(GTK_CONTAINER(alignment), close_button); 768 774 gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE); 769 gtk_container_set_border_width(GTK_CONTAINER(close_button), 0); 770 gtk_widget_set_size_request(close_button, 20, 20); 775 gtk_button_set_focus_on_click(GTK_BUTTON(close_button), FALSE); 776 rcstyle = gtk_rc_style_new(); 777 rcstyle->xthickness = rcstyle->ythickness = 0; 778 gtk_widget_modify_style(close_button, rcstyle); 779 gtk_rc_style_unref(rcstyle); 771 780 g_signal_connect_swapped(G_OBJECT(close_button), "clicked", 772 781 G_CALLBACK(gtk_widget_destroy), win); 773 782 … … 779 788 780 789 image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); 781 790 gtk_widget_show(image); 791 gtk_widget_size_request(image, &size); 782 792 gtk_container_add(GTK_CONTAINER(close_button), image); 783 793 794 gtk_widget_set_size_request(close_button, size.width + 2, size.height + 2); 795 784 796 windata->content_hbox = gtk_hbox_new(FALSE, 6); 785 797 gtk_box_pack_start(GTK_BOX(vbox), windata->content_hbox, FALSE, FALSE, 0); 786 798
