summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Dreßler <verdre@v0yd.nl>2021-03-05 12:17:07 +0100
committerMarge Bot <marge-bot@gnome.org>2022-02-14 12:52:20 +0000
commit898334f31d62cc7e035c860cb977ba8e6adccb35 (patch)
tree23bad627327f1082569c16c75a16c9fc40a9a0b8 /src
parent2bb36db9e823ca616ec8af52f502665a58100049 (diff)
downloadgnome-shell-898334f31d62cc7e035c860cb977ba8e6adccb35.tar.gz
st/entry: Invalidate text shadow on style changes to ClutterText
We update a few properties of ClutterText when the CSS changes via _st_set_text_from_style() (which we call when receiving the style-changed signal). Right now we simply invalidate the text shadow every time we receive the style-changed signal, but we're going to change that with the next commits. To ensure the shadow still gets invalidated on CSS changed that might affect the shadow, listen to a bunch of property changes that will get notified when any property that affects the shadow changes. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1744>
Diffstat (limited to 'src')
-rw-r--r--src/st/st-entry.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index d50c2548b..e2e985df6 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -563,6 +563,16 @@ clutter_text_changed_cb (GObject *object,
}
static void
+invalidate_shadow_pipeline (GObject *object,
+ GParamSpec *pspec,
+ StEntry *entry)
+{
+ StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
+
+ g_clear_pointer (&priv->text_shadow_material, cogl_object_unref);
+}
+
+static void
st_entry_clipboard_callback (StClipboard *clipboard,
const gchar *text,
gpointer data)
@@ -1058,6 +1068,20 @@ st_entry_init (StEntry *entry)
g_signal_connect (priv->entry, "notify::text",
G_CALLBACK (clutter_text_changed_cb), entry);
+ /* These properties might get set from CSS using _st_set_text_from_style */
+ g_signal_connect (priv->entry, "notify::font-description",
+ G_CALLBACK (invalidate_shadow_pipeline), entry);
+
+ g_signal_connect (priv->entry, "notify::attributes",
+ G_CALLBACK (invalidate_shadow_pipeline), entry);
+
+ g_signal_connect (priv->entry, "notify::justify",
+ G_CALLBACK (invalidate_shadow_pipeline), entry);
+
+ g_signal_connect (priv->entry, "notify::line-alignment",
+ G_CALLBACK (invalidate_shadow_pipeline), entry);
+
+
priv->spacing = 6.0f;
priv->text_shadow_material = NULL;