diff --git a/Telegram/Resources/icons/send_control_scheduled_no_dot.png b/Telegram/Resources/icons/send_control_scheduled_no_dot.png new file mode 100644 index 000000000..ed21b6e95 Binary files /dev/null and b/Telegram/Resources/icons/send_control_scheduled_no_dot.png differ diff --git a/Telegram/Resources/icons/send_control_scheduled_no_dot@2x.png b/Telegram/Resources/icons/send_control_scheduled_no_dot@2x.png new file mode 100644 index 000000000..bc1ecbbf8 Binary files /dev/null and b/Telegram/Resources/icons/send_control_scheduled_no_dot@2x.png differ diff --git a/Telegram/Resources/icons/send_control_scheduled_no_dot@3x.png b/Telegram/Resources/icons/send_control_scheduled_no_dot@3x.png new file mode 100644 index 000000000..d0c17193a Binary files /dev/null and b/Telegram/Resources/icons/send_control_scheduled_no_dot@3x.png differ diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json index eadf8ae16..fd0113552 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -32,6 +32,7 @@ "ktg_settings_sticker_scale_both": "Apply to sticker width", "ktg_settings_sticker_scale_both_about": "When enabled, sticker maximum width will be changed along with sticker height.", "ktg_settings_emoji_outline": "Big emoji outline", + "ktg_settings_always_show_scheduled": "Always show scheduled", "ktg_fonts_title": "Fonts", "ktg_settings_fonts": "Change application fonts", "ktg_fonts_reset": "Reset", diff --git a/Telegram/SourceFiles/chat_helpers/chat_helpers.style b/Telegram/SourceFiles/chat_helpers/chat_helpers.style index 21f1ad3c3..ca5db742f 100644 --- a/Telegram/SourceFiles/chat_helpers/chat_helpers.style +++ b/Telegram/SourceFiles/chat_helpers/chat_helpers.style @@ -1031,6 +1031,11 @@ historyScheduledToggle: IconButton(historyAttach) { { "chat/input_scheduled_dot", attentionButtonFg } }; } +historyScheduledToggleEmpty: IconButton(historyAttach) { + icon: icon {{ "send_control_scheduled_no_dot", historyComposeIconFg }}; + iconOver: icon {{ "send_control_scheduled_no_dot", historyComposeIconFgOver }}; + iconPosition: point(-1px, -1px); +} historyAttachEmojiInner: IconButton(historyAttach) { icon: icon {{ "chat/input_smile_face", historyComposeIconFg }}; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 70e9c8c4b..25fcb8dd9 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -628,6 +628,16 @@ HistoryWidget::HistoryWidget( }); }, lifetime()); + ::Kotato::JsonSettings::Events( + "always_show_scheduled" + ) | rpl::start_with_next([=] { + crl::on_main(this, [=] { + refreshScheduledToggle(); + updateControlsVisibility(); + updateControlsGeometry(); + }); + }, lifetime()); + session().data().channelDifferenceTooLong( ) | rpl::filter([=](not_null channel) { return _peer == channel.get(); @@ -2746,19 +2756,23 @@ void HistoryWidget::setupScheduledToggle() { } void HistoryWidget::refreshScheduledToggle() { - const auto has = _history - && _canSendMessages - && (session().data().scheduledMessages().count(_history) > 0); - if (!_scheduled && has) { - _scheduled.create(this, st::historyScheduledToggle); - _scheduled->show(); - _scheduled->addClickHandler([=] { - controller()->showSection( - std::make_shared(_history)); - }); - orderWidgets(); // Raise drag areas to the top. - } else if (_scheduled && !has) { + const auto canWrite = _history && _canSendMessages; + const auto has = canWrite && (session().data().scheduledMessages().count(_history) > 0); + if (_scheduled && !canWrite) { _scheduled.destroy(); + } else if (canWrite) { + if (_scheduled) { + _scheduled.destroy(); + } + if (::Kotato::JsonSettings::GetBool("always_show_scheduled") || has){ + _scheduled.create(this, (has ? st::historyScheduledToggle : st::historyScheduledToggleEmpty)); + _scheduled->show(); + _scheduled->addClickHandler([=] { + controller()->showSection( + std::make_shared(_history)); + }); + orderWidgets(); // Raise drag areas to the top. + } } } diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp index 022ca0592..f3e16ccde 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp @@ -259,6 +259,9 @@ const std::map> DefinitionMap { { "monospace_large_bubbles", { .type = SettingType::BoolSetting, .defaultValue = false, }}, + { "always_show_scheduled", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, }; using OldOptionKey = QString; diff --git a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp index 8e21641e4..02b339e8e 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp @@ -71,6 +71,8 @@ void SetupKotatoChats( Ui::AddSkip(container); Ui::AddSubsectionTitle(container, rktr("ktg_settings_chats")); + SettingsMenuJsonSwitch(ktg_settings_always_show_scheduled, always_show_scheduled); + container->add(object_ptr