Skip to content

Commit

Permalink
fix: select item no background color
Browse files Browse the repository at this point in the history
The select flag property can no longer be dynamiclly
insert into the model item, we add it manually.
DTK api update, adjust background color.

Log: Fix select item no background color.
Bug: https://pms.uniontech.com/bug-view-290079.html
Influence: UI
  • Loading branch information
rb-union authored and deepin-bot[bot] committed Dec 14, 2024
1 parent ae6903e commit ef16cd3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/libdmusic/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ struct MediaMeta {
bool toDelete = false;

QString codec; //save codec

bool inMuiltSelect = false; // runtime properties
bool dragFlag = false;
};

struct PlaylistInfo {
Expand Down
4 changes: 4 additions & 0 deletions src/libdmusic/util/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ QVariantMap Utils::metaToVariantMap(const DMusic::MediaMeta &meta)
metaMap.insert("toDelete", meta.toDelete);
metaMap.insert("codec", meta.codec);

// qml runtime properties
metaMap.insert("inMulitSelect", meta.inMuiltSelect);
metaMap.insert("dragFlag", meta.dragFlag);

return metaMap;
}

Expand Down
2 changes: 1 addition & 1 deletion src/music-player/mainwindow/Toolbar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ FloatingPanel {

onPlayModeChanged: {
globalVariant.curPlayMode = playMode
if (mediaData.hash == null)
if (mediaData.hash == "")
return

updatePlayControlBtnStatus()
Expand Down
3 changes: 2 additions & 1 deletion src/music-player/musicList/AllMusicListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ Rectangle {
autoExclusive: false
width: listview.width - 40
height: 56
backgroundVisible: index % 2 === 0
backgroundVisible: true
normalBackgroundVisible: index % 2 === 0
delegateListHash: viewListHash
}

Expand Down
4 changes: 2 additions & 2 deletions src/music-player/musicmousemenu/ImportMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Menu {
}

MenuSeparator {
height: visible ? 12 : 0
height: visible ? implicitHeight : 0
visible: ("play" === pageHash) ? false : true
}

Expand Down Expand Up @@ -59,7 +59,7 @@ Menu {
MenuSeparator {
id: menuSeparator

height: visible ? 12 : 0
height: visible ? implicitHeight : 0
visible: (globalVariant.globalCustomPlaylistModel.tmpModel.count === 0) ? false : true
}

Expand Down
3 changes: 2 additions & 1 deletion src/music-player/playlist/CurrentPlayList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ CurrentFloatingPanel {
height: 56
anchors.left: parent.left
anchors.leftMargin: 10
backgroundVisible: index % 2 === 0
backgroundVisible: true
normalBackgroundVisible: index % 2 === 0
autoExclusive: false
}

Expand Down

0 comments on commit ef16cd3

Please sign in to comment.