[Option][GUI] Always show scheduled
This commit is contained in:
parent
5baeb46436
commit
9cd026d6b5
8 changed files with 37 additions and 12 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 |
|
|
@ -32,6 +32,7 @@
|
||||||
"ktg_settings_sticker_scale_both": "Apply to sticker width",
|
"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_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_emoji_outline": "Big emoji outline",
|
||||||
|
"ktg_settings_always_show_scheduled": "Always show scheduled",
|
||||||
"ktg_fonts_title": "Fonts",
|
"ktg_fonts_title": "Fonts",
|
||||||
"ktg_settings_fonts": "Change application fonts",
|
"ktg_settings_fonts": "Change application fonts",
|
||||||
"ktg_fonts_reset": "Reset",
|
"ktg_fonts_reset": "Reset",
|
||||||
|
|
|
||||||
|
|
@ -628,6 +628,16 @@ HistoryWidget::HistoryWidget(
|
||||||
});
|
});
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
::Kotato::JsonSettings::Events(
|
||||||
|
"always_show_scheduled"
|
||||||
|
) | rpl::start_with_next([=] {
|
||||||
|
crl::on_main(this, [=] {
|
||||||
|
refreshScheduledToggle();
|
||||||
|
updateControlsVisibility();
|
||||||
|
updateControlsGeometry();
|
||||||
|
});
|
||||||
|
}, lifetime());
|
||||||
|
|
||||||
session().data().webPageUpdates(
|
session().data().webPageUpdates(
|
||||||
) | rpl::filter([=](not_null<WebPageData*> page) {
|
) | rpl::filter([=](not_null<WebPageData*> page) {
|
||||||
return (_previewData == page.get());
|
return (_previewData == page.get());
|
||||||
|
|
@ -2652,19 +2662,23 @@ void HistoryWidget::setupScheduledToggle() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::refreshScheduledToggle() {
|
void HistoryWidget::refreshScheduledToggle() {
|
||||||
const auto has = _history
|
const auto canWrite = _history && _canSendMessages;
|
||||||
&& _canSendMessages
|
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, 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) {
|
|
||||||
_scheduled.destroy();
|
_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", {
|
{ "monospace_large_bubbles", {
|
||||||
.type = SettingType::BoolSetting,
|
.type = SettingType::BoolSetting,
|
||||||
.defaultValue = false, }},
|
.defaultValue = false, }},
|
||||||
|
{ "always_show_scheduled", {
|
||||||
|
.type = SettingType::BoolSetting,
|
||||||
|
.defaultValue = false, }},
|
||||||
};
|
};
|
||||||
|
|
||||||
using OldOptionKey = QString;
|
using OldOptionKey = QString;
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,8 @@ void SetupKotatoChats(
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
AddSubsectionTitle(container, rktr("ktg_settings_chats"));
|
AddSubsectionTitle(container, rktr("ktg_settings_chats"));
|
||||||
|
|
||||||
|
SettingsMenuJsonSwitch(ktg_settings_always_show_scheduled, always_show_scheduled);
|
||||||
|
|
||||||
AddButton(
|
AddButton(
|
||||||
container,
|
container,
|
||||||
rktr("ktg_settings_fonts"),
|
rktr("ktg_settings_fonts"),
|
||||||
|
|
|
||||||
|
|
@ -527,6 +527,11 @@ historyScheduledToggle: IconButton(historyAttach) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
historyRecordVoiceFgInactive: attentionButtonFg;
|
historyRecordVoiceFgInactive: attentionButtonFg;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue