From c9f518a65c320871bff5636435bcad088c069b93 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Fri, 20 Jan 2023 03:26:13 +0000 Subject: [PATCH] display: Fix statusbar tool icon offset The Y offset of the statusbar tool icon is too large, which pushes it off-screen. This scales the offset by the size of the icon to prevent this problem. --- app/display/gimpstatusbar.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c index 0c0ca14907..2a2648f150 100644 --- a/app/display/gimpstatusbar.c +++ b/app/display/gimpstatusbar.c @@ -55,6 +55,9 @@ /* spacing between the icon and the statusbar label */ #define ICON_SPACING 2 +/* width/height of the statusbar icon rect */ +#define ICON_SIZE 16 + /* timeout (in milliseconds) for temporary statusbar messages */ #define MESSAGE_TIMEOUT 8000 @@ -1342,7 +1345,7 @@ gimp_statusbar_label_expose (GtkWidget *widget, /* the rectangle width is negative when rendering right-to-left */ x += PANGO_PIXELS (rect.x) + (rect.width < 0 ? PANGO_PIXELS (rect.width) : 0); - y += PANGO_PIXELS (rect.y); + y += PANGO_PIXELS (rect.y / ICON_SIZE); gdk_cairo_set_source_pixbuf (cr, statusbar->icon, x, y); cairo_paint (cr); @@ -1734,7 +1737,7 @@ gimp_statusbar_load_icon (GimpStatusbar *statusbar, if (icon) return g_object_ref (icon); - icon = gimp_widget_load_icon (statusbar->label, icon_name, 16); + icon = gimp_widget_load_icon (statusbar->label, icon_name, ICON_SIZE); /* this is not optimal but so what */ if (g_hash_table_size (statusbar->icon_hash) > 16)