feat: use custom icon for plugin files

This commit is contained in:
AlexeyZavar
2026-04-06 17:26:00 +03:00
parent c9fcb8fdb4
commit 6e21752528
7 changed files with 17 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

@@ -8,6 +8,7 @@
*/
using "ui/colors.palette";
using "ui/chat/chat.style";
using "ui/widgets/widgets.style";
using "dialogs/dialogs.style";
@@ -71,3 +72,8 @@ dialogsExteraSupporterIcon: ThreeStateIcon {
over: icon {{ "ayu/dialogs_extera_supporter", dialogsVerifiedIconBgOver }};
active: icon {{ "ayu/dialogs_extera_supporter", dialogsVerifiedIconBgActive }};
}
ayuHistoryFileInPlugin: icon {{ "ayu/history_file_plugin", historyFileInIconFg }};
ayuHistoryFileInPluginSelected: icon {{ "ayu/history_file_plugin", historyFileInIconFgSelected }};
ayuHistoryFileOutPlugin: icon {{ "ayu/history_file_plugin", historyFileOutIconFg }};
ayuHistoryFileOutPluginSelected: icon {{ "ayu/history_file_plugin", historyFileOutIconFgSelected }};
@@ -805,6 +805,10 @@ void Document::draw(
: stm->historyFilePlay)
: _data->isImage()
? stm->historyFileImage
: _data->filename().endsWith(
u".plugin"_q,
Qt::CaseInsensitive)
? stm->historyFilePlugin
: stm->historyFileDocument;
} else {
return _data->isSongWithCover()
@@ -480,6 +480,12 @@ ChatStyle::ChatStyle(rpl::producer<ColorIndicesCompressed> colorIndices) {
st::historyFileInDocumentSelected,
st::historyFileOutDocument,
st::historyFileOutDocumentSelected);
make(
&MessageStyle::historyFilePlugin,
st::ayuHistoryFileInPlugin,
st::ayuHistoryFileInPluginSelected,
st::ayuHistoryFileOutPlugin,
st::ayuHistoryFileOutPluginSelected);
make(
&MessageStyle::historyAudioDownload,
st::historyAudioInDownload,
@@ -87,6 +87,7 @@ struct MessageStyle {
style::icon historyFilePause = { Qt::Uninitialized };
style::icon historyFileImage = { Qt::Uninitialized };
style::icon historyFileDocument = { Qt::Uninitialized };
style::icon historyFilePlugin = { Qt::Uninitialized };
style::icon historyAudioDownload = { Qt::Uninitialized };
style::icon historyAudioCancel = { Qt::Uninitialized };
style::icon historyQuizTimer = { Qt::Uninitialized };