Merge branch 'master' into openEuler-22.03-LTS-Next
This commit is contained in:
commit
c0c9586ebb
@ -1,7 +1,7 @@
|
||||
From bb02ffffe0ff6a51bc8fc6dd7ad09d4e7b278aff Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Wed, 30 Nov 2022 13:53:05 +0800
|
||||
Subject: [PATCH] feat(KiranLabel,KiranPasswdEdit): new control
|
||||
Subject: [PATCH 1/3] feat(KiranLabel,KiranPasswdEdit): new control
|
||||
KiranLabel,KiranPasswdEdit
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From d9b440c4fc2192084dd1cb531dd74f0063d8a9de Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Thu, 1 Dec 2022 16:37:12 +0800
|
||||
Subject: [PATCH 2/3] fix(KiranSiderbarWidget): If the text is too wide and too
|
||||
long, it will be omitted
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 文本过宽过长超过分配空间大小的情况下,对文本进行省略
|
||||
---
|
||||
.../kiran-sidebar-widget/kiran-siderbar-delegate.cpp | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/widgets/kiran-sidebar-widget/kiran-siderbar-delegate.cpp b/src/widgets/kiran-sidebar-widget/kiran-siderbar-delegate.cpp
|
||||
index f900fef..2ad8fbe 100644
|
||||
--- a/src/widgets/kiran-sidebar-widget/kiran-siderbar-delegate.cpp
|
||||
+++ b/src/widgets/kiran-sidebar-widget/kiran-siderbar-delegate.cpp
|
||||
@@ -84,7 +84,9 @@ void KiranSiderbarDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
||||
{
|
||||
//将存储的数据根据locale转换
|
||||
QString text = textForRole(Qt::DisplayRole, displayVar, option.locale);
|
||||
- drawDisplay(painter, opt, textRect, text);
|
||||
+ //处理文本过宽,超出分配的空间时,对文本进行省略
|
||||
+ QString elideText = option.fontMetrics.elidedText(text, Qt::ElideRight, textRect.width(),Qt::TextShowMnemonic);
|
||||
+ drawDisplay(painter, opt, textRect, elideText);
|
||||
}
|
||||
|
||||
//status desc
|
||||
@@ -265,6 +267,13 @@ void KiranSiderbarDelegate::doLayout(const QStyleOptionViewItem &option, const Q
|
||||
int textSpaceX = pixmapSize.isEmpty() ? pixmapRectTemp.right() : pixmapRectTemp.right() + 10;
|
||||
int textSpaceWidth = statusDescRectTemp.left() - (statusDescSize.isEmpty() ? 0 : 10) - textSpaceX;
|
||||
QRect textRectTemp = QRect(textSpaceX, rect.y(), textSpaceWidth, rect.height());
|
||||
+
|
||||
+ //对TextSize进行限制,若文字大小超出了剩余的控空间大小,调整为剩余控件大小
|
||||
+ if ( textSize.width() > textRectTemp.width() )
|
||||
+ {
|
||||
+ textSize.setWidth(textRectTemp.width());
|
||||
+ }
|
||||
+
|
||||
textRect.setSize(textSize);
|
||||
if (option.displayAlignment & Qt::AlignLeft)
|
||||
{
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
From c158fb1f0616606f68fdd281a4632fb927065e1f Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Thu, 1 Dec 2022 16:48:10 +0800
|
||||
Subject: [PATCH 3/3] fix(KiranTitlebarWindow): Fix when zoomed
|
||||
twice_GTK_FRAME_EXTENTS attribute needs to be updated
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复缩放两倍时_GTK_FRAME_EXTENTS属性需要更新的问题
|
||||
---
|
||||
.../kiran-titlebar-window/kiran-titlebar-window-private.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/widgets/kiran-titlebar-window/kiran-titlebar-window-private.cpp b/src/widgets/kiran-titlebar-window/kiran-titlebar-window-private.cpp
|
||||
index b16871e..18a2aa3 100644
|
||||
--- a/src/widgets/kiran-titlebar-window/kiran-titlebar-window-private.cpp
|
||||
+++ b/src/widgets/kiran-titlebar-window/kiran-titlebar-window-private.cpp
|
||||
@@ -548,7 +548,8 @@ bool KiranTitlebarWindowPrivate::eventFilter(QObject *obj, QEvent *event)
|
||||
// 在接近显示时进行处理设置_GTK_FRAME_EXTENTS属性
|
||||
if( m_isCompositingManagerRunning )
|
||||
{
|
||||
- XLibHelper::SetShadowWidth(QX11Info::display(),q_ptr->winId(),shadowWidth,shadowWidth,shadowWidth,shadowWidth);
|
||||
+ int scaledShadowWidth = q_ptr->devicePixelRatio()*shadowWidth;
|
||||
+ XLibHelper::SetShadowWidth(QX11Info::display(), q_ptr->winId(), scaledShadowWidth, scaledShadowWidth, scaledShadowWidth, scaledShadowWidth);
|
||||
}
|
||||
break;
|
||||
case QEvent::HoverMove:
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
Name: kiran-widgets-qt5
|
||||
Version: 2.4.0
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: Encapsulated QT Widget
|
||||
Summary(zh_CN): 封装的Qt小部件
|
||||
|
||||
License: MulanPSL-2.0
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
Patch0001: 0001-feat-KiranLabel-KiranPasswdEdit-new-control-KiranLab.patch
|
||||
Patch0002: 0002-fix-KiranSiderbarWidget-If-the-text-is-too-wide-and-.patch
|
||||
Patch0003: 0003-fix-KiranTitlebarWindow-Fix-when-zoomed-twice_GTK_FR.patch
|
||||
|
||||
BuildRequires: cmake >= 3.5
|
||||
BuildRequires: gcc-c++
|
||||
@ -77,6 +80,10 @@ make %{?_smp_mflags}
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%changelog
|
||||
* Fri Dec 02 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.4.0-3
|
||||
- KYOS-F: If the text is too wide and too long, it will be omitted
|
||||
- KYOS-F: Fix when zoomed twice_GTK_FRAME_EXTENTS attribute needs to be updated
|
||||
|
||||
* Wed Nov 30 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.4.0-2
|
||||
- KYOS-F: add KiranLabel,KiranPasswdEdit
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user