4 Star 0 Fork 4

src-openEuler/kiran-qt5-integration

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-fix-arrow-Adjust-the-theme-drawing-arrow.patch 2.55 KB
一键复制 编辑 原始数据 按行查看 历史
From fdb75046726d3134ea4af3616385eae10f92df5d Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Fri, 7 Apr 2023 09:26:09 +0800
Subject: [PATCH 2/4] fix(arrow): Adjust the theme drawing arrow
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 调整主题绘制箭头
---
style/src/metrics.h | 2 +-
style/src/render-helper.cpp | 2 +-
style/src/style.cpp | 5 ++++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/style/src/metrics.h b/style/src/metrics.h
index 4248347..05169e4 100644
--- a/style/src/metrics.h
+++ b/style/src/metrics.h
@@ -130,7 +130,7 @@ struct Metrics
static constexpr int Header_ArrowSize = 10;
// tree view
- static constexpr int ItemView_ArrowSize = 12;
+ static constexpr int ItemView_ArrowSize = 10;
static constexpr int ItemView_ItemMarginWidth = 3;
static constexpr int SidePanel_ItemMarginWidth = 4;
diff --git a/style/src/render-helper.cpp b/style/src/render-helper.cpp
index 60f66e3..9bf66d2 100644
--- a/style/src/render-helper.cpp
+++ b/style/src/render-helper.cpp
@@ -318,7 +318,7 @@ QPixmap RenderHelper::changeSVGFillColor(const QString &svgFile, const QColor &f
void RenderHelper::renderArrow(QPainter *painter, const QRect &rect, ArrowOrientation orientation, const QColor &color, const QSize &arrowSize)
{
- QString svgFile = QString(":/style-helper/images/arrow.svg");
+ QString svgFile = QString(":/style-helper/images/arrow-down.svg");
PainterSaver painterSave(painter);
painter->setRenderHint(QPainter::Antialiasing);
diff --git a/style/src/style.cpp b/style/src/style.cpp
index 235346d..abe5517 100644
--- a/style/src/style.cpp
+++ b/style/src/style.cpp
@@ -664,6 +664,9 @@ QPixmap Style::standardPixmap(QStyle::StandardPixmap standardPixmap, const QStyl
{
switch (standardPixmap)
{
+ case SP_ArrowUp:
+ case SP_ArrowDown:
+ case SP_ArrowLeft:
case SP_ArrowRight:
{
QPalette palette = widget ? widget->palette() : qApp->palette();
@@ -671,7 +674,7 @@ QPixmap Style::standardPixmap(QStyle::StandardPixmap standardPixmap, const QStyl
QPixmap arrowPixmap(16, 16);
arrowPixmap.fill(Qt::transparent);
QPainter painter(&arrowPixmap);
- RenderHelper::renderArrow(&painter, arrowPixmap.rect(), Arrow_Right, palette.color(colorRole));
+ RenderHelper::renderArrow(&painter, arrowPixmap.rect(), (Kiran::ArrowOrientation)((int)standardPixmap-SP_ArrowUp), palette.color(colorRole));
return arrowPixmap;
}
default:
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/kiran-qt5-integration.git
git@gitee.com:src-openeuler/kiran-qt5-integration.git
src-openeuler
kiran-qt5-integration
kiran-qt5-integration
master

搜索帮助