Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 【UI】整改页面为空的显示问题 #178

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/deepin-album.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<file>qml/ThumbnailImageView/RecentlyDeletedView/RecentlyDeletedView.qml</file>
<file>qml/ThumbnailImageView/ThumbnailImage.qml</file>
<file>qml/ThumbnailImageView/NoPictureView.qml</file>
<file>qml/ThumbnailImageView/ImportView.qml</file>
<file>qml/PreviewImageViewer/AlertToolTip.qml</file>
<file>qml/PreviewImageViewer/FloatingNotice.qml</file>
<file>qml/PreviewImageViewer/FullThumbnail.qml</file>
Expand Down
Binary file modified src/dsg/icons/nopicture1.dci
Binary file not shown.
Binary file modified src/dsg/icons/nopicture2.dci
Binary file not shown.
Binary file added src/dsg/icons/nopicture3.dci
Binary file not shown.
Binary file added src/dsg/icons/nopicture4.dci
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ BaseView {
}

// 若没有数据,显示导入图片视图
ImportView {
NoPictureView {
visible: GStatus.currentViewType === Album.Types.ViewCollecttion && allCollection.numLabelText === "" && albumControl.getAllCount() === 0

bShowImportBtn: true
iconName: "nopicture1"
onVisibleChanged: {
if (visible) {
GStatus.statusBarNumText = ""
Expand Down
31 changes: 9 additions & 22 deletions src/qml/ThumbnailImageView/CustomAlbum/CustomAlbum.qml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ BaseView {
left: parent.left
}
font: DTK.fontManager.t6
text: numLabelText
text: numLabelText !== "" ? numLabelText : qsTr("0 item")
}

// 筛选下拉框
Expand All @@ -150,7 +150,6 @@ BaseView {
}
width: 130
height: 30
visible: !(numLabelText === "" && filterType === 0)
}

MouseArea {
Expand Down Expand Up @@ -188,7 +187,7 @@ BaseView {
}
}

// 仅在自动导入相册筛选无内容时,显示无结果
// 筛选无内容时,显示无结果
Label {
anchors {
top: customAlbumTitleRect.bottom
Expand All @@ -197,30 +196,18 @@ BaseView {
right: parent.right
centerIn: parent
}
visible: numLabelText === "" && filterType > 0 && (isSystemAutoImport || isNormalAutoImport)
visible: numLabelText === "" && filterType > 0
font: DTK.fontManager.t4
color: Qt.rgba(85/255, 85/255, 85/255, 0.4)
text: qsTr("No results")
}

// 仅在自动导入相册无内容时,显示没有图片或视频时显示
Label {
anchors {
top: customAlbumTitleRect.bottom
left: parent.left
bottom: theView.bottom
right: parent.right
centerIn: parent
}
visible: numLabelText === "" && filterType === 0 && (isSystemAutoImport || isNormalAutoImport)
font: DTK.fontManager.t4
color: Qt.rgba(85/255, 85/255, 85/255, 0.4)
text: qsTr("No photos or videos found")
}

// 自定义相册,若没有数据,显示导入图片视图
ImportView {
visible: GStatus.currentViewType === Album.Types.ViewCustomAlbum && numLabelText === "" && isCustom
// 1.自定义相册,若没有数据,显示导入图片视图
// 2.自动导入相册,无内容时,显示没有图片或视频时显示
NoPictureView {
visible: numLabelText === "" && filterType === 0
bShowImportBtn: isCustom
iconName: isCustom ? "nopicture1" : (GStatus.currentViewType === Album.Types.ViewCustomAlbum ? "nopicture2" : "nopicture3")
}

Component.onCompleted: {
Expand Down
20 changes: 16 additions & 4 deletions src/qml/ThumbnailImageView/HaveImportedView/HaveImportedView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ BaseView {
property string selectedText: getSelectedText(selectedPaths)
property alias selectedPaths: theView.selectedPaths
property real titleOpacity: 0.7
property bool bShowImportTips: GStatus.currentViewType === Album.Types.ViewHaveImported && numLabelText === "" && filterType === 0

Connections {
target: albumControl
Expand Down Expand Up @@ -45,8 +46,6 @@ BaseView {
theView.importedListModel.loadImportedInfos()
theView.updateSelectedPaths()
getNumLabelText()

filterCombo.visible = albumControl.getAllInfoConut(1) > 0 || albumControl.getAllInfoConut(2)
}

// 刷新总数标签
Expand Down Expand Up @@ -108,6 +107,17 @@ BaseView {
text: qsTr("Import")
}

Label {
anchors {
top: importedLabel.bottom
topMargin: 10
left: parent.left
}
visible: bShowImportTips
font: DTK.fontManager.t6
text: qsTr("0 item")
}

// 筛选下拉框
FilterComboBox {
id: filterCombo
Expand All @@ -128,8 +138,10 @@ BaseView {
}

// 若没有数据,显示导入图片视图
ImportView {
visible: GStatus.currentViewType === Album.Types.ViewHaveImported && numLabelText === "" && filterType === 0
NoPictureView {
visible: bShowImportTips
bShowImportBtn: true
iconName: "nopicture1"
}

Component.onCompleted: {
Expand Down
55 changes: 0 additions & 55 deletions src/qml/ThumbnailImageView/ImportView.qml

This file was deleted.

58 changes: 36 additions & 22 deletions src/qml/ThumbnailImageView/NoPictureView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,50 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import QtQuick 2.11
import QtQuick.Layouts 1.11
import org.deepin.dtk 1.0


Item {
anchors.fill: parent
Item {
anchors.centerIn: parent
ActionButton {
id: noImageIcon
anchors {
top: parent.top
topMargin: -70
left : parent.left
leftMargin: -width / 2
}

icon {
name:"nopicture1"
width: 140
height: 140
}
property bool bShowImportBtn: false
property string iconName: "nopicture4"

ColumnLayout {
anchors {
centerIn: parent
}
Label{
anchors {
top:noImageIcon.bottom
topMargin: 20
left : parent.left
leftMargin: -width/2

spacing: 15

DciIcon {
id: openViewImageIcon
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 140
Layout.preferredHeight: 100
sourceSize: Qt.size(140, 100)
name: iconName
palette: DTK.makeIconPalette(window.palette)
}

RecommandButton {
id: openPictureBtn

Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 302
Layout.preferredHeight: 36
font.capitalization: Font.MixedCase
text: qsTr("Import Photos and Videos")
visible: bShowImportBtn
onClicked:{
importDialog.open()
}
text:qsTr("No photos or videos found")
}
Label {
Layout.alignment: Qt.AlignHCenter
color: "#7A7A7A"
text: bShowImportBtn ? qsTr("Or drag them here") : qsTr("No photos or videos found")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ BaseView {
}
width: 130
height: 30
visible: !theView.haveSelect && totalCount > 0
visible: (!theView.haveSelect && totalCount > 0) || totalCount === 0
}

WarningButton {
Expand Down Expand Up @@ -254,7 +254,7 @@ BaseView {

// 若没有数据,显示无图片视图
NoPictureView {
visible: GStatus.currentViewType === Album.Types.ViewRecentlyDeleted && numLabelText === "" && filterType === 0
visible: GStatus.currentViewType === Album.Types.ViewRecentlyDeleted && numLabelText === ""/* && filterType === 0*/
}

Component.onCompleted: {
Expand Down
2 changes: 2 additions & 0 deletions src/res.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
<file>dsg/icons/topleft.dci</file>
<file>dsg/icons/nopicture1.dci</file>
<file>dsg/icons/nopicture2.dci</file>
<file>dsg/icons/nopicture3.dci</file>
<file>dsg/icons/nopicture4.dci</file>
<file>dsg/icons/item.dci</file>
<file>dsg/icons/import_left.dci</file>
<file>dsg/icons/back_album.dci</file>
Expand Down
Loading
Loading