代码拉取完成,页面将自动刷新
From 5b3b8728e06b515c9ab3cdd2d601445cabd285a8 Mon Sep 17 00:00:00 2001
From: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
Date: Fri, 29 Jul 2022 16:41:14 +0800
Subject: [PATCH 4/4] Not draw icon and text hight light color when icon not
get force
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 当图标未获得焦点时,不高亮绘制其图标和文字
Related #I5HRI0
Signed-off-by: wangxiaoqing <wangxiaoqing@kylinsec.com.cn>
---
libcaja-private/caja-icon-canvas-item.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c
index 7ab2f70..7c56de2 100644
--- a/libcaja-private/caja-icon-canvas-item.c
+++ b/libcaja-private/caja-icon-canvas-item.c
@@ -1077,7 +1077,9 @@ prepare_pango_layout_for_draw (CajaIconCanvasItem *item,
container = CAJA_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas);
details = item->details;
- needs_highlight = details->is_highlighted_for_selection || details->is_highlighted_for_drop;
+ needs_highlight = (details->is_highlighted_for_selection &&
+ gtk_widget_has_focus (GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas))) ||
+ details->is_highlighted_for_drop;
if (IS_COMPACT_VIEW (container))
{
@@ -1278,7 +1280,9 @@ draw_label_text (CajaIconCanvasItem *item,
text_rect = compute_text_rectangle (item, icon_rect, TRUE, BOUNDS_USAGE_FOR_DISPLAY);
- needs_highlight = details->is_highlighted_for_selection || details->is_highlighted_for_drop;
+ needs_highlight = (details->is_highlighted_for_selection &&
+ gtk_widget_has_focus (GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas))) ||
+ details->is_highlighted_for_drop;
is_rtl_label_beside = caja_icon_container_is_layout_rtl (container) &&
container->details->label_position == CAJA_ICON_LABEL_POSITION_BESIDE;
@@ -1777,22 +1781,17 @@ real_map_surface (CajaIconCanvasItem *icon_item)
}
}
- if (icon_item->details->is_highlighted_for_selection
- || icon_item->details->is_highlighted_for_drop)
+ if ((icon_item->details->is_highlighted_for_selection &&
+ gtk_widget_has_focus (GTK_WIDGET (canvas))) ||
+ icon_item->details->is_highlighted_for_drop)
{
GtkStyleContext *style;
style = gtk_widget_get_style_context (GTK_WIDGET (canvas));
- if (gtk_widget_has_focus (GTK_WIDGET (canvas))) {
- gtk_style_context_get (style, GTK_STATE_FLAG_SELECTED,
- GTK_STYLE_PROPERTY_BACKGROUND_COLOR,
- &c, NULL);
- } else {
- gtk_style_context_get (style, GTK_STATE_FLAG_ACTIVE,
- GTK_STYLE_PROPERTY_BACKGROUND_COLOR,
- &c, NULL);
- }
+ gtk_style_context_get (style, GTK_STATE_FLAG_SELECTED,
+ GTK_STYLE_PROPERTY_BACKGROUND_COLOR,
+ &c, NULL);
color = *c;
gdk_rgba_free (c);
--
2.36.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。