[Xfce4-commits] [apps/xfce4-terminal] 01/01: Rename "Tab label color" to "Title color"

noreply at xfce.org noreply at xfce.org
Sun May 27 20:39:29 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 3c3de8949aec07f9292a1f591da55a57ebab440c
Author: Igor <f2404 at yandex.ru>
Date:   Sun May 27 14:38:38 2018 -0400

    Rename "Tab label color" to "Title color"
---
 terminal/terminal-screen.c      |  24 +++----
 terminal/terminal-screen.h      | 136 ++++++++++++++++++++--------------------
 terminal/terminal-window-ui.xml |   7 +--
 terminal/terminal-window.c      |  50 +++++++--------
 4 files changed, 108 insertions(+), 109 deletions(-)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 6b1d8bc..94248e3 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -190,7 +190,7 @@ struct _TerminalScreen
 
   gchar               *custom_fg_color;
   gchar               *custom_bg_color;
-  gchar               *custom_tab_label_color;
+  gchar               *custom_title_color;
 
   TerminalTitle        dynamic_title_mode;
   guint                hold : 1;
@@ -379,7 +379,7 @@ terminal_screen_finalize (GObject *object)
   g_free (screen->initial_title);
   g_free (screen->custom_fg_color);
   g_free (screen->custom_bg_color);
-  g_free (screen->custom_tab_label_color);
+  g_free (screen->custom_title_color);
 
   (*G_OBJECT_CLASS (terminal_screen_parent_class)->finalize) (object);
 }
@@ -1488,9 +1488,9 @@ terminal_screen_reset_activity_timeout (gpointer user_data)
     return FALSE;
 
   /* unset */
-  if (G_LIKELY (screen->custom_tab_label_color == NULL))
+  if (G_LIKELY (screen->custom_title_color == NULL))
     gtk_label_set_attributes (GTK_LABEL (screen->tab_label), NULL);
-  else if (gdk_rgba_parse (&label_color, screen->custom_tab_label_color))
+  else if (gdk_rgba_parse (&label_color, screen->custom_title_color))
     terminal_screen_set_tab_label_color (screen, &label_color);
 
   if (terminal_preferences_get_color (screen->preferences, "tab-activity-color", &active_color))
@@ -1547,9 +1547,9 @@ terminal_screen_vte_window_contents_changed (TerminalScreen *screen)
   has_color = terminal_preferences_get_color (screen->preferences, "tab-activity-color", &color);
   if (G_LIKELY (has_color))
     terminal_screen_set_tab_label_color (screen, &color);
-  else if (G_LIKELY (screen->custom_tab_label_color == NULL))
+  else if (G_LIKELY (screen->custom_title_color == NULL))
     gtk_label_set_attributes (GTK_LABEL (screen->tab_label), NULL);
-  else if (gdk_rgba_parse (&label_color, screen->custom_tab_label_color))
+  else if (gdk_rgba_parse (&label_color, screen->custom_title_color))
     terminal_screen_set_tab_label_color (screen, &label_color);
 
   /* stop running reset timeout */
@@ -2449,9 +2449,9 @@ terminal_screen_reset_activity (TerminalScreen *screen)
 
   if (screen->tab_label != NULL)
     {
-      if (G_LIKELY (screen->custom_tab_label_color == NULL))
+      if (G_LIKELY (screen->custom_title_color == NULL))
         gtk_label_set_attributes (GTK_LABEL (screen->tab_label), NULL);
-      else if (gdk_rgba_parse (&label_color, screen->custom_tab_label_color))
+      else if (gdk_rgba_parse (&label_color, screen->custom_title_color))
         terminal_screen_set_tab_label_color (screen, &label_color);
     }
 }
@@ -2840,8 +2840,8 @@ terminal_screen_get_custom_bg_color (TerminalScreen *screen)
 
 
 void
-terminal_screen_set_custom_tab_label_color (TerminalScreen *screen,
-                                            const gchar    *color)
+terminal_screen_set_custom_title_color (TerminalScreen *screen,
+                                        const gchar    *color)
 {
   GdkRGBA label_color;
 
@@ -2849,8 +2849,8 @@ terminal_screen_set_custom_tab_label_color (TerminalScreen *screen,
 
   if (gdk_rgba_parse (&label_color, color))
     {
-      g_free (screen->custom_tab_label_color);
-      screen->custom_tab_label_color = g_strdup (color);
+      g_free (screen->custom_title_color);
+      screen->custom_title_color = g_strdup (color);
       terminal_screen_set_tab_label_color (screen, &label_color);
     }
 }
diff --git a/terminal/terminal-screen.h b/terminal/terminal-screen.h
index e0c5e5c..4cd1164 100644
--- a/terminal/terminal-screen.h
+++ b/terminal/terminal-screen.h
@@ -36,106 +36,106 @@ G_BEGIN_DECLS
 typedef struct _TerminalScreenClass TerminalScreenClass;
 typedef struct _TerminalScreen      TerminalScreen;
 
-GType           terminal_screen_get_type                   (void) G_GNUC_CONST;
+GType           terminal_screen_get_type                  (void) G_GNUC_CONST;
 
-TerminalScreen *terminal_screen_new                        (TerminalTabAttr *attr,
-                                                            glong            columns,
-                                                            glong            rows);
+TerminalScreen *terminal_screen_new                       (TerminalTabAttr *attr,
+                                                           glong            columns,
+                                                           glong            rows);
 
-void            terminal_screen_launch_child               (TerminalScreen *screen);
+void            terminal_screen_launch_child              (TerminalScreen *screen);
 
-const gchar    *terminal_screen_get_custom_title           (TerminalScreen *screen);
-void            terminal_screen_set_custom_title           (TerminalScreen *screen,
-                                                            const gchar    *title);
+const gchar    *terminal_screen_get_custom_title          (TerminalScreen *screen);
+void            terminal_screen_set_custom_title          (TerminalScreen *screen,
+                                                           const gchar    *title);
 
-void            terminal_screen_get_size                   (TerminalScreen *screen,
-                                                            glong          *width_chars,
-                                                            glong          *height_chars);
-void            terminal_screen_set_size                   (TerminalScreen *screen,
-                                                            glong           width_chars,
-                                                            glong           height_chars);
+void            terminal_screen_get_size                  (TerminalScreen *screen,
+                                                           glong          *width_chars,
+                                                           glong          *height_chars);
+void            terminal_screen_set_size                  (TerminalScreen *screen,
+                                                           glong           width_chars,
+                                                           glong           height_chars);
 
-void            terminal_screen_get_geometry               (TerminalScreen *screen,
-                                                            glong          *char_width,
-                                                            glong          *char_height,
-                                                            gint           *xpad,
-                                                            gint           *ypad);
+void            terminal_screen_get_geometry              (TerminalScreen *screen,
+                                                           glong          *char_width,
+                                                           glong          *char_height,
+                                                           gint           *xpad,
+                                                           gint           *ypad);
 
-void            terminal_screen_set_window_geometry_hints  (TerminalScreen *screen,
-                                                            GtkWindow      *window);
+void            terminal_screen_set_window_geometry_hints (TerminalScreen *screen,
+                                                           GtkWindow      *window);
 
-void            terminal_screen_force_resize_window        (TerminalScreen *screen,
-                                                            GtkWindow      *window,
-                                                            glong           force_columns,
-                                                            glong           force_rows);
+void            terminal_screen_force_resize_window       (TerminalScreen *screen,
+                                                           GtkWindow      *window,
+                                                           glong           force_columns,
+                                                           glong           force_rows);
 
-gchar          *terminal_screen_get_title                  (TerminalScreen *screen);
+gchar          *terminal_screen_get_title                 (TerminalScreen *screen);
 
-const gchar    *terminal_screen_get_working_directory      (TerminalScreen *screen);
-void            terminal_screen_set_working_directory      (TerminalScreen *screen,
-                                                            const gchar    *directory);
+const gchar    *terminal_screen_get_working_directory     (TerminalScreen *screen);
+void            terminal_screen_set_working_directory     (TerminalScreen *screen,
+                                                           const gchar    *directory);
 
-gboolean        terminal_screen_has_selection              (TerminalScreen *screen);
+gboolean        terminal_screen_has_selection             (TerminalScreen *screen);
 
-void            terminal_screen_copy_clipboard             (TerminalScreen *screen);
+void            terminal_screen_copy_clipboard            (TerminalScreen *screen);
 #if VTE_CHECK_VERSION (0, 49, 2)
-void            terminal_screen_copy_clipboard_html        (TerminalScreen *screen);
+void            terminal_screen_copy_clipboard_html       (TerminalScreen *screen);
 #endif
-void            terminal_screen_paste_clipboard            (TerminalScreen *screen);
-void            terminal_screen_paste_primary              (TerminalScreen *screen);
+void            terminal_screen_paste_clipboard           (TerminalScreen *screen);
+void            terminal_screen_paste_primary             (TerminalScreen *screen);
 
-void            terminal_screen_select_all                 (TerminalScreen *screen);
+void            terminal_screen_select_all                (TerminalScreen *screen);
 
-void            terminal_screen_reset                      (TerminalScreen *screen,
-                                                            gboolean        clear);
+void            terminal_screen_reset                     (TerminalScreen *screen,
+                                                           gboolean        clear);
 
-GSList         *terminal_screen_get_restart_command        (TerminalScreen *screen);
+GSList         *terminal_screen_get_restart_command       (TerminalScreen *screen);
 
-void            terminal_screen_reset_activity             (TerminalScreen *screen);
+void            terminal_screen_reset_activity            (TerminalScreen *screen);
 
-GtkWidget      *terminal_screen_get_tab_label              (TerminalScreen *screen);
+GtkWidget      *terminal_screen_get_tab_label             (TerminalScreen *screen);
 
-void            terminal_screen_focus                      (TerminalScreen *screen);
+void            terminal_screen_focus                     (TerminalScreen *screen);
 
-const gchar    *terminal_screen_get_encoding               (TerminalScreen *screen);
-void            terminal_screen_set_encoding               (TerminalScreen *screen,
-                                                            const gchar    *charset);
+const gchar    *terminal_screen_get_encoding              (TerminalScreen *screen);
+void            terminal_screen_set_encoding              (TerminalScreen *screen,
+                                                           const gchar    *charset);
 
-void            terminal_screen_search_set_gregex          (TerminalScreen *screen,
-                                                            GRegex         *regex,
-                                                            gboolean        wrap_around);
-gboolean        terminal_screen_search_has_gregex          (TerminalScreen *screen);
+void            terminal_screen_search_set_gregex         (TerminalScreen *screen,
+                                                           GRegex         *regex,
+                                                           gboolean        wrap_around);
+gboolean        terminal_screen_search_has_gregex         (TerminalScreen *screen);
 
-void            terminal_screen_search_find_next           (TerminalScreen *screen);
-void            terminal_screen_search_find_previous       (TerminalScreen *screen);
+void            terminal_screen_search_find_next          (TerminalScreen *screen);
+void            terminal_screen_search_find_previous      (TerminalScreen *screen);
 
-void            terminal_screen_update_scrolling_bar       (TerminalScreen *screen);
+void            terminal_screen_update_scrolling_bar      (TerminalScreen *screen);
 
-void            terminal_screen_update_font                (TerminalScreen *screen);
+void            terminal_screen_update_font               (TerminalScreen *screen);
 
-gboolean        terminal_screen_get_input_enabled          (TerminalScreen *screen);
-void            terminal_screen_set_input_enabled          (TerminalScreen *screen,
-                                                            gboolean        enabled);
+gboolean        terminal_screen_get_input_enabled         (TerminalScreen *screen);
+void            terminal_screen_set_input_enabled         (TerminalScreen *screen,
+                                                           gboolean        enabled);
 
-gboolean        terminal_screen_get_scroll_on_output       (TerminalScreen *screen);
-void            terminal_screen_set_scroll_on_output       (TerminalScreen *screen,
-                                                            gboolean        enabled);
+gboolean        terminal_screen_get_scroll_on_output      (TerminalScreen *screen);
+void            terminal_screen_set_scroll_on_output      (TerminalScreen *screen,
+                                                           gboolean        enabled);
 
-void            terminal_screen_save_contents              (TerminalScreen *screen,
-                                                            GOutputStream  *stream,
-                                                            GError         *error);
+void            terminal_screen_save_contents             (TerminalScreen *screen,
+                                                           GOutputStream  *stream,
+                                                           GError         *error);
 
-gboolean        terminal_screen_has_foreground_process     (TerminalScreen *screen);
+gboolean        terminal_screen_has_foreground_process    (TerminalScreen *screen);
 
-void            terminal_screen_feed_text                  (TerminalScreen *screen,
-                                                            const char     *text);
+void            terminal_screen_feed_text                 (TerminalScreen *screen,
+                                                           const char     *text);
 
-const gchar    *terminal_screen_get_custom_fg_color        (TerminalScreen *screen);
+const gchar    *terminal_screen_get_custom_fg_color       (TerminalScreen *screen);
 
-const gchar    *terminal_screen_get_custom_bg_color        (TerminalScreen *screen);
+const gchar    *terminal_screen_get_custom_bg_color       (TerminalScreen *screen);
 
-void            terminal_screen_set_custom_tab_label_color (TerminalScreen *screen,
-                                                            const gchar    *color);
+void            terminal_screen_set_custom_title_color    (TerminalScreen *screen,
+                                                           const gchar    *color);
 
 G_END_DECLS
 
diff --git a/terminal/terminal-window-ui.xml b/terminal/terminal-window-ui.xml
index 9c5a227..7896ace 100644
--- a/terminal/terminal-window-ui.xml
+++ b/terminal/terminal-window-ui.xml
@@ -42,6 +42,7 @@
     </menu>
     <menu action="terminal-menu">
       <menuitem action="set-title"/>
+      <menuitem action="set-title-color"/>
       <separator/>
       <menuitem action="search"/>
       <menuitem action="search-next"/>
@@ -64,8 +65,6 @@
       <menuitem action="move-tab-left"/>
       <menuitem action="move-tab-right"/>
       <separator/>
-      <menuitem action="set-tab-label-color"/>
-      <separator/>
       <placeholder name="placeholder-tab-items"/>
     </menu>
     <menu action="help-menu">
@@ -101,13 +100,13 @@
   <popup name="tab-menu">
     <menuitem action="detach-tab"/>
     <menuitem action="close-other-tabs"/>
+    <separator/>
     <menuitem action="set-title"/>
+    <menuitem action="set-title-color"/>
     <separator/>
     <menuitem action="move-tab-left"/>
     <menuitem action="move-tab-right"/>
     <separator/>
-    <menuitem action="set-tab-label-color"/>
-    <separator/>
     <menu action="tabs-menu">
       <placeholder name="placeholder-tab-items"/>
     </menu>
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index a6894b0..4b2f8e6 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -217,10 +217,10 @@ static void         terminal_window_action_move_tab_right         (GtkAction
                                                                    TerminalWindow         *window);
 static void         terminal_window_action_goto_tab               (GtkRadioAction         *action,
                                                                    GtkNotebook            *notebook);
-static void         terminal_window_action_set_tab_label_color    (GtkAction              *action,
-                                                                   TerminalWindow         *window);
 static void         terminal_window_action_set_title              (GtkAction              *action,
                                                                    TerminalWindow         *window);
+static void         terminal_window_action_set_title_color        (GtkAction              *action,
+                                                                   TerminalWindow         *window);
 static void         terminal_window_action_search                 (GtkAction              *action,
                                                                    TerminalWindow         *window);
 static void         terminal_window_action_search_next            (GtkAction              *action,
@@ -338,6 +338,7 @@ static const GtkActionEntry action_entries[] =
     { "zoom-reset", "zoom-original", N_ ("_Normal Size"), "<control>0", N_ ("Zoom to default size"), G_CALLBACK (terminal_window_action_zoom_reset), },
   { "terminal-menu", NULL, N_ ("_Terminal"), NULL, NULL, NULL, },
     { "set-title", NULL, N_ ("_Set Title..."), "<control><shift>s", NULL, G_CALLBACK (terminal_window_action_set_title), },
+    { "set-title-color", NULL, N_ ("Set Title Co_lor..."), NULL, NULL, G_CALLBACK (terminal_window_action_set_title_color), },
     { "search", "edit-find", N_ ("_Find..."), "<control><shift>f", N_ ("Search terminal contents"), G_CALLBACK (terminal_window_action_search), },
     { "search-next", NULL, N_ ("Find Ne_xt"), NULL, NULL, G_CALLBACK (terminal_window_action_search_next), },
     { "search-prev", NULL, N_ ("Find Pre_vious"), NULL, NULL, G_CALLBACK (terminal_window_action_search_prev), },
@@ -349,7 +350,6 @@ static const GtkActionEntry action_entries[] =
     { "next-tab", "go-next", N_ ("_Next Tab"), "<control>Page_Down", N_ ("Switch to next tab"), G_CALLBACK (terminal_window_action_next_tab), },
     { "move-tab-left", NULL, N_ ("Move Tab _Left"), "<control><shift>Page_Up", NULL, G_CALLBACK (terminal_window_action_move_tab_left), },
     { "move-tab-right", NULL, N_ ("Move Tab _Right"), "<control><shift>Page_Down", NULL, G_CALLBACK (terminal_window_action_move_tab_right), },
-    { "set-tab-label-color", NULL, N_ ("Set Tab Label _Color"), NULL, NULL, G_CALLBACK (terminal_window_action_set_tab_label_color), },
   { "help-menu", NULL, N_ ("_Help"), NULL, NULL, NULL, },
     { "contents", "help-browser", N_ ("_Contents"), "F1", N_ ("Display help contents"), G_CALLBACK (terminal_window_action_contents), },
     { "about", "help-about", N_ ("_About"), NULL, NULL, G_CALLBACK (terminal_window_action_about), },
@@ -2090,28 +2090,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 
 
 static void
-terminal_window_action_set_tab_label_color (GtkAction      *action,
-                                            TerminalWindow *window)
-{
-  GdkRGBA    color;
-  gchar     *color_string;
-  GtkWidget *dialog = gtk_color_chooser_dialog_new (_("Choose tab label color"), GTK_WINDOW (window));
-  int        response = gtk_dialog_run (GTK_DIALOG (dialog));
-
-  if (response == GTK_RESPONSE_OK)
-    {
-      gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
-      color_string = gdk_rgba_to_string (&color);
-      terminal_screen_set_custom_tab_label_color (window->priv->active, color_string);
-      g_free (color_string);
-    }
-
-  gtk_widget_destroy (dialog);
-}
-
-
-
-static void
 title_popover_close (GtkWidget      *popover,
                      TerminalWindow *window)
 {
@@ -2220,6 +2198,28 @@ terminal_window_action_set_title (GtkAction      *action,
 
 
 static void
+terminal_window_action_set_title_color (GtkAction      *action,
+                                        TerminalWindow *window)
+{
+  GdkRGBA    color;
+  gchar     *color_string;
+  GtkWidget *dialog = gtk_color_chooser_dialog_new (_("Choose tab label color"), GTK_WINDOW (window));
+  int        response = gtk_dialog_run (GTK_DIALOG (dialog));
+
+  if (response == GTK_RESPONSE_OK)
+    {
+      gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
+      color_string = gdk_rgba_to_string (&color);
+      terminal_screen_set_custom_title_color (window->priv->active, color_string);
+      g_free (color_string);
+    }
+
+  gtk_widget_destroy (dialog);
+}
+
+
+
+static void
 terminal_window_action_search_response (GtkWidget      *dialog,
                                         gint            response_id,
                                         TerminalWindow *window)

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


More information about the Xfce4-commits mailing list