From be5fcd3869a66aab80c2339be82de153e8c75662 Mon Sep 17 00:00:00 2001 From: renbin Date: Thu, 15 Aug 2024 15:41:03 +0800 Subject: [PATCH] fix: information dialog padding Adjust information dialog label padding; Init PathView currentIndex when component completed. Log: Fix information dialog padding. Bug: https://pms.uniontech.com/bug-view-268607.html --- src/qml/ImageViewer.qml | 6 ++++++ src/qml/InformationDialog/PropertyActionItemDelegate.qml | 2 ++ src/qml/InformationDialog/PropertyItemDelegate.qml | 5 +++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qml/ImageViewer.qml b/src/qml/ImageViewer.qml index 2f930600..abc0c373 100644 --- a/src/qml/ImageViewer.qml +++ b/src/qml/ImageViewer.qml @@ -412,6 +412,12 @@ Item { } } + Component.onCompleted: { + // 首次进入(退出缩略图后创建)重置当前显示的索引 + IV.GStatus.viewFlicking = true; + currentIndex = IV.GControl.viewModel.currentIndex; + IV.GStatus.viewFlicking = false; + } onCurrentIndexChanged: { var curIndex = view.currentIndex; var previousIndex = IV.GControl.viewModel.currentIndex; diff --git a/src/qml/InformationDialog/PropertyActionItemDelegate.qml b/src/qml/InformationDialog/PropertyActionItemDelegate.qml index 1f542457..386f45d6 100644 --- a/src/qml/InformationDialog/PropertyActionItemDelegate.qml +++ b/src/qml/InformationDialog/PropertyActionItemDelegate.qml @@ -78,6 +78,8 @@ Control { ElideLabel { Layout.fillWidth: true + // 系数微调整以满足默认字号标签均显示的效果 + Layout.minimumWidth: descriptionWidth + 5 color: control.ColorSelector.sectionTextColor font: DTK.fontManager.t10 sourceText: control.title diff --git a/src/qml/InformationDialog/PropertyItemDelegate.qml b/src/qml/InformationDialog/PropertyItemDelegate.qml index a3459a7e..b05b9d55 100644 --- a/src/qml/InformationDialog/PropertyItemDelegate.qml +++ b/src/qml/InformationDialog/PropertyItemDelegate.qml @@ -28,7 +28,7 @@ Control { property int contrlIntimplicitHeight: 40 property int corners: RoundRectangle.NoneCorner property string description - property int descriptionWidth: control.width - leftPadding - rightPadding + property int descriptionWidth: control.width - control.leftPadding - control.rightPadding property string iconName property Palette infoTextColor: Palette { normal: Qt.rgba(0, 0, 0, 1) @@ -60,11 +60,12 @@ Control { ElideLabel { Layout.fillWidth: true + // 系数微调整以满足默认字号标签均显示的效果 + Layout.minimumWidth: descriptionWidth + 5 color: control.ColorSelector.sectionTextColor font: DTK.fontManager.t10 sourceText: control.title tipsColor: control.palette.toolTipText - width: descriptionWidth } RowLayout {