diff --git a/src/qml/InformationDialog/PropertyActionItemDelegate.qml b/src/qml/InformationDialog/PropertyActionItemDelegate.qml index 865303f0..60ea8866 100644 --- a/src/qml/InformationDialog/PropertyActionItemDelegate.qml +++ b/src/qml/InformationDialog/PropertyActionItemDelegate.qml @@ -27,7 +27,7 @@ Control { } property int corners: RoundRectangle.NoneCorner property string description - property int descriptionWidth: control.width - leftPadding - rightPadding - 10 + property int descriptionWidth: control.width - leftPadding - rightPadding - 20 property string iconName property Palette infoTextColor: Palette { normal: Qt.rgba(0, 0, 0, 1) @@ -154,25 +154,14 @@ Control { ToolTip { id: tip + // 此处代码并非设置背景,而是由palette的变更信号触发 ColorSelector.controlTheme 的更新 + palette.window: DTK.themeType === ApplicationHelper.LightType ? "white" : "black" parent: parent text: control.description visible: parent.focus width: control.width - 5 y: showPicLabel.y + 20 - background: FloatingPanel { - ColorSelector.family: Palette.CrystalColor - implicitHeight: DS.Style.toolTip.height - implicitWidth: 0 - radius: DS.Style.control.radius - - backgroundColor: Palette { - normal { - common: "#f0f0f0" - crystal: Qt.rgba(0.20, 0.2, 0.2, 0.1) - } - } - } contentItem: Text { color: control.palette.toolTipText font: DTK.fontManager.t8 diff --git a/src/qml/InformationDialog/PropertyItemDelegate.qml b/src/qml/InformationDialog/PropertyItemDelegate.qml index 6ff5968a..6d7f9afb 100644 --- a/src/qml/InformationDialog/PropertyItemDelegate.qml +++ b/src/qml/InformationDialog/PropertyItemDelegate.qml @@ -110,25 +110,14 @@ Control { ToolTip { id: tip + // 此处代码并非设置背景,而是由palette的变更信号触发 ColorSelector.controlTheme 的更新 + palette.window: DTK.themeType === ApplicationHelper.LightType ? "white" : "black" parent: parent text: control.description visible: parent.focus width: control.width - 5 y: showlabel.y + 20 - background: FloatingPanel { - ColorSelector.family: Palette.CrystalColor - implicitHeight: DS.Style.toolTip.height - implicitWidth: 0 - radius: DS.Style.control.radius - - backgroundColor: Palette { - normal { - common: "#f0f0f0" - crystal: Qt.rgba(0.20, 0.2, 0.2, 0.1) - } - } - } contentItem: Text { color: control.palette.toolTipText font: DTK.fontManager.t8 diff --git a/src/qml/OpenImageWidget.qml b/src/qml/OpenImageWidget.qml index eb538b85..7491fbd8 100644 --- a/src/qml/OpenImageWidget.qml +++ b/src/qml/OpenImageWidget.qml @@ -1,9 +1,10 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2024 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later import QtQuick 2.11 import QtQuick.Controls 2.4 +import QtQuick.Layouts 1.11 import org.deepin.dtk 1.0 Control { @@ -11,31 +12,29 @@ Control { anchors.fill: parent - DciIcon { - id: openWidgetImage - + ColumnLayout { anchors.centerIn: parent - name: "import_photo" - sourceSize.height: 128 - sourceSize.width: 128 - theme: DTK.themeType - } + spacing: 10 - RecommandButton { - id: openFileBtn + DciIcon { + id: openWidgetImage + + Layout.alignment: Qt.AlignCenter + name: "import_photo" + sourceSize.height: 128 + sourceSize.width: 128 + theme: DTK.themeType + } - font.capitalization: Font.MixedCase - height: 35 - text: qsTr("Open Image") - width: 300 + RecommandButton { + id: openFileBtn - onClicked: stackView.openImageDialog() + Layout.preferredHeight: 35 + Layout.preferredWidth: 300 + font.capitalization: Font.MixedCase + text: qsTr("Open Image") - anchors { - left: openWidgetImage.left - leftMargin: -86 - top: openWidgetImage.bottom - topMargin: 10 + onClicked: stackView.openImageDialog() } } }