[gnome-shell/wip/fmuellner/window-app-icon-size: 2/4] texture-cache: Fall back to actor size for bound textures
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/window-app-icon-size: 2/4] texture-cache: Fall back to actor size for bound textures
- Date: Fri, 8 Mar 2019 13:39:21 +0000 (UTC)
commit af41ca89c621367963cb4044a59b2fc9302811e9
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Mar 8 14:08:27 2019 +0100
texture-cache: Fall back to actor size for bound textures
With StImageContent, the meaning of passing -1 as size parameter changed
from "load the image at its preferred size" to "abort the session". It
is therefore no longer possible to just load the image and then have it
scaled by applying a CSS size to the texture's parent.
Setting the size from CSS is useful though, so to still allow that, fall
back to the actor's size (which can be determined by the style).
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027
src/st/st-texture-cache.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index dbf0db4cf..dcf539380 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -702,10 +702,14 @@ st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
{
g_autoptr(ClutterContent) image = NULL;
g_autoptr(GError) error = NULL;
+ int size = bind->size;
+
+ if (size < 0)
+ clutter_actor_get_preferred_width (bind->actor, -1, NULL, (float *)&size);
image = clutter_actor_get_content (bind->actor);
if (!image || !CLUTTER_IS_IMAGE (image))
- image = st_image_content_new_with_preferred_size (bind->size, bind->size);
+ image = st_image_content_new_with_preferred_size (size, size);
else
g_object_ref (image);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]