代码拉取完成,页面将自动刷新
From eeed7eb54ab7c2b462ebc9237cd8cd55af081f53 Mon Sep 17 00:00:00 2001
From: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
Date: Mon, 1 Aug 2022 10:26:35 +0800
Subject: [PATCH] Let the notification icon use the size specified by the tray
to draw
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 让通知图标使用托盘指定的图标大小进行绘制, 避免造成图标过大
Related #I5HAM8
Signed-off-by: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
---
gtk/deprecated/gtkstatusicon.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gtk/deprecated/gtkstatusicon.c b/gtk/deprecated/gtkstatusicon.c
index 52239b1..8b0cbc8 100644
--- a/gtk/deprecated/gtkstatusicon.c
+++ b/gtk/deprecated/gtkstatusicon.c
@@ -1401,7 +1401,6 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
#ifndef GDK_WINDOWING_X11
GdkPixbuf *pixbuf;
#endif
- gint round_size;
gint scale;
#ifdef GDK_WINDOWING_X11
@@ -1415,13 +1414,11 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
if (widget == NULL)
return;
- round_size = round_pixel_size (widget, priv->size);
-
icon_helper = gtk_icon_helper_new (gtk_style_context_get_node (gtk_widget_get_style_context (widget)), widget);
_gtk_icon_helper_set_force_scale_pixbuf (icon_helper, TRUE);
_gtk_icon_helper_set_definition (icon_helper, priv->image_def);
_gtk_icon_helper_set_icon_size (icon_helper, GTK_ICON_SIZE_SMALL_TOOLBAR);
- _gtk_icon_helper_set_pixel_size (icon_helper, round_size);
+ _gtk_icon_helper_set_pixel_size (icon_helper, gtk_image_get_pixel_size (GTK_IMAGE (priv->image)));
surface = gtk_icon_helper_load_surface (icon_helper, scale);
g_object_unref (icon_helper);
@@ -1567,6 +1564,8 @@ gtk_status_icon_icon_size_changed (GtkStatusIcon *status_icon)
gtk_image_set_pixel_size (GTK_IMAGE (priv->image), icon_size);
else
gtk_image_set_pixel_size (GTK_IMAGE (priv->image), -1);
+
+ gtk_status_icon_update_image (status_icon);
}
static void
--
2.36.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。