mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Beta version 4.5.4: Mark-as-read-inactive setting.
In case an experimental setting of auto-scrolling is enabled, just ignore the window activity check in marking chat as read..
This commit is contained in:
parent
2efe409c60
commit
3c17fab15a
2 changed files with 9 additions and 12 deletions
|
@ -194,13 +194,6 @@ constexpr auto kCommonModifiers = 0
|
||||||
| Qt::ControlModifier;
|
| Qt::ControlModifier;
|
||||||
const auto kPsaAboutPrefix = "cloud_lng_about_psa_";
|
const auto kPsaAboutPrefix = "cloud_lng_about_psa_";
|
||||||
|
|
||||||
base::options::toggle AutoScrollInactiveChat({
|
|
||||||
.id = kOptionAutoScrollInactiveChat,
|
|
||||||
.name = "Enable auto-scroll of inactive chat",
|
|
||||||
.description = "Enable auto-scrolling chat for new messages, "
|
|
||||||
"even when the window is not in focus.",
|
|
||||||
});
|
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<PeerData*> ActivePeerValue(
|
[[nodiscard]] rpl::producer<PeerData*> ActivePeerValue(
|
||||||
not_null<Window::SessionController*> controller) {
|
not_null<Window::SessionController*> controller) {
|
||||||
return controller->activeChatValue(
|
return controller->activeChatValue(
|
||||||
|
@ -5460,9 +5453,6 @@ int HistoryWidget::countAutomaticScrollTop() {
|
||||||
Expects(_list != nullptr);
|
Expects(_list != nullptr);
|
||||||
|
|
||||||
if (const auto unread = _history->firstUnreadMessage()) {
|
if (const auto unread = _history->firstUnreadMessage()) {
|
||||||
if (AutoScrollInactiveChat.value()) {
|
|
||||||
return ScrollMax;
|
|
||||||
}
|
|
||||||
const auto firstUnreadTop = _list->itemTop(unread);
|
const auto firstUnreadTop = _list->itemTop(unread);
|
||||||
const auto possibleUnreadBarTop = _scroll->scrollTopMax()
|
const auto possibleUnreadBarTop = _scroll->scrollTopMax()
|
||||||
+ HistoryView::UnreadBar::height()
|
+ HistoryView::UnreadBar::height()
|
||||||
|
|
|
@ -76,6 +76,13 @@ void FeedLangTestingKey(int key) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base::options::toggle AutoScrollInactiveChat({
|
||||||
|
.id = kOptionAutoScrollInactiveChat,
|
||||||
|
.name = "Mark as read of inactive chat",
|
||||||
|
.description = "Mark new messages as read and scroll the chat "
|
||||||
|
"even when the window is not in focus.",
|
||||||
|
});
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
||||||
|
@ -538,8 +545,8 @@ bool MainWindow::markingAsRead() const {
|
||||||
&& !_main->isHidden()
|
&& !_main->isHidden()
|
||||||
&& !_main->animatingShow()
|
&& !_main->animatingShow()
|
||||||
&& !_layer
|
&& !_layer
|
||||||
&& isActive()
|
&& (AutoScrollInactiveChat().value()
|
||||||
&& !_main->session().updates().isIdle();
|
|| (isActive() && !_main->session().updates().isIdle()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::checkActivation() {
|
void MainWindow::checkActivation() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue