[Xfce4-commits] [apps/xfce4-terminal] 01/01: Replace deprecated gtk_alignment_new call

noreply at xfce.org noreply at xfce.org
Wed Jun 29 15:52:10 CEST 2016


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit e27ece7558fe54b0ccfb76d0cd44103cb52a327e
Author: Igor <f2404 at yandex.ru>
Date:   Wed Jun 29 16:52:05 2016 +0300

    Replace deprecated gtk_alignment_new call
---
 terminal/terminal-screen.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 380a4fd..cc8bc50 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -2141,8 +2141,7 @@ terminal_screen_reset_activity (TerminalScreen *screen)
 GtkWidget *
 terminal_screen_get_tab_label (TerminalScreen *screen)
 {
-  GtkWidget *hbox;
-  GtkWidget *button, *image, *align;
+  GtkWidget *hbox, *button, *image;
 
   terminal_return_val_if_fail (TERMINAL_IS_SCREEN (screen), NULL);
 
@@ -2164,12 +2163,6 @@ terminal_screen_get_tab_label (TerminalScreen *screen)
   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);
-  g_object_bind_property (G_OBJECT (screen->preferences), "misc-tab-close-buttons",
-                          G_OBJECT (align), "visible",
-                          G_BINDING_SYNC_CREATE);
-
   button = gtk_button_new ();
 #if GTK_CHECK_VERSION (3,20,0)
   gtk_widget_set_focus_on_click (button, FALSE);
@@ -2180,7 +2173,9 @@ terminal_screen_get_tab_label (TerminalScreen *screen)
   gtk_widget_set_can_focus (button, FALSE);
   gtk_widget_set_can_default (button, FALSE);
   gtk_widget_set_tooltip_text (button, _("Close this tab"));
-  gtk_container_add (GTK_CONTAINER (align), button);
+  gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
+  gtk_container_add (GTK_CONTAINER (hbox), button);
   g_signal_connect_swapped (G_OBJECT (button), "clicked",
                             G_CALLBACK (gtk_widget_destroy), screen);
   gtk_widget_show (button);
@@ -2196,6 +2191,11 @@ terminal_screen_get_tab_label (TerminalScreen *screen)
   /* update orientation */
   terminal_screen_update_label_orientation (screen);
 
+  /* respect the show/hide buttons option */
+  g_object_bind_property (G_OBJECT (screen->preferences), "misc-tab-close-buttons",
+                          G_OBJECT (button), "visible",
+                          G_BINDING_SYNC_CREATE);
+
   return hbox;
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list