[vte/vte-next] Make 'dim-foreground-color' a style property



commit 2868dc164e5f7a349dd12b51d2be700f6742d1a8
Author: Christian Persch <chpe gnome org>
Date:   Sun May 22 20:50:42 2011 +0200

    Make 'dim-foreground-color' a style property

 doc/reference/vte-sections.txt |    1 -
 src/vte.c                      |   33 +++++++++++++++++++++++----------
 src/vte.h                      |    2 --
 3 files changed, 23 insertions(+), 13 deletions(-)
---
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index b04b8f4..6ac6677 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -27,7 +27,6 @@ vte_terminal_set_scroll_on_output
 vte_terminal_set_scroll_on_keystroke
 vte_terminal_set_color_foreground_rgba
 vte_terminal_set_color_background_rgba
-vte_terminal_set_color_dim_rgba
 vte_terminal_set_color_highlight_rgba
 vte_terminal_set_colors_rgba
 vte_terminal_set_default_colors
diff --git a/src/vte.c b/src/vte.c
index 18ac129..55e7147 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -2418,24 +2418,20 @@ _vte_terminal_set_color_bold_rgba(VteTerminal *terminal,
         vte_terminal_set_color_internal(terminal, VTE_BOLD_FG, rgba, FALSE);
 }
 
-/**
- * vte_terminal_set_color_dim_rgba:
+/*
+ * _vte_terminal_set_color_dim_rgba:
  * @terminal: a #VteTerminal
  * @dim: (allow-none): the new dim color or %NULL
  *
  * Sets the color used to draw dim text in the default foreground color.
  * If @dim is %NULL then the default color is used.
- *
- * Since: 0.28
  */
-void
-vte_terminal_set_color_dim_rgba(VteTerminal *terminal,
-                                const GdkRGBA *rgba)
+static void
+_vte_terminal_set_color_dim_rgba(VteTerminal *terminal,
+                                 const GdkRGBA *rgba)
 {
         GdkRGBA mixed;
 
-        g_return_if_fail(VTE_IS_TERMINAL(terminal));
-
         if (rgba == NULL) {
                 vte_terminal_generate_bold(&terminal->pvt->palette[VTE_DEF_FG],
                                            &terminal->pvt->palette[VTE_DEF_BG],
@@ -2447,7 +2443,7 @@ vte_terminal_set_color_dim_rgba(VteTerminal *terminal,
         _vte_debug_print(VTE_DEBUG_MISC,
                         "Set dim color to rgba(%.3f,%.3f,%.3f,%.3f).\n",
                         rgba->red, rgba->green, rgba->blue, rgba->alpha);
-        vte_terminal_set_color_internal(terminal, VTE_DIM_FG, rgba, TRUE);
+        vte_terminal_set_color_internal(terminal, VTE_DIM_FG, rgba, FALSE);
 }
 
 /**
@@ -4297,6 +4293,10 @@ vte_terminal_update_style_colors(VteTerminal *terminal)
 
         color = _vte_style_context_get_color(context, "bold-foreground-color", &rgba);
         _vte_terminal_set_color_bold_rgba(terminal, color);
+
+          color = _vte_style_context_get_color(context, "dim-foreground-color", &rgba);
+        _vte_terminal_set_color_dim_rgba(terminal, color);
+
 }
 
 static void
@@ -11716,6 +11716,19 @@ vte_terminal_class_init(VteTerminalClass *klass)
                                      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
         /**
+         * VteTerminal:dim-foreground-color:
+         *
+         * The foreground color for dim text.
+         *
+         * Since: 0.30
+         */
+        gtk_widget_class_install_style_property
+                (widget_class,
+                 g_param_spec_boxed ("dim-foreground-color", NULL, NULL,
+                                     GDK_TYPE_RGBA,
+                                     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+        /**
          * VteTerminal:cursor-background-color:
          *
          * The background color for text which is under the cursor.  If not set,
diff --git a/src/vte.h b/src/vte.h
index beef344..357c376 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -228,8 +228,6 @@ void vte_terminal_set_scroll_on_keystroke(VteTerminal *terminal,
 
 /* Set the color scheme. */
 
-void vte_terminal_set_color_dim_rgba(VteTerminal *terminal,
-	                             const GdkRGBA *rgba);
 void vte_terminal_set_color_foreground_rgba(VteTerminal *terminal,
 					    const GdkRGBA *rgba);
 void vte_terminal_set_color_background_rgba(VteTerminal *terminal,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]