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

Added ability to move archive in main menu.

- Added Folder::paintUserpic overload for custom color.
 - Reduced size of _cloudButton.
This commit is contained in:
23rd
2019-05-16 11:39:45 +03:00
committed by John Preston
parent 484ecffb66
commit ece315f3c5
10 changed files with 151 additions and 13 deletions

View File

@@ -84,7 +84,7 @@ public:
void fill();
private:
void addToggleCollapse();
void addTogglesForArchive();
//bool showInfo();
//void addTogglePin();
//void addInfo();
@@ -544,11 +544,11 @@ FolderFiller::FolderFiller(
void FolderFiller::fill() {
if (_source == PeerMenuSource::ChatsList) {
addToggleCollapse();
addTogglesForArchive();
}
}
void FolderFiller::addToggleCollapse() {
void FolderFiller::addTogglesForArchive() {
if (_folder->id() != Data::Folder::kId) {
return;
}
@@ -561,6 +561,18 @@ void FolderFiller::addToggleCollapse() {
controller->session().settings().setArchiveCollapsed(!hidden);
controller->session().saveSettingsDelayed();
});
_addAction(lang(lng_context_archive_to_menu), [=] {
Ui::Toast::Config toast;
toast.text = lang(lng_context_archive_to_menu_info);
toast.maxWidth = st::boxWideWidth;
toast.durationMs = kArchivedToastDuration;
Ui::Toast::Show(toast);
controller->session().settings().setArchiveInMainMenu(
!controller->session().settings().archiveInMainMenu());
controller->session().saveSettingsDelayed();
});
}
//
//void FolderFiller::addInfo() {