[Xfce4-commits] [apps/xfce4-terminal] 01/01: Restore title color when unclosing a tab

noreply at xfce.org noreply at xfce.org
Sun May 27 20:54:41 CEST 2018


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

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-terminal.

commit 6f86cf46b955f1849944c8419fe0306db1f9ecdd
Author: Igor <f2404 at yandex.ru>
Date:   Sun May 27 14:54:33 2018 -0400

    Restore title color when unclosing a tab
---
 terminal/terminal-options.c | 1 +
 terminal/terminal-options.h | 1 +
 terminal/terminal-screen.c  | 9 +++++++++
 terminal/terminal-screen.h  | 1 +
 terminal/terminal-window.c  | 8 +++++++-
 5 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/terminal/terminal-options.c b/terminal/terminal-options.c
index 7f2b541..21b72c9 100644
--- a/terminal/terminal-options.c
+++ b/terminal/terminal-options.c
@@ -656,6 +656,7 @@ terminal_tab_attr_free (TerminalTabAttr *attr)
   g_free (attr->initial_title);
   g_free (attr->color_text);
   g_free (attr->color_bg);
+  g_free (attr->color_title);
   g_slice_free (TerminalTabAttr, attr);
 }
 
diff --git a/terminal/terminal-options.h b/terminal/terminal-options.h
index 4fb1314..b227474 100644
--- a/terminal/terminal-options.h
+++ b/terminal/terminal-options.h
@@ -60,6 +60,7 @@ typedef struct
   gchar        *initial_title;
   gchar        *color_text;
   gchar        *color_bg;
+  gchar        *color_title;
   TerminalTitle dynamic_title_mode;
   gint          position;
   guint         hold : 1;
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 94248e3..a7b1b80 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -2839,6 +2839,15 @@ terminal_screen_get_custom_bg_color (TerminalScreen *screen)
 
 
 
+const gchar *
+terminal_screen_get_custom_title_color (TerminalScreen *screen)
+{
+  terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
+  return screen->custom_title_color;
+}
+
+
+
 void
 terminal_screen_set_custom_title_color (TerminalScreen *screen,
                                         const gchar    *color)
diff --git a/terminal/terminal-screen.h b/terminal/terminal-screen.h
index 4cd1164..6aa2792 100644
--- a/terminal/terminal-screen.h
+++ b/terminal/terminal-screen.h
@@ -134,6 +134,7 @@ const gchar    *terminal_screen_get_custom_fg_color       (TerminalScreen *scree
 
 const gchar    *terminal_screen_get_custom_bg_color       (TerminalScreen *screen);
 
+const gchar    *terminal_screen_get_custom_title_color    (TerminalScreen *screen);
 void            terminal_screen_set_custom_title_color    (TerminalScreen *screen,
                                                            const gchar    *color);
 
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 4b2f8e6..8207d85 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -1112,6 +1112,8 @@ terminal_window_close_tab_request (TerminalScreen *screen,
                              g_strdup (terminal_screen_get_custom_fg_color (screen)) : NULL;
       tab_attr->color_bg = IS_STRING (terminal_screen_get_custom_bg_color (screen)) ?
                            g_strdup (terminal_screen_get_custom_bg_color (screen)) : NULL;
+      tab_attr->color_title = IS_STRING (terminal_screen_get_custom_title_color (screen)) ?
+                              g_strdup (terminal_screen_get_custom_title_color (screen)) : NULL;
       g_queue_push_tail (window->priv->closed_tabs_list, tab_attr);
 
       gtk_widget_destroy (GTK_WIDGET (screen));
@@ -1633,7 +1635,11 @@ terminal_window_action_undo_close_tab (GtkAction      *action,
   terminal = terminal_screen_new (tab_attr, window->priv->grid_width, window->priv->grid_height);
   terminal_window_add (window, terminal);
 
-  /* set unclosed tab position */
+  /* restore tab title color */
+  if (tab_attr->color_title != NULL)
+    terminal_screen_set_custom_title_color (terminal, tab_attr->color_title);
+
+  /* restore tab position */
   gtk_notebook_reorder_child (GTK_NOTEBOOK (window->priv->notebook), GTK_WIDGET (terminal), tab_attr->position);
 
   /* restore tab focus if the unclosed one wasn't active when it was closed */

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


More information about the Xfce4-commits mailing list