5 Star 0 Fork 17

src-openEuler/caja

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-Not-draw-icon-and-text-hight-light-color-when-icon-n.patch 3.17 KB
一键复制 编辑 原始数据 按行查看 历史
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/caja.git
git@gitee.com:src-openeuler/caja.git
src-openeuler
caja
caja
master

搜索帮助