mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-29 13:47:47 +00:00
[Option][GUI] Always show scheduled
This commit is contained in:
parent
514e8ba9f8
commit
393bb7d455
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 |
@ -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",
|
||||
|
@ -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 }};
|
||||
|
@ -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<ChannelData*> 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<HistoryView::ScheduledMemento>(_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<HistoryView::ScheduledMemento>(_history));
|
||||
});
|
||||
orderWidgets(); // Raise drag areas to the top.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,6 +259,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
|
||||
{ "monospace_large_bubbles", {
|
||||
.type = SettingType::BoolSetting,
|
||||
.defaultValue = false, }},
|
||||
{ "always_show_scheduled", {
|
||||
.type = SettingType::BoolSetting,
|
||||
.defaultValue = false, }},
|
||||
};
|
||||
|
||||
using OldOptionKey = QString;
|
||||
|
@ -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<Button>(
|
||||
container,
|
||||
rktr("ktg_settings_fonts"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user