[nautilus/2161-laggy-scrolling-with-adwaita-theme: 103/103] canvas-item: Use 0px border-radius for thumbnails
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/2161-laggy-scrolling-with-adwaita-theme: 103/103] canvas-item: Use 0px border-radius for thumbnails
- Date: Mon, 28 Feb 2022 14:45:29 +0000 (UTC)
commit b4d356f0ec15f4c3cf38af005a113c8f2a2aa6eb
Author: António Fernandes <antoniof gnome org>
Date: Mon Feb 28 14:39:29 2022 +0000
canvas-item: Use 0px border-radius for thumbnails
The border-radius intended for drawing the selection rectangle around
labels is also causing black artifacts in the corners of thumbnails.
This was not noticeable before because thumbnails had a rounded frame.
So, set the radius to 0 when drawing the thumbnails, but restore the
radius for the labels.
src/nautilus-canvas-item.c | 5 +++++
src/resources/css/Adwaita.css | 1 +
2 files changed, 6 insertions(+)
---
diff --git a/src/nautilus-canvas-item.c b/src/nautilus-canvas-item.c
index f51967d23..26253c484 100644
--- a/src/nautilus-canvas-item.c
+++ b/src/nautilus-canvas-item.c
@@ -1364,6 +1364,7 @@ nautilus_canvas_item_draw (EelCanvasItem *item,
gtk_style_context_add_class (context, "nautilus-canvas-item");
if (details->is_thumbnail)
{
+ gtk_style_context_save (context);
gtk_style_context_add_class (context, "thumbnail");
}
@@ -1374,6 +1375,10 @@ nautilus_canvas_item_draw (EelCanvasItem *item,
temp_surface,
icon_rect.x0, icon_rect.y0);
cairo_surface_destroy (temp_surface);
+ if (details->is_thumbnail)
+ {
+ gtk_style_context_restore (context);
+ }
/* Draw the label text. */
draw_label_text (canvas_item, cr, icon_rect);
diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css
index 1135871be..100a1c02c 100644
--- a/src/resources/css/Adwaita.css
+++ b/src/resources/css/Adwaita.css
@@ -13,6 +13,7 @@
}
.nautilus-canvas-item.thumbnail {
+ border-radius: 0px;
-gtk-icon-shadow: 0px -1px alpha(@borders, 0.2),
2px 0px alpha(@borders, 0.2),
-2px 0px alpha(@borders, 0.2),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]