example (mako):
fnott:
image
you can see why this doesn't look very nice.
another thing i've noticed and that you can see in the image above, is the fact that the scaled down icon of mako looks alot smoother than what is on fnott.
example (mako):
fnott:
image
you can see why this doesn't look very nice.
another thing i've noticed and that you can see in the image above, is the fact that the scaled down icon of mako looks alot smoother than what is on fnott.
Vertically centered text
I'll have to think about how, if at all, we can do this. Layouting is already complex, and I'd rather not complicate further...
another thing i've noticed and that you can see in the image above, is the fact that the scaled down icon of mako looks alot smoother than what is on fnott.
PNGs, and other raw bitmaps are scaled using pixman's default scaler, which doesn't produce very good results.
Can you try the patch below? It changes the scaling filter to the best one supported by pixman, lanczos3.
diff --git a/notification.c b/notification.c
index d2b9b16..f301171 100644
--- a/notification.c
+++ b/notification.c
@@ -724,10 +724,35 @@ notif_set_image_internal(struct notif *notif, pixman_image_t *pix, bool custom)
pixman_image_get_width(pix), pixman_image_get_height(pix),
notif->image_width, notif->image_height);
+ struct pixman_f_transform f_scale;
+ pixman_f_transform_init_scale(&f_scale, scale, scale);
+
struct pixman_transform t;
- pixman_transform_init_scale(
- &t, pixman_double_to_fixed(scale), pixman_double_to_fixed(scale));
+ pixman_transform_from_pixman_f_transform(&t, &f_scale);
pixman_image_set_transform(pix, &t);
+
+ /* TODO: make scaling filter configurable? */
+ {
+ int param_count = 0;
+#if 0
+ pixman_kernel_t kernel = filter_to_use == FCFT_SCALING_FILTER_CUBIC
+ ? PIXMAN_KERNEL_CUBIC
+ : PIXMAN_KERNEL_LANCZOS3;
+#endif
+ pixman_kernel_t kernel = PIXMAN_KERNEL_LANCZOS3;
+ pixman_fixed_t *params = pixman_filter_create_separable_convolution(
+ ¶m_count,
+ pixman_double_to_fixed(scale),
+ pixman_double_to_fixed(scale),
+ kernel, kernel,
+ kernel, kernel,
+ pixman_int_to_fixed(1),
+ pixman_int_to_fixed(1));
+
+ pixman_image_set_filter(
+ pix, PIXMAN_FILTER_SEPARABLE_CONVOLUTION, params, param_count);
+ free(params);
+ }
}
static bool
Can you try the patch below? It changes the scaling filter to the best one supported by pixman, lanczos3.
Made a PR out of it: #124
Is there any plan for this centring? I think it'd look nicer with the padding I have set :-)
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?