Replaced icon color for songs with bright one.

This commit is contained in:
23rd 2021-01-24 09:40:26 +03:00
parent d4bbbdb65c
commit 9b9531d279
7 changed files with 81 additions and 14 deletions

View File

@ -963,7 +963,7 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) {
}
const auto icon = &(_isAudio
? st::historyFileInPlay
? st::historyFileSongPlay
: _isImage
? st::historyFileInImage
: st::historyFileInDocument);

View File

@ -456,19 +456,44 @@ void Document::draw(
const auto icon = [&] {
if (_data->waitingForAlbum()) {
if (_data->isSong()) {
return &(selected
? st::historyFileSongWaitingSelected
: st::historyFileSongWaiting);
}
return &(outbg ? (selected ? st::historyFileOutWaitingSelected : st::historyFileOutWaiting) : (selected ? st::historyFileInWaitingSelected : st::historyFileInWaiting));
} else if (!cornerDownload && (_data->loading() || _data->uploading())) {
if (_data->isSong()) {
return &(selected
? st::historyFileSongCancelSelected
: st::historyFileSongCancel);
}
return &(outbg ? (selected ? st::historyFileOutCancelSelected : st::historyFileOutCancel) : (selected ? st::historyFileInCancelSelected : st::historyFileInCancel));
} else if (showPause) {
if (_data->isSong()) {
return &(selected
? st::historyFileSongPauseSelected
: st::historyFileSongPause);
}
return &(outbg ? (selected ? st::historyFileOutPauseSelected : st::historyFileOutPause) : (selected ? st::historyFileInPauseSelected : st::historyFileInPause));
} else if (loaded || _dataMedia->canBePlayed()) {
if (_dataMedia->canBePlayed()) {
if (_data->isSong()) {
return &(selected
? st::historyFileSongPlaySelected
: st::historyFileSongPlay);
}
return &(outbg ? (selected ? st::historyFileOutPlaySelected : st::historyFileOutPlay) : (selected ? st::historyFileInPlaySelected : st::historyFileInPlay));
} else if (_data->isImage()) {
return &(outbg ? (selected ? st::historyFileOutImageSelected : st::historyFileOutImage) : (selected ? st::historyFileInImageSelected : st::historyFileInImage));
}
return &(outbg ? (selected ? st::historyFileOutDocumentSelected : st::historyFileOutDocument) : (selected ? st::historyFileInDocumentSelected : st::historyFileInDocument));
}
if (_data->isSong()) {
return &(selected
? st::historyFileSongDownloadSelected
: st::historyFileSongDownload);
}
return &(outbg ? (selected ? st::historyFileOutDownloadSelected : st::historyFileOutDownload) : (selected ? st::historyFileInDownloadSelected : st::historyFileInDownload));
}();
const auto previous = [&]() -> const style::icon* {

View File

@ -896,6 +896,8 @@ void File::paint(Painter &p, const QRect &clip, const PaintContext *context) con
return &st::historyFileInPause;
} else if (_document->isImage()) {
return &st::historyFileInImage;
} else if (_document->isSong()) {
return &st::historyFileSongPlay;
} else if (_document->isVoiceMessage()
|| _document->isAudioFile()) {
return &st::historyFileInPlay;

View File

@ -28,6 +28,15 @@ OverviewFileLayout {
songDownload: icon;
songDownloadSelected: icon;
voicePause: icon;
voicePauseSelected: icon;
voicePlay: icon;
voicePlaySelected: icon;
voiceCancel: icon;
voiceCancelSelected: icon;
voiceDownload: icon;
voiceDownloadSelected: icon;
filePadding: margins;
fileThumbSize: pixels;
fileNameTop: pixels;
@ -64,14 +73,23 @@ overviewFileExtTop: 24px;
overviewFileExtFg: windowFgActive;
overviewFileExtFont: font(18px semibold);
overviewSongPause: icon {{ "playlist_pause", historyFileInIconFg }};
overviewSongPauseSelected: icon {{ "playlist_pause", historyFileInIconFgSelected }};
overviewSongPlay: icon {{ "playlist_play", historyFileInIconFg }};
overviewSongPlaySelected: icon {{ "playlist_play", historyFileInIconFgSelected }};
overviewSongCancel: icon {{ "playlist_cancel", historyFileInIconFg }};
overviewSongCancelSelected: icon {{ "playlist_cancel", historyFileInIconFgSelected }};
overviewSongDownload: icon {{ "playlist_download", historyFileInIconFg }};
overviewSongDownloadSelected: icon {{ "playlist_download", historyFileInIconFgSelected }};
overviewVoicePause: icon {{ "playlist_pause", historyFileInIconFg }};
overviewVoicePauseSelected: icon {{ "playlist_pause", historyFileInIconFgSelected }};
overviewVoicePlay: icon {{ "playlist_play", historyFileInIconFg }};
overviewVoicePlaySelected: icon {{ "playlist_play", historyFileInIconFgSelected }};
overviewVoiceCancel: icon {{ "playlist_cancel", historyFileInIconFg }};
overviewVoiceCancelSelected: icon {{ "playlist_cancel", historyFileInIconFgSelected }};
overviewVoiceDownload: icon {{ "playlist_download", historyFileInIconFg }};
overviewVoiceDownloadSelected: icon {{ "playlist_download", historyFileInIconFgSelected }};
overviewSongPause: icon {{ "playlist_pause", historyFileThumbIconFg }};
overviewSongPauseSelected: icon {{ "playlist_pause", historyFileThumbIconFgSelected }};
overviewSongPlay: icon {{ "playlist_play", historyFileThumbIconFg }};
overviewSongPlaySelected: icon {{ "playlist_play", historyFileThumbIconFgSelected }};
overviewSongCancel: icon {{ "playlist_cancel", historyFileThumbIconFg }};
overviewSongCancelSelected: icon {{ "playlist_cancel", historyFileThumbIconFgSelected }};
overviewSongDownload: icon {{ "playlist_download", historyFileThumbIconFg }};
overviewSongDownloadSelected: icon {{ "playlist_download", historyFileThumbIconFgSelected }};
overviewSmallCancel: icon {{ "history_audio_cancel", historyFileInIconFg }};
overviewSmallCancelSelected: icon {{ "history_audio_cancel", historyFileInIconFgSelected }};
overviewSmallDownload: icon {{ "history_audio_download", historyFileInIconFg }};
@ -93,6 +111,15 @@ overviewFileLayout: OverviewFileLayout {
songDownload: overviewSongDownload;
songDownloadSelected: overviewSongDownloadSelected;
voicePause: overviewVoicePause;
voicePauseSelected: overviewVoicePauseSelected;
voicePlay: overviewVoicePlay;
voicePlaySelected: overviewVoicePlaySelected;
voiceCancel: overviewVoiceCancel;
voiceCancelSelected: overviewVoiceCancelSelected;
voiceDownload: overviewVoiceDownload;
voiceDownloadSelected: overviewVoiceDownloadSelected;
filePadding: margins(0px, 3px, 16px, 3px);
fileThumbSize: 70px;
fileNameTop: 7px;

View File

@ -734,13 +734,15 @@ void Voice::paint(Painter &p, const QRect &clip, TextSelection selection, const
const auto icon = [&] {
if (_data->loading() || _data->uploading()) {
return &(selected ? _st.songCancelSelected : _st.songCancel);
return &(selected ? _st.voiceCancelSelected : _st.voiceCancel);
} else if (showPause) {
return &(selected ? _st.songPauseSelected : _st.songPause);
return &(selected ? _st.voicePauseSelected : _st.voicePause);
} else if (_dataMedia->canBePlayed()) {
return &(selected ? _st.songPlaySelected : _st.songPlay);
return &(selected ? _st.voicePlaySelected : _st.voicePlay);
}
return &(selected ? _st.songDownloadSelected : _st.songDownload);
return &(selected
? _st.voiceDownloadSelected
: _st.voiceDownload);
}();
icon->paintInCenter(p, inner);
}

View File

@ -168,7 +168,7 @@ void SingleFilePreview::paintEvent(QPaintEvent *e) {
}
auto &icon = _fileIsAudio
? st::historyFileInPlay
? st::historyFileSongPlay
: _fileIsImage
? st::historyFileInImage
: st::historyFileInDocument;

View File

@ -160,6 +160,17 @@ historyFileOutWaitingSelected: icon {{ "mediaview_save_check", historyFileOutIco
historyFileInWaiting: icon {{ "mediaview_save_check", historyFileInIconFg }};
historyFileInWaitingSelected: icon {{ "mediaview_save_check", historyFileInIconFgSelected }};
historyFileSongPause: icon {{ "history_file_pause", historyFileThumbIconFg }};
historyFileSongPauseSelected: icon {{ "history_file_pause", historyFileThumbIconFgSelected }};
historyFileSongPlay: icon {{ "history_file_play", historyFileThumbIconFg }};
historyFileSongPlaySelected: icon {{ "history_file_play", historyFileThumbIconFgSelected }};
historyFileSongCancel: icon {{ "history_file_cancel", historyFileThumbIconFg }};
historyFileSongCancelSelected: icon {{ "history_file_cancel", historyFileThumbIconFgSelected }};
historyFileSongDownload: icon {{ "history_file_download", historyFileThumbIconFg }};
historyFileSongDownloadSelected: icon {{ "history_file_download", historyFileThumbIconFgSelected }};
historyFileSongWaiting: icon {{ "mediaview_save_check", historyFileThumbIconFg }};
historyFileSongWaitingSelected: icon {{ "mediaview_save_check", historyFileThumbIconFgSelected }};
historyFileThumbDownload: icon {{ "history_file_download", historyFileThumbIconFg }};
historyFileThumbDownloadSelected: icon {{ "history_file_download", historyFileThumbIconFgSelected }};
historyFileThumbCancel: icon {{ "history_file_cancel", historyFileThumbIconFg }};