mirror of https://github.com/procxx/kepka.git
				
				
				
			Show unread archive chat names in bold.
This commit is contained in:
		
							parent
							
								
									e55e46a0f0
								
							
						
					
					
						commit
						64dd5139da
					
				|  | @ -102,7 +102,6 @@ void Folder::indexNameParts() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Folder::registerOne(not_null<History*> history) { | void Folder::registerOne(not_null<History*> history) { | ||||||
| 	++_chatListViewVersion; |  | ||||||
| 	if (_chatsList.indexed()->size() == 1) { | 	if (_chatsList.indexed()->size() == 1) { | ||||||
| 		updateChatListSortPosition(); | 		updateChatListSortPosition(); | ||||||
| 		if (!_cloudUnread.known) { | 		if (!_cloudUnread.known) { | ||||||
|  | @ -118,9 +117,6 @@ void Folder::registerOne(not_null<History*> history) { | ||||||
| void Folder::unregisterOne(not_null<History*> history) { | void Folder::unregisterOne(not_null<History*> history) { | ||||||
| 	if (_chatsList.empty()) { | 	if (_chatsList.empty()) { | ||||||
| 		updateChatListExistence(); | 		updateChatListExistence(); | ||||||
| 	} else { |  | ||||||
| 		++_chatListViewVersion; |  | ||||||
| 		updateChatListEntry(); |  | ||||||
| 	} | 	} | ||||||
| 	if (_chatListMessage && _chatListMessage->history() == history) { | 	if (_chatListMessage && _chatListMessage->history() == history) { | ||||||
| 		computeChatListMessage(); | 		computeChatListMessage(); | ||||||
|  | @ -360,6 +356,13 @@ void Folder::unreadStateChanged( | ||||||
| 		const Dialogs::Key &key, | 		const Dialogs::Key &key, | ||||||
| 		const Dialogs::UnreadState &wasState, | 		const Dialogs::UnreadState &wasState, | ||||||
| 		const Dialogs::UnreadState &nowState) { | 		const Dialogs::UnreadState &nowState) { | ||||||
|  | 	if (const auto history = key.history()) { | ||||||
|  | 		if (wasState.empty() != nowState.empty()) { | ||||||
|  | 			++_chatListViewVersion; | ||||||
|  | 			updateChatListEntry(); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	const auto updateCloudUnread = _cloudUnread.known && wasState.known; | 	const auto updateCloudUnread = _cloudUnread.known && wasState.known; | ||||||
| 	const auto notify = _chatsList.loaded() || updateCloudUnread; | 	const auto notify = _chatsList.loaded() || updateCloudUnread; | ||||||
| 	const auto notifier = unreadStateChangeNotifier(notify); | 	const auto notifier = unreadStateChangeNotifier(notify); | ||||||
|  |  | ||||||
|  | @ -72,6 +72,15 @@ dialogsTextPaletteTakenOver: TextPalette(defaultTextPalette) { | ||||||
| dialogsTextPaletteTakenActive: TextPalette(defaultTextPalette) { | dialogsTextPaletteTakenActive: TextPalette(defaultTextPalette) { | ||||||
| 	linkFg: dialogsDraftFgActive; | 	linkFg: dialogsDraftFgActive; | ||||||
| } | } | ||||||
|  | dialogsTextPaletteArchive: TextPalette(defaultTextPalette) { | ||||||
|  | 	linkFg: dialogsArchiveFg; | ||||||
|  | } | ||||||
|  | dialogsTextPaletteArchiveOver: TextPalette(defaultTextPalette) { | ||||||
|  | 	linkFg: dialogsArchiveFgOver; | ||||||
|  | } | ||||||
|  | dialogsTextPaletteArchiveActive: TextPalette(defaultTextPalette) { | ||||||
|  | 	linkFg: dialogsTextFgActive; | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| dialogsMenuToggle: IconButton { | dialogsMenuToggle: IconButton { | ||||||
| 	width: 40px; | 	width: 40px; | ||||||
|  |  | ||||||
|  | @ -172,11 +172,17 @@ void PaintListEntryText( | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 	row->validateListEntryCache(); | 	row->validateListEntryCache(); | ||||||
| 	const auto &palette = active | 	const auto &palette = row->folder() | ||||||
| 		? st::dialogsTextPaletteActive | 		? (active | ||||||
| 		: selected | 			? st::dialogsTextPaletteArchiveActive | ||||||
| 		? st::dialogsTextPaletteOver | 			: selected | ||||||
| 		: st::dialogsTextPalette; | 			? st::dialogsTextPaletteArchiveOver | ||||||
|  | 			: st::dialogsTextPaletteArchive) | ||||||
|  | 		: (active | ||||||
|  | 			? st::dialogsTextPaletteActive | ||||||
|  | 			: selected | ||||||
|  | 			? st::dialogsTextPaletteOver | ||||||
|  | 			: st::dialogsTextPalette); | ||||||
| 	const auto &color = active | 	const auto &color = active | ||||||
| 		? st::dialogsTextFgActive | 		? st::dialogsTextFgActive | ||||||
| 		: selected | 		: selected | ||||||
|  |  | ||||||
|  | @ -35,21 +35,27 @@ QString ComposeFolderListEntryText(not_null<Data::Folder*> folder) { | ||||||
| 		list | 		list | ||||||
| 	) | ranges::view::take( | 	) | ranges::view::take( | ||||||
| 		list.size() - (throwAwayLastName ? 1 : 0) | 		list.size() - (throwAwayLastName ? 1 : 0) | ||||||
| 	) | ranges::view::transform([](not_null<History*> history) { | 	); | ||||||
| 		return history->peer; | 	const auto wrapName = [](not_null<History*> history) { | ||||||
| 	}); | 		const auto name = TextUtilities::Clean(App::peerName(history->peer)); | ||||||
|  | 		return (history->unreadCount() > 0) | ||||||
|  | 			? (textcmdStartSemibold() | ||||||
|  | 				+ textcmdLink(1, name) | ||||||
|  | 				+ textcmdStopSemibold()) | ||||||
|  | 			: name; | ||||||
|  | 	}; | ||||||
| 	const auto shown = int(peers.size()); | 	const auto shown = int(peers.size()); | ||||||
| 	const auto accumulated = [&] { | 	const auto accumulated = [&] { | ||||||
| 		Expects(shown > 0); | 		Expects(shown > 0); | ||||||
| 
 | 
 | ||||||
| 		auto i = peers.begin(); | 		auto i = peers.begin(); | ||||||
| 		auto result = App::peerName(*i); | 		auto result = wrapName(*i); | ||||||
| 		for (++i; i != peers.end(); ++i) { | 		for (++i; i != peers.end(); ++i) { | ||||||
| 			result = lng_archived_last_list( | 			result = lng_archived_last_list( | ||||||
| 				lt_accumulated, | 				lt_accumulated, | ||||||
| 				result, | 				result, | ||||||
| 				lt_chat, | 				lt_chat, | ||||||
| 				App::peerName(*i)); | 				wrapName(*i)); | ||||||
| 		} | 		} | ||||||
| 		return result; | 		return result; | ||||||
| 	}(); | 	}(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue