some tweaks to the library components

This commit is contained in:
Chris Cochrun 2023-04-18 06:42:56 -05:00
parent ecebddf557
commit 990edf3818
2 changed files with 12 additions and 7 deletions

View file

@ -36,7 +36,8 @@ Item {
libraryType: "song" libraryType: "song"
headerLabel: "Songs" headerLabel: "Songs"
itemIcon: "folder-music-symbolic" itemIcon: "folder-music-symbolic"
itemSubtitle: model.author /* itemSubtitle: model.author */
count: innerModel.rowCount()
newItemFunction: (function() { newItemFunction: (function() {
songProxyModel.setFilterRegularExpression(""); songProxyModel.setFilterRegularExpression("");
songProxyModel.songModel.newSong(); songProxyModel.songModel.newSong();
@ -63,7 +64,8 @@ Item {
libraryType: "video" libraryType: "video"
headerLabel: "Videos" headerLabel: "Videos"
itemIcon: "folder-videos-symbolic" itemIcon: "folder-videos-symbolic"
itemSubtitle: model.path /* itemSubtitle: model.path */
count: innerModel.count()
newItemFunction: (function() { newItemFunction: (function() {
videoProxyModel.setFilterRegularExpression(""); videoProxyModel.setFilterRegularExpression("");
}) })
@ -83,7 +85,8 @@ Item {
libraryType: "image" libraryType: "image"
headerLabel: "Images" headerLabel: "Images"
itemIcon: "folder-pictures-symbolic" itemIcon: "folder-pictures-symbolic"
itemSubtitle: model.path /* itemSubtitle: model.path */
count: imageProxyModel.imageModel.count()
newItemFunction: (function() { newItemFunction: (function() {
imageProxyModel.setFilterRegularExpression(""); imageProxyModel.setFilterRegularExpression("");
}) })
@ -103,7 +106,8 @@ Item {
libraryType: "presentation" libraryType: "presentation"
headerLabel: "Presentations" headerLabel: "Presentations"
itemIcon: "x-office-presentation-symbolic" itemIcon: "x-office-presentation-symbolic"
itemSubtitle: model.path /* itemSubtitle: model.path */
count: innerModel.count()
newItemFunction: (function() { newItemFunction: (function() {
presProxyModel.setFilterRegularExpression(""); presProxyModel.setFilterRegularExpression("");
}) })

View file

@ -17,6 +17,7 @@ ColumnLayout {
property string itemLabel property string itemLabel
property string itemSubtitle property string itemSubtitle
property string itemIcon property string itemIcon
property string count
property var newItemFunction property var newItemFunction
property var deleteItemFunction property var deleteItemFunction
property ListView libraryList: libraryList property ListView libraryList: libraryList
@ -66,11 +67,11 @@ ColumnLayout {
} }
Controls.Label { Controls.Label {
id: count id: countLabel
anchors {left: libraryLabel.right anchors {left: libraryLabel.right
verticalCenter: libraryLabel.verticalCenter verticalCenter: libraryLabel.verticalCenter
leftMargin: 15} leftMargin: 15}
text: libraryType == "song" ? innerModel.rowCount() : innerModel.count(innerModel) text: count
color: Kirigami.Theme.disabledTextColor color: Kirigami.Theme.disabledTextColor
} }
@ -229,7 +230,7 @@ ColumnLayout {
clip: true clip: true
label: title label: title
subtitle: { subtitle: {
if (selectedLibrary == "song") if (libraryType == "song")
author author
else if (fileValidation) else if (fileValidation)
filePath; filePath;