mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-25 13:15:19 +02:00
Fix opening forums with tabs.
This commit is contained in:
parent
1d26482298
commit
0e5419c60b
6 changed files with 30 additions and 11 deletions
|
@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "dialogs/dialogs_search_tags.h"
|
#include "dialogs/dialogs_search_tags.h"
|
||||||
#include "dialogs/dialogs_quick_action.h"
|
#include "dialogs/dialogs_quick_action.h"
|
||||||
#include "history/view/history_view_context_menu.h"
|
#include "history/view/history_view_context_menu.h"
|
||||||
|
#include "history/view/history_view_subsection_tabs.h"
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
#include "history/history_item.h"
|
#include "history/history_item.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
|
@ -1500,6 +1501,12 @@ bool InnerWidget::isRowActive(
|
||||||
const auto key = row->key();
|
const auto key = row->key();
|
||||||
if (entry.key == key) {
|
if (entry.key == key) {
|
||||||
return true;
|
return true;
|
||||||
|
} else if (const auto topic = entry.key.topic()) {
|
||||||
|
if (const auto history = key.history()) {
|
||||||
|
return (history->peer == topic->channel())
|
||||||
|
&& HistoryView::SubsectionTabs::UsedFor(history);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
} else if (const auto sublist = entry.key.sublist()) {
|
} else if (const auto sublist = entry.key.sublist()) {
|
||||||
if (!sublist->parentChat()) {
|
if (!sublist->parentChat()) {
|
||||||
// In case we're viewing a Saved Messages sublist,
|
// In case we're viewing a Saved Messages sublist,
|
||||||
|
|
|
@ -6466,7 +6466,9 @@ void HistoryWidget::updateControlsGeometry() {
|
||||||
const auto scrollAreaTop = _topBars->y()
|
const auto scrollAreaTop = _topBars->y()
|
||||||
+ businessBotTop
|
+ businessBotTop
|
||||||
+ (_businessBotStatus ? _businessBotStatus->bar().height() : 0);
|
+ (_businessBotStatus ? _businessBotStatus->bar().height() : 0);
|
||||||
_topBars->resize(innerWidth, scrollAreaTop - _topBars->y());
|
_topBars->resize(
|
||||||
|
innerWidth,
|
||||||
|
scrollAreaTop - _topBars->y() + st::lineWidth);
|
||||||
if (_scroll->y() != scrollAreaTop) {
|
if (_scroll->y() != scrollAreaTop) {
|
||||||
_scroll->moveToLeft(tabsLeftSkip, scrollAreaTop);
|
_scroll->moveToLeft(tabsLeftSkip, scrollAreaTop);
|
||||||
if (_autocomplete) {
|
if (_autocomplete) {
|
||||||
|
|
|
@ -468,6 +468,7 @@ ChatWidget::~ChatWidget() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWidget::orderWidgets() {
|
void ChatWidget::orderWidgets() {
|
||||||
|
_topBars->raise();
|
||||||
_translateBar->raise();
|
_translateBar->raise();
|
||||||
if (_topicReopenBar) {
|
if (_topicReopenBar) {
|
||||||
_topicReopenBar->bar().raise();
|
_topicReopenBar->bar().raise();
|
||||||
|
@ -2608,7 +2609,7 @@ void ChatWidget::updateControlsGeometry() {
|
||||||
bottom -= _composeControls->heightCurrent();
|
bottom -= _composeControls->heightCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
_topBars->resize(innerWidth, top);
|
_topBars->resize(innerWidth, top + st::lineWidth);
|
||||||
top += _topBars->y();
|
top += _topBars->y();
|
||||||
|
|
||||||
const auto scrollHeight = bottom - top;
|
const auto scrollHeight = bottom - top;
|
||||||
|
|
|
@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_group_call.h" // GroupCall::input.
|
#include "data/data_group_call.h" // GroupCall::input.
|
||||||
#include "data/data_folder.h"
|
#include "data/data_folder.h"
|
||||||
#include "data/data_forum.h"
|
#include "data/data_forum.h"
|
||||||
|
#include "data/data_saved_messages.h"
|
||||||
#include "data/data_saved_sublist.h"
|
#include "data/data_saved_sublist.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_stories.h"
|
#include "data/data_stories.h"
|
||||||
|
@ -55,6 +56,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_changes.h"
|
#include "data/data_changes.h"
|
||||||
#include "data/data_forum_topic.h"
|
#include "data/data_forum_topic.h"
|
||||||
#include "data/data_send_action.h"
|
#include "data/data_send_action.h"
|
||||||
|
#include "dialogs/dialogs_main_list.h"
|
||||||
#include "chat_helpers/emoji_interactions.h"
|
#include "chat_helpers/emoji_interactions.h"
|
||||||
#include "base/unixtime.h"
|
#include "base/unixtime.h"
|
||||||
#include "support/support_helper.h"
|
#include "support/support_helper.h"
|
||||||
|
@ -488,14 +490,16 @@ void TopBarWidget::paintTopBar(Painter &p) {
|
||||||
const auto sublist = _activeChat.key.sublist();
|
const auto sublist = _activeChat.key.sublist();
|
||||||
const auto topic = _activeChat.key.topic();
|
const auto topic = _activeChat.key.topic();
|
||||||
const auto history = _activeChat.key.history();
|
const auto history = _activeChat.key.history();
|
||||||
const auto namePeer = history
|
const auto broadcastForMonoforum = history
|
||||||
|
? history->peer->monoforumBroadcast()
|
||||||
|
: nullptr;
|
||||||
|
const auto namePeer = broadcastForMonoforum
|
||||||
|
? broadcastForMonoforum
|
||||||
|
: history
|
||||||
? history->peer.get()
|
? history->peer.get()
|
||||||
: sublist
|
: sublist
|
||||||
? sublist->sublistPeer().get()
|
? sublist->sublistPeer().get()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
const auto broadcastForMonoforum = history
|
|
||||||
? history->peer->monoforumBroadcast()
|
|
||||||
: nullptr;
|
|
||||||
if (topic && _activeChat.section == Section::Replies) {
|
if (topic && _activeChat.section == Section::Replies) {
|
||||||
p.setPen(st::dialogsNameFg);
|
p.setPen(st::dialogsNameFg);
|
||||||
topic->chatListNameText().drawElided(
|
topic->chatListNameText().drawElided(
|
||||||
|
@ -519,12 +523,9 @@ void TopBarWidget::paintTopBar(Painter &p) {
|
||||||
}
|
}
|
||||||
} else if (folder
|
} else if (folder
|
||||||
|| (peer && (peer->sharedMediaInfo() || peer->isVerifyCodes()))
|
|| (peer && (peer->sharedMediaInfo() || peer->isVerifyCodes()))
|
||||||
|| broadcastForMonoforum
|
|
||||||
|| (_activeChat.section == Section::Scheduled)
|
|| (_activeChat.section == Section::Scheduled)
|
||||||
|| (_activeChat.section == Section::Pinned)) {
|
|| (_activeChat.section == Section::Pinned)) {
|
||||||
auto text = broadcastForMonoforum
|
auto text = (_activeChat.section == Section::Scheduled)
|
||||||
? broadcastForMonoforum->name() + u" Messages"_q AssertIsDebug()
|
|
||||||
: (_activeChat.section == Section::Scheduled)
|
|
||||||
? ((peer && peer->isSelf())
|
? ((peer && peer->isSelf())
|
||||||
? tr::lng_reminder_messages(tr::now)
|
? tr::lng_reminder_messages(tr::now)
|
||||||
: tr::lng_scheduled_messages(tr::now))
|
: tr::lng_scheduled_messages(tr::now))
|
||||||
|
@ -1690,6 +1691,10 @@ void TopBarWidget::updateOnlineDisplay() {
|
||||||
text = tr::lng_group_status(tr::now);
|
text = tr::lng_group_status(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (const auto monoforum = peer->monoforum()) {
|
||||||
|
const auto chats = monoforum->chatsList();
|
||||||
|
const auto count = chats->fullSize().current();
|
||||||
|
text = tr::lng_filters_chats_count(tr::now, lt_count, count);
|
||||||
} else if (const auto channel = peer->asChannel()) {
|
} else if (const auto channel = peer->asChannel()) {
|
||||||
if (channel->isMegagroup()
|
if (channel->isMegagroup()
|
||||||
&& channel->canViewMembers()
|
&& channel->canViewMembers()
|
||||||
|
|
|
@ -232,7 +232,7 @@ TranslateBar::TranslateBar(
|
||||||
: _controller(controller)
|
: _controller(controller)
|
||||||
, _history(history)
|
, _history(history)
|
||||||
, _wrap(parent, object_ptr<Ui::AbstractButton>(parent))
|
, _wrap(parent, object_ptr<Ui::AbstractButton>(parent))
|
||||||
, _shadow(std::make_unique<Ui::PlainShadow>(_wrap.parentWidget())) {
|
, _shadow(std::make_unique<Ui::PlainShadow>(parent)) {
|
||||||
_wrap.hide(anim::type::instant);
|
_wrap.hide(anim::type::instant);
|
||||||
_shadow->hide();
|
_shadow->hide();
|
||||||
|
|
||||||
|
|
|
@ -1878,6 +1878,10 @@ void SessionController::showForum(
|
||||||
const SectionShow ¶ms) {
|
const SectionShow ¶ms) {
|
||||||
if (showForumInDifferentWindow(forum, params)) {
|
if (showForumInDifferentWindow(forum, params)) {
|
||||||
return;
|
return;
|
||||||
|
} else if (HistoryView::SubsectionTabs::UsedFor(
|
||||||
|
forum->owner().history(forum->channel()))) {
|
||||||
|
showPeerHistory(forum->channel(), params);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
_shownForumLifetime.destroy();
|
_shownForumLifetime.destroy();
|
||||||
if (_shownForum.current() != forum) {
|
if (_shownForum.current() != forum) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue