[StEntry] Make the cursor size stylable
Just as the cursor color can be styled using the "caret-color" property, expose the cursor size as "caret-size". https://bugzilla.gnome.org/show_bug.cgi?id=611095
This commit is contained in:
parent
5ce1e3fe92
commit
a0b5a44fe9
@ -184,12 +184,16 @@ st_entry_style_changed (StWidget *self)
|
|||||||
ClutterColor color;
|
ClutterColor color;
|
||||||
const PangoFontDescription *font;
|
const PangoFontDescription *font;
|
||||||
gchar *font_string;
|
gchar *font_string;
|
||||||
|
gdouble size;
|
||||||
|
|
||||||
theme_node = st_widget_get_theme_node (self);
|
theme_node = st_widget_get_theme_node (self);
|
||||||
|
|
||||||
st_theme_node_get_foreground_color (theme_node, &color);
|
st_theme_node_get_foreground_color (theme_node, &color);
|
||||||
clutter_text_set_color (CLUTTER_TEXT (priv->entry), &color);
|
clutter_text_set_color (CLUTTER_TEXT (priv->entry), &color);
|
||||||
|
|
||||||
|
if (st_theme_node_get_length (theme_node, "caret-size", FALSE, &size))
|
||||||
|
clutter_text_set_cursor_size (CLUTTER_TEXT (priv->entry), (int)(.5 + size));
|
||||||
|
|
||||||
if (st_theme_node_get_color (theme_node, "caret-color", FALSE, &color))
|
if (st_theme_node_get_color (theme_node, "caret-color", FALSE, &color))
|
||||||
clutter_text_set_cursor_color (CLUTTER_TEXT (priv->entry), &color);
|
clutter_text_set_cursor_color (CLUTTER_TEXT (priv->entry), &color);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user