2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Add special filters icons.

This commit is contained in:
John Preston
2020-03-19 15:06:08 +04:00
parent 03da4a5680
commit 9ad5b8ff90
154 changed files with 180 additions and 74 deletions

View File

@@ -0,0 +1,50 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "ui/filter_icons.h"
#include "styles/style_filter_icons.h"
namespace Ui {
namespace {
const auto kIcons = std::vector<FilterIcons>{
{ &st::filtersAll, &st::filtersAllActive },
{ &st::filtersUnread, &st::filtersAllActive },
{ &st::filtersUnmuted, &st::filtersAllActive },
{ &st::filtersBots, &st::filtersAllActive },
{ &st::filtersChannels, &st::filtersChannelsActive },
{ &st::filtersGroups, &st::filtersGroupsActive },
{ &st::filtersPrivate, &st::filtersPrivateActive },
{ &st::filtersCustom, &st::filtersCustomActive },
{ &st::filtersSetup, &st::filtersSetup },
{ &st::foldersCat, &st::foldersCatActive },
{ &st::foldersCrown, &st::foldersCrownActive },
{ &st::foldersFavorite, &st::foldersFavoriteActive },
{ &st::foldersFlower, &st::foldersFlowerActive },
{ &st::foldersGame, &st::foldersGameActive },
{ &st::foldersHome, &st::foldersHomeActive },
{ &st::foldersLove, &st::foldersLoveActive },
{ &st::foldersMask, &st::foldersMaskActive },
{ &st::foldersParty, &st::foldersPartyActive },
{ &st::foldersSport, &st::foldersSportActive },
{ &st::foldersStudy, &st::foldersStudyActive },
{ &st::foldersTrade, &st::foldersTrade },
{ &st::foldersTravel, &st::foldersTravelActive },
{ &st::foldersWork, &st::foldersWorkActive },
};
} // namespace
const FilterIcons &LookupFilterIcon(FilterIcon icon) {
Expects(static_cast<int>(icon) >= 0
&& static_cast<int>(icon) < kIcons.size());
return kIcons[static_cast<int>(icon)];
}
} // namespace Ui

View File

@@ -0,0 +1,52 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace style {
namespace internal {
class Icon;
} // namespace internal
} // namespace style
namespace Ui {
enum class FilterIcon : uchar {
All,
Unread,
Unmuted,
Bots,
Channels,
Groups,
Private,
Custom,
Setup,
Cat,
Crown,
Favorite,
Flower,
Game,
Home,
Love,
Mask,
Party,
Sport,
Study,
Trade,
Travel,
Work,
};
struct FilterIcons {
not_null<const style::internal::Icon*> normal;
not_null<const style::internal::Icon*> active;
};
[[nodiscard]] const FilterIcons &LookupFilterIcon(FilterIcon icon);
} // namespace Ui

View File

@@ -0,0 +1,54 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
using "ui/colors.palette";
filtersAll: icon {{ "filters/filters_all", sideBarIconFg }};
filtersAllActive: icon {{ "filters/filters_all_active", sideBarIconFgActive }};
filtersUnread: icon {{ "filters/filters_unread", sideBarIconFg }};
filtersUnreadActive: icon {{ "filters/filters_unread_active", sideBarIconFgActive }};
filtersUnmuted: icon {{ "filters/filters_unmuted", sideBarIconFg }};
filtersUnmutedActive: icon {{ "filters/filters_unmuted_active", sideBarIconFgActive }};
filtersBots: icon {{ "filters/filters_bots", sideBarIconFg }};
filtersBotsActive: icon {{ "filters/filters_bots_active", sideBarIconFgActive }};
filtersChannels: icon {{ "filters/filters_channels", sideBarIconFg }};
filtersChannelsActive: icon {{ "filters/filters_channels_active", sideBarIconFgActive }};
filtersGroups: icon {{ "filters/filters_groups", sideBarIconFg }};
filtersGroupsActive: icon {{ "filters/filters_groups_active", sideBarIconFgActive }};
filtersPrivate: icon {{ "filters/filters_private", sideBarIconFg }};
filtersPrivateActive: icon {{ "filters/filters_private_active", sideBarIconFgActive }};
filtersCustom: icon {{ "filters/filters_custom", sideBarIconFg }};
filtersCustomActive: icon {{ "filters/filters_custom_active", sideBarIconFgActive }};
filtersSetup: icon {{ "filters/filters_setup", sideBarIconFg }};
foldersCat: icon {{ "filters/folders_cat", sideBarIconFg }};
foldersCatActive: icon {{ "filters/folders_cat_active", sideBarIconFg }};
foldersCrown: icon {{ "filters/folders_crown", sideBarIconFg }};
foldersCrownActive: icon {{ "filters/folders_crown_active", sideBarIconFgActive }};
foldersFavorite: icon {{ "filters/folders_favorite", sideBarIconFg }};
foldersFavoriteActive: icon {{ "filters/folders_favorite_active", sideBarIconFgActive }};
foldersFlower: icon {{ "filters/folders_flower", sideBarIconFg }};
foldersFlowerActive: icon {{ "filters/folders_flower_active", sideBarIconFgActive }};
foldersGame: icon {{ "filters/folders_game", sideBarIconFg }};
foldersGameActive: icon {{ "filters/folders_game_active", sideBarIconFgActive }};
foldersHome: icon {{ "filters/folders_home", sideBarIconFg }};
foldersHomeActive: icon {{ "filters/folders_home_active", sideBarIconFgActive }};
foldersLove: icon {{ "filters/folders_love", sideBarIconFg }};
foldersLoveActive: icon {{ "filters/folders_love_active", sideBarIconFgActive }};
foldersMask: icon {{ "filters/folders_mask", sideBarIconFg }};
foldersMaskActive: icon {{ "filters/folders_mask_active", sideBarIconFgActive }};
foldersParty: icon {{ "filters/folders_party", sideBarIconFg }};
foldersPartyActive: icon {{ "filters/folders_party_active", sideBarIconFgActive }};
foldersSport: icon {{ "filters/folders_sport", sideBarIconFg }};
foldersSportActive: icon {{ "filters/folders_sport_active", sideBarIconFgActive }};
foldersStudy: icon {{ "filters/folders_study", sideBarIconFg }};
foldersStudyActive: icon {{ "filters/folders_study_active", sideBarIconFgActive }};
foldersTrade: icon {{ "filters/folders_trade", sideBarIconFg }};
foldersTravel: icon {{ "filters/folders_travel", sideBarIconFg }};
foldersTravelActive: icon {{ "filters/folders_travel_active", sideBarIconFgActive }};
foldersWork: icon {{ "filters/folders_work", sideBarIconFg }};
foldersWorkActive: icon {{ "filters/folders_work_active", sideBarIconFgActive }};