diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c index a5312eb..749fd3c 100644 --- a/terminal/terminal-screen.c +++ b/terminal/terminal-screen.c @@ -1966,7 +1966,16 @@ terminal_screen_reset_activity (TerminalScreen *screen) } } +static void +notebook_tab_close_button_style_set (GtkWidget *btn, GtkRcStyle *prev_style, + gpointer data) +{ + gint w, h; + gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (btn), + GTK_ICON_SIZE_MENU, &w, &h); + gtk_widget_set_size_request (btn, w + 2, h + 2); +} GtkWidget * terminal_screen_get_tab_label (TerminalScreen *screen) @@ -1978,21 +1987,22 @@ terminal_screen_get_tab_label (TerminalScreen *screen) terminal_return_val_if_fail (TERMINAL_IS_SCREEN (screen), NULL); /* create the box */ - hbox = gtk_hbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 3); + hbox = gtk_hbox_new (FALSE, 2); + //gtk_container_set_border_width (GTK_CONTAINER (hbox), 3); gtk_widget_show (hbox); screen->tab_label = gtk_label_new (NULL); - gtk_misc_set_padding (GTK_MISC (screen->tab_label), 2, 0); + //gtk_misc_set_padding (GTK_MISC (screen->tab_label), 2, 0); gtk_box_pack_start (GTK_BOX (hbox), screen->tab_label, TRUE, TRUE, 0); - exo_binding_new (G_OBJECT (screen), "title", G_OBJECT (screen->tab_label), "label"); + exo_binding_new (G_OBJECT (screen), "title", + G_OBJECT (screen->tab_label), "label"); exo_binding_new (G_OBJECT (screen->tab_label), "label", G_OBJECT (screen->tab_label), "tooltip-text"); gtk_widget_set_has_tooltip (screen->tab_label, TRUE); gtk_widget_show (screen->tab_label); - align = gtk_alignment_new (0.5f, 0.5f, 0.0f, 0.0f); - gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, FALSE, 0); + align = gtk_alignment_new (1.0f, 0.5f, 0.0f, 0.0f); + gtk_box_pack_start (GTK_BOX (hbox), align, TRUE, TRUE, 0); exo_binding_new (G_OBJECT (screen->preferences), "misc-tab-close-buttons", G_OBJECT (align), "visible"); @@ -2006,11 +2016,12 @@ terminal_screen_get_tab_label (TerminalScreen *screen) G_CALLBACK (gtk_widget_destroy), screen); gtk_widget_show (button); - /* make button a bit smaller */ - style = gtk_rc_style_new (); - style->xthickness = style->ythickness = 0; - gtk_widget_modify_style (button, style); - g_object_unref (G_OBJECT (style)); + /* handle style modification to keep button small as possible even when theme + change. + Taken from Geany Proyect */ + g_signal_connect (GTK_BUTTON (button), "style-set", + G_CALLBACK (notebook_tab_close_button_style_set), NULL); + /* button image */ image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c index 0d461a4..6dabc21 100644 --- a/terminal/terminal-window.c +++ b/terminal/terminal-window.c @@ -377,10 +377,10 @@ terminal_window_init (TerminalWindow *window) G_OBJECT (window->notebook), "tab-pos"); /* hide the ugly terminal border when tabs are shown */ - style = gtk_rc_style_new (); + /* style = gtk_rc_style_new (); style->xthickness = style->ythickness = 0; gtk_widget_modify_style (window->notebook, style); - g_object_unref (G_OBJECT (style)); + g_object_unref (G_OBJECT (style));*/ /* set the notebook group id */ gtk_notebook_set_group (GTK_NOTEBOOK (window->notebook), @@ -748,7 +748,6 @@ terminal_window_rebuild_gomenu (TerminalWindow *window) /* create action */ radio_action = gtk_radio_action_new (name, NULL, NULL, NULL, n); - gtk_action_set_sensitive (GTK_ACTION (radio_action), npages > 1); exo_binding_new (G_OBJECT (page), "title", G_OBJECT (radio_action), "label"); gtk_radio_action_set_group (radio_action, group); group = gtk_radio_action_get_group (radio_action);