8 Star 0 Fork 18

src-anolis-os/qt5-qtbase

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch 2.56 KB
一键复制 编辑 原始数据 按行查看 历史
xingwei-liu 提交于 2022-10-13 02:47 . !8feature: add patchs for DDE
From 52aa36ffc852efc242b1559df7d97fe7bde71a9d Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Tue, 5 Jul 2022 10:13:41 +0800
Subject: [PATCH]
0001_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin
---
src/widgets/styles/qcommonstyle.cpp | 3 +++
src/widgets/styles/qfusionstyle.cpp | 3 +++
src/widgets/styles/qstyle.cpp | 3 +++
src/widgets/styles/qstyle.h | 2 ++
4 files changed, 11 insertions(+)
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 559ad913..bcc6160c 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -4832,6 +4832,9 @@ QT_WARNING_POP
case PM_IconViewIconSize:
ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget);
break;
+ case PM_LineEditIconSize:
+ ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget);
+ break;
case PM_LargeIconSize:
ret = int(QStyleHelper::dpiScaled(32, opt));
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 46e5b6dd..1cd31c10 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -3052,6 +3052,9 @@ int QFusionStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, co
case PM_ListViewIconSize:
val = 24;
break;
+ case PM_LineEditIconSize:
+ val = 24;
+ break;
case PM_DialogButtonsSeparator:
case PM_ScrollBarSliderMin:
val = 26;
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index d80dafcc..f8eb505d 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -1501,6 +1501,9 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value PM_TitleBarButtonSize The size of buttons on a title bar.
This enum value has been introduced in Qt 5.8.
+ \value PM_LineEditIconSize The default size for icons in a line edit.
+ This enum value has been introduced in Qt 6.2.
+
\value PM_CustomBase Base value for custom pixel metrics. Custom
values must be greater than this value.
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index 5be1b4b2..8fdee8ca 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -587,6 +587,8 @@ public:
PM_TitleBarButtonIconSize,
PM_TitleBarButtonSize,
+ PM_LineEditIconSize,
+
// do not add any values below/greater than this
PM_CustomBase = 0xf0000000
};
--
2.31.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/qt5-qtbase.git
git@gitee.com:src-anolis-os/qt5-qtbase.git
src-anolis-os
qt5-qtbase
qt5-qtbase
a8

搜索帮助