Don't hide scheduled messages button
This commit is contained in:
parent
27ddacf71d
commit
3588a73646
5 changed files with 10 additions and 6 deletions
BIN
Telegram/Resources/icons/send_control_scheduled_no_dot.png
Normal file
BIN
Telegram/Resources/icons/send_control_scheduled_no_dot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
Telegram/Resources/icons/send_control_scheduled_no_dot@2x.png
Normal file
BIN
Telegram/Resources/icons/send_control_scheduled_no_dot@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Telegram/Resources/icons/send_control_scheduled_no_dot@3x.png
Normal file
BIN
Telegram/Resources/icons/send_control_scheduled_no_dot@3x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -283,6 +283,11 @@ historyScheduledToggle: IconButton(historyAttach) {
|
||||||
};
|
};
|
||||||
iconPosition: point(-1px, -1px);
|
iconPosition: point(-1px, -1px);
|
||||||
}
|
}
|
||||||
|
historyScheduledToggleEmpty: IconButton(historyAttach) {
|
||||||
|
icon: icon {{ "send_control_scheduled_no_dot", historyComposeIconFg }};
|
||||||
|
iconOver: icon {{ "send_control_scheduled_no_dot", historyComposeIconFgOver }};
|
||||||
|
iconPosition: point(-1px, -1px);
|
||||||
|
}
|
||||||
historyRecordVoiceFg: historyComposeIconFg;
|
historyRecordVoiceFg: historyComposeIconFg;
|
||||||
historyRecordVoiceFgOver: historyComposeIconFgOver;
|
historyRecordVoiceFgOver: historyComposeIconFgOver;
|
||||||
historyRecordVoiceFgActive: windowBgActive;
|
historyRecordVoiceFgActive: windowBgActive;
|
||||||
|
|
|
||||||
|
|
@ -1959,17 +1959,16 @@ void HistoryWidget::setupScheduledToggle() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::refreshScheduledToggle() {
|
void HistoryWidget::refreshScheduledToggle() {
|
||||||
const auto has = _history
|
const auto canWrite = _history && _peer->canWrite();
|
||||||
&& _peer->canWrite()
|
const auto has = canWrite && (session().data().scheduledMessages().count(_history) > 0);
|
||||||
&& (session().data().scheduledMessages().count(_history) > 0);
|
if (!_scheduled && canWrite) {
|
||||||
if (!_scheduled && has) {
|
_scheduled.create(this, (has ? st::historyScheduledToggle : st::historyScheduledToggleEmpty));
|
||||||
_scheduled.create(this, st::historyScheduledToggle);
|
|
||||||
_scheduled->show();
|
_scheduled->show();
|
||||||
_scheduled->addClickHandler([=] {
|
_scheduled->addClickHandler([=] {
|
||||||
controller()->showSection(
|
controller()->showSection(
|
||||||
HistoryView::ScheduledMemento(_history));
|
HistoryView::ScheduledMemento(_history));
|
||||||
});
|
});
|
||||||
} else if (_scheduled && !has) {
|
} else if (_scheduled && !canWrite) {
|
||||||
_scheduled.destroy();
|
_scheduled.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue