Skip to content

Commit

Permalink
fix: adjust openimagewidget and informationdialog
Browse files Browse the repository at this point in the history
adjust dialog's layout and palette.

Log: fix some ui issue.
Bug: https://pms.uniontech.com/bug-view-168015.html
  • Loading branch information
rb-union committed Jul 23, 2024
1 parent d87d809 commit 42038bb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 48 deletions.
17 changes: 3 additions & 14 deletions src/qml/InformationDialog/PropertyActionItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
15 changes: 2 additions & 13 deletions src/qml/InformationDialog/PropertyItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 20 additions & 21 deletions src/qml/OpenImageWidget.qml
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
// 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 {
id: 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()
}
}
}

0 comments on commit 42038bb

Please sign in to comment.