Ticket #127: nd-close-button.patch

  • src/themes/standard/theme.c

    old new  
    667667    GtkWidget *alignment; 
    668668    AtkObject *atkobj; 
    669669    WindowData *windata; 
     670    GtkRcStyle *rcstyle; 
     671    GtkRequisition size; 
    670672#ifdef USE_COMPOSITE 
    671673    GdkColormap *colormap; 
    672674    GdkScreen *screen; 
     
    762764    atk_object_set_description(atkobj, "Notification summary text."); 
    763765 
    764766    /* 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 
    765771    close_button = gtk_button_new(); 
    766772    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); 
    768774    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); 
    771780    g_signal_connect_swapped(G_OBJECT(close_button), "clicked", 
    772781                             G_CALLBACK(gtk_widget_destroy), win); 
    773782 
     
    779788 
    780789    image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); 
    781790    gtk_widget_show(image); 
     791    gtk_widget_size_request(image, &size); 
    782792    gtk_container_add(GTK_CONTAINER(close_button), image); 
    783793 
     794    gtk_widget_set_size_request(close_button, size.width + 2, size.height + 2); 
     795 
    784796    windata->content_hbox = gtk_hbox_new(FALSE, 6); 
    785797    gtk_box_pack_start(GTK_BOX(vbox), windata->content_hbox, FALSE, FALSE, 0); 
    786798