Automatic applying of scheduled change
This commit is contained in:
parent
c55c606af6
commit
5a784a360b
7 changed files with 18 additions and 0 deletions
|
|
@ -229,6 +229,10 @@ bool skipPaintEvent(QWidget *widget, QPaintEvent *event) {
|
|||
|
||||
namespace Notify {
|
||||
|
||||
void showScheduledButtonChanged() {
|
||||
if (MainWidget *m = App::main()) m->notify_showScheduledButtonChanged();
|
||||
}
|
||||
|
||||
void userIsBotChanged(UserData *user) {
|
||||
if (MainWidget *m = App::main()) m->notify_userIsBotChanged(user);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ enum ClipStopperType {
|
|||
|
||||
namespace Notify {
|
||||
|
||||
void showScheduledButtonChanged();
|
||||
void userIsBotChanged(UserData *user);
|
||||
void botCommandsChanged(UserData *user);
|
||||
|
||||
|
|
|
|||
|
|
@ -1465,6 +1465,12 @@ void HistoryWidget::notify_userIsBotChanged(UserData *user) {
|
|||
}
|
||||
}
|
||||
|
||||
void HistoryWidget::notify_showScheduledButtonChanged() {
|
||||
refreshScheduledToggle();
|
||||
updateControlsVisibility();
|
||||
updateControlsGeometry();
|
||||
}
|
||||
|
||||
void HistoryWidget::setupShortcuts() {
|
||||
Shortcuts::Requests(
|
||||
) | rpl::filter([=] {
|
||||
|
|
|
|||
|
|
@ -266,6 +266,7 @@ public:
|
|||
void notify_inlineKeyboardMoved(const HistoryItem *item, int oldKeyboardTop, int newKeyboardTop);
|
||||
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);
|
||||
void notify_userIsBotChanged(UserData *user);
|
||||
void notify_showScheduledButtonChanged();
|
||||
|
||||
~HistoryWidget();
|
||||
|
||||
|
|
|
|||
|
|
@ -770,6 +770,10 @@ void MainWidget::notify_userIsBotChanged(UserData *bot) {
|
|||
_history->notify_userIsBotChanged(bot);
|
||||
}
|
||||
|
||||
void MainWidget::notify_showScheduledButtonChanged() {
|
||||
_history->notify_showScheduledButtonChanged();
|
||||
}
|
||||
|
||||
void MainWidget::notify_historyMuteUpdated(History *history) {
|
||||
_dialogs->notify_historyMuteUpdated(history);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,6 +289,7 @@ public:
|
|||
void notify_inlineKeyboardMoved(const HistoryItem *item, int oldKeyboardTop, int newKeyboardTop);
|
||||
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);
|
||||
void notify_userIsBotChanged(UserData *bot);
|
||||
void notify_showScheduledButtonChanged();
|
||||
void notify_historyMuteUpdated(History *history);
|
||||
|
||||
void closeBothPlayers();
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ void SetupKotatoChats(not_null<Ui::VerticalLayout*> container) {
|
|||
return (enabled != cAlwaysShowScheduled());
|
||||
}) | rpl::start_with_next([](bool enabled) {
|
||||
cSetAlwaysShowScheduled(enabled);
|
||||
Notify::showScheduledButtonChanged();
|
||||
}, container->lifetime());
|
||||
|
||||
AddSkip(container);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue