feat(widgets): update control drawing process supports dark and light color themes

- 更新控件绘制过程支持深浅色主题
This commit is contained in:
liuxinhao 2022-07-07 09:44:28 +08:00
parent 6aaed6b66f
commit f421a107f4
5 changed files with 12 additions and 147 deletions

View File

@ -1,30 +0,0 @@
From c0d33c40612d05f4b46474566300fd62fb379da4 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinos.com.cn>
Date: Thu, 20 Jan 2022 15:29:42 +0800
Subject: [PATCH] fix(build): fix compilation errors on OpenEuler
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复位于OpenEluer上的编译错误
Signed-off-by: liuxinhao <liuxinhao@kylinos.com.cn>
---
src/widgets/kiran-titlebar-window/global_define.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/widgets/kiran-titlebar-window/global_define.h b/src/widgets/kiran-titlebar-window/global_define.h
index e9d9d7c..6361a0e 100644
--- a/src/widgets/kiran-titlebar-window/global_define.h
+++ b/src/widgets/kiran-titlebar-window/global_define.h
@@ -21,7 +21,7 @@
#define DEFAULT_THEME_PATH ":/kiranwidgets-qt5/themes/kiran-titlebar-window_black.qss"
namespace Kiran {
-
+ Q_NAMESPACE
enum CursorPositionEnum{
CursorPosition_None = 0x00000000,
CursorPosition_Top = 0x00000001,
--
2.27.0

View File

@ -1,109 +0,0 @@
From 50c6ad957b53138a6d37b462219cf44a5604f5a1 Mon Sep 17 00:00:00 2001
From: kylinsecos_admin <gitee@kylinos.com.cn>
Date: Sat, 22 Jan 2022 16:09:15 +0800
Subject: [PATCH] fix(build): fix incomplete type 'class QPainterPath' build
error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复编译时未正确引入QPainterPath的问题
---
src/kiran-style/draw-helper/draw-button-helper.cpp | 1 +
src/kiran-style/draw-helper/draw-combo-box-helper.cpp | 3 ++-
src/kiran-style/draw-helper/draw-common-helper.cpp | 3 ++-
src/kiran-style/draw-helper/draw-image-selector-helper.cpp | 2 +-
src/kiran-style/draw-helper/draw-slider-helper.cpp | 1 +
src/kiran-style/draw-helper/draw-tab-bar-helper.cpp | 1 +
6 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/kiran-style/draw-helper/draw-button-helper.cpp b/src/kiran-style/draw-helper/draw-button-helper.cpp
index 02c1eda..a7073a0 100644
--- a/src/kiran-style/draw-helper/draw-button-helper.cpp
+++ b/src/kiran-style/draw-helper/draw-button-helper.cpp
@@ -15,6 +15,7 @@
#include <QAbstractButton>
#include <QPushButton>
#include <QDebug>
+#include <QPainterPath>
#include "style.h"
#include "draw-common-helper.h"
diff --git a/src/kiran-style/draw-helper/draw-combo-box-helper.cpp b/src/kiran-style/draw-helper/draw-combo-box-helper.cpp
index cdded8c..93e5492 100644
--- a/src/kiran-style/draw-helper/draw-combo-box-helper.cpp
+++ b/src/kiran-style/draw-helper/draw-combo-box-helper.cpp
@@ -17,6 +17,7 @@
#include "draw-common-helper.h"
#include "style.h"
+#include <QPainterPath>
#include <QComboBox>
#include <QDebug>
#include <QAbstractItemView>
@@ -248,4 +249,4 @@ bool DrawComboBoxHelper::drawComboBoxMenuItem(const Kiran::Style *style, const Q
}
return true;
-}
\ No newline at end of file
+}
diff --git a/src/kiran-style/draw-helper/draw-common-helper.cpp b/src/kiran-style/draw-helper/draw-common-helper.cpp
index 1a64cd4..171854d 100644
--- a/src/kiran-style/draw-helper/draw-common-helper.cpp
+++ b/src/kiran-style/draw-helper/draw-common-helper.cpp
@@ -21,6 +21,7 @@
#include <QX11Info>
#include <QStyle>
#include <QSvgRenderer>
+#include <QPainterPath>
using namespace Kiran;
@@ -483,4 +484,4 @@ void DrawCommonHelper::renderProgressBarGroove(QPainter* painter, const QRect& r
painter->setBrush( color );
painter->drawRect( baseRect.translated(0.5, 0.5) );
}
-}
\ No newline at end of file
+}
diff --git a/src/kiran-style/draw-helper/draw-image-selector-helper.cpp b/src/kiran-style/draw-helper/draw-image-selector-helper.cpp
index c7a075b..29d21bf 100644
--- a/src/kiran-style/draw-helper/draw-image-selector-helper.cpp
+++ b/src/kiran-style/draw-helper/draw-image-selector-helper.cpp
@@ -21,7 +21,7 @@
#include <QPainter>
#include <QWidget>
#include <QDebug>
-
+#include <QPainterPath>
void Kiran::DrawImageSelectorHelper::drawPEKiranImageSelector(const Kiran::Style *style, const QStyleOption *opt,
QPainter *p, Kiran::StyleDetailFetcher *fetcher,
const QWidget *widget) {
diff --git a/src/kiran-style/draw-helper/draw-slider-helper.cpp b/src/kiran-style/draw-helper/draw-slider-helper.cpp
index 38597ee..c8b6a30 100644
--- a/src/kiran-style/draw-helper/draw-slider-helper.cpp
+++ b/src/kiran-style/draw-helper/draw-slider-helper.cpp
@@ -21,6 +21,7 @@
#include <QPainter>
#include <QStyleOption>
#include <QWidget>
+#include <QPainterPath>
bool Kiran::DrawSliderHelper::drawSliderComplexControl(const Kiran::Style * style,
const QStyleOptionComplex *opt,
diff --git a/src/kiran-style/draw-helper/draw-tab-bar-helper.cpp b/src/kiran-style/draw-helper/draw-tab-bar-helper.cpp
index 81875dd..eef9f10 100644
--- a/src/kiran-style/draw-helper/draw-tab-bar-helper.cpp
+++ b/src/kiran-style/draw-helper/draw-tab-bar-helper.cpp
@@ -18,6 +18,7 @@
#include "kiran-style-private-defines.h"
#include <QPainter>
+#include <QPainterPath>
#include <QDebug>
#include <QtWidgets/QStyleOption>
--
1.8.3.1

Binary file not shown.

Binary file not shown.

View File

@ -1,27 +1,27 @@
Name: kiran-widgets-qt5
Version: 2.2.0
Release: 2.kb4
Version: 2.3.0
Release: 1
Summary: Encapsulated QT Widget
Summary(zh_CN): 封装的Qt小部件
License: Mulan PSL v2
Source0: %{name}-%{version}.tar.gz
Patch1: 0000-fix-build-fix-compilation-errors-on-OpenEuler-c0d33c40.patch
Patch2: 0001-fix-build-fix-incomplete-type-class-QPainterPath-bui.patch
BuildRequires: cmake >= 3.5
BuildRequires: gcc-c++
BuildRequires: libX11-devel
BuildRequires: libxcb-devel
BuildRequires: xcb-util-devel
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtbase-private-devel
BuildRequires: qt5-qtx11extras-devel
BuildRequires: gsettings-qt-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-linguist
BuildRequires: gsettings-qt
BuildRequires: qt5-qtbase-private-devel
BuildRequires: gsettings-qt-devel
BuildRequires: kiran-qt5-integration-devel
BuildRequires: kiran-qt5-integration
Requires: libX11
Requires: libxcb
@ -30,6 +30,7 @@ Requires: qt5-qtbase
Requires: qt5-qtx11extras
Requires: qt5-qtsvg
Requires: gsettings-qt
Requires: kiran-qt5-integration
Obsoletes: kiranwidgets-qt5
@ -75,6 +76,9 @@ make %{?_smp_mflags}
rm -rf %{buildroot}
%changelog
* Thu Jul 07 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.0-1
- kYOS-F: Release kiranwidgets version 2.3, modify the control drawing, and support dark and light color themes
* Fri Jan 21 2022 liuxinhao <liuxinhao@kylinos.com.cn> - 2.2.0-2.kb4
- KYOS-B: add BuildRequires: qt5-qtbase-private-devel
- KYOS-B: fix compilation errors on OpenEuler