[vte/vte-next] Make 'bold-foreground-color' a style property
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next] Make 'bold-foreground-color' a style property
- Date: Sun, 22 May 2011 22:19:15 +0000 (UTC)
commit a6ca2d607646ed4ad487514340e12de494870733
Author: Christian Persch <chpe gnome org>
Date: Sun May 22 20:47:35 2011 +0200
Make 'bold-foreground-color' a style property
doc/reference/vte-sections.txt | 1 -
src/vte.c | 30 ++++++++++++++++++++++--------
src/vte.h | 2 --
3 files changed, 22 insertions(+), 11 deletions(-)
---
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index f42e68a..b04b8f4 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -25,7 +25,6 @@ vte_terminal_set_visible_bell
vte_terminal_get_visible_bell
vte_terminal_set_scroll_on_output
vte_terminal_set_scroll_on_keystroke
-vte_terminal_set_color_bold_rgba
vte_terminal_set_color_foreground_rgba
vte_terminal_set_color_background_rgba
vte_terminal_set_color_dim_rgba
diff --git a/src/vte.c b/src/vte.c
index 11792bb..18ac129 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -2390,22 +2390,20 @@ vte_terminal_set_colors_rgba(VteTerminal *terminal,
terminal->pvt->palette_initialized = TRUE;
}
-/**
- * vte_terminal_set_color_bold_rgba:
+/*
+ * _vte_terminal_set_color_bold_rgba:
* @terminal: a #VteTerminal
* @bold: (allow-none): the new bold color or %NULL
*
* Sets the color used to draw bold text in the default foreground color.
* If @bold is %NULL then the default color is used.
*/
-void
-vte_terminal_set_color_bold_rgba(VteTerminal *terminal,
- const GdkRGBA *rgba)
+static void
+_vte_terminal_set_color_bold_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],
@@ -2417,7 +2415,7 @@ vte_terminal_set_color_bold_rgba(VteTerminal *terminal,
_vte_debug_print(VTE_DEBUG_MISC,
"Set bold color to rgba(%.3f,%.3f,%.3f,%.3f).\n",
rgba->red, rgba->green, rgba->blue, rgba->alpha);
- vte_terminal_set_color_internal(terminal, VTE_BOLD_FG, rgba, TRUE);
+ vte_terminal_set_color_internal(terminal, VTE_BOLD_FG, rgba, FALSE);
}
/**
@@ -4296,6 +4294,9 @@ vte_terminal_update_style_colors(VteTerminal *terminal)
color = _vte_style_context_get_color(context, "cursor-background-color", &rgba);
_vte_terminal_set_color_cursor_rgba(terminal, color, FALSE);
+
+ color = _vte_style_context_get_color(context, "bold-foreground-color", &rgba);
+ _vte_terminal_set_color_bold_rgba(terminal, color);
}
static void
@@ -11702,6 +11703,19 @@ vte_terminal_class_init(VteTerminalClass *klass)
/* Colours */
/**
+ * VteTerminal:bold-foreground-color:
+ *
+ * The foreground color for bold text.
+ *
+ * Since: 0.30
+ */
+ gtk_widget_class_install_style_property
+ (widget_class,
+ g_param_spec_boxed ("bold-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 abf39ac..beef344 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_bold_rgba(VteTerminal *terminal,
- const GdkRGBA *rgba);
void vte_terminal_set_color_dim_rgba(VteTerminal *terminal,
const GdkRGBA *rgba);
void vte_terminal_set_color_foreground_rgba(VteTerminal *terminal,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]