feat: message field configuration
BIN
Telegram/Resources/icons/ayu/message_field/attach.png
Normal file
After Width: | Height: | Size: 452 B |
BIN
Telegram/Resources/icons/ayu/message_field/attach@2x.png
Normal file
After Width: | Height: | Size: 789 B |
BIN
Telegram/Resources/icons/ayu/message_field/attach@3x.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Telegram/Resources/icons/ayu/message_field/commands.png
Normal file
After Width: | Height: | Size: 444 B |
BIN
Telegram/Resources/icons/ayu/message_field/commands@2x.png
Normal file
After Width: | Height: | Size: 760 B |
BIN
Telegram/Resources/icons/ayu/message_field/commands@3x.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
Telegram/Resources/icons/ayu/message_field/emoji.png
Normal file
After Width: | Height: | Size: 514 B |
BIN
Telegram/Resources/icons/ayu/message_field/emoji@2x.png
Normal file
After Width: | Height: | Size: 970 B |
BIN
Telegram/Resources/icons/ayu/message_field/emoji@3x.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
Telegram/Resources/icons/ayu/message_field/ttl.png
Normal file
After Width: | Height: | Size: 493 B |
BIN
Telegram/Resources/icons/ayu/message_field/ttl@2x.png
Normal file
After Width: | Height: | Size: 891 B |
BIN
Telegram/Resources/icons/ayu/message_field/ttl@3x.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
Telegram/Resources/icons/ayu/message_field/voice.png
Normal file
After Width: | Height: | Size: 499 B |
BIN
Telegram/Resources/icons/ayu/message_field/voice@2x.png
Normal file
After Width: | Height: | Size: 911 B |
BIN
Telegram/Resources/icons/ayu/message_field/voice@3x.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
|
@ -5699,6 +5699,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"ayu_SettingsContextMenuReactionsPanel" = "Reactions Panel";
|
"ayu_SettingsContextMenuReactionsPanel" = "Reactions Panel";
|
||||||
"ayu_SettingsContextMenuViewsPanel" = "Views Panel";
|
"ayu_SettingsContextMenuViewsPanel" = "Views Panel";
|
||||||
"ayu_ContextMenuElementsHeader" = "Context Menu Elements";
|
"ayu_ContextMenuElementsHeader" = "Context Menu Elements";
|
||||||
|
"ayu_MessageFieldElementsHeader" = "Message Field Elements";
|
||||||
|
"ayu_MessageFieldPopupsHeader" = "Message Field Popups";
|
||||||
|
"ayu_MessageFieldElementAttach" = "Attach";
|
||||||
|
"ayu_MessageFieldElementCommands" = "Commands";
|
||||||
|
"ayu_MessageFieldElementTTL" = "TTL";
|
||||||
|
"ayu_MessageFieldElementEmoji" = "Emoji";
|
||||||
|
"ayu_MessageFieldElementVoice" = "Voice";
|
||||||
"ayu_DrawerElementsHeader" = "Drawer Elements";
|
"ayu_DrawerElementsHeader" = "Drawer Elements";
|
||||||
"ayu_TrayElementsHeader" = "Tray Elements";
|
"ayu_TrayElementsHeader" = "Tray Elements";
|
||||||
"ayu_SettingsSpoofWebviewAsAndroid" = "Spoof Client as Android";
|
"ayu_SettingsSpoofWebviewAsAndroid" = "Spoof Client as Android";
|
||||||
|
@ -5741,8 +5748,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"ayu_RegexFiltersAdd" = "Add Filter";
|
"ayu_RegexFiltersAdd" = "Add Filter";
|
||||||
"ayu_RegexFiltersEdit" = "Edit Filter";
|
"ayu_RegexFiltersEdit" = "Edit Filter";
|
||||||
"ayu_RegexFiltersPlaceholder" = "Expression";
|
"ayu_RegexFiltersPlaceholder" = "Expression";
|
||||||
"ayu_EnableExpression" = "Enable expression";
|
"ayu_EnableExpression" = "Enable Filter";
|
||||||
"ayu_CaseInsensitiveExpression" = "Case insensitive expression";
|
"ayu_CaseInsensitiveExpression" = "Case Insensitive";
|
||||||
|
"ayu_ReversedExpression" = "Reversed";
|
||||||
"ayu_RegexFiltersAddError" = "Regex syntax error";
|
"ayu_RegexFiltersAddError" = "Regex syntax error";
|
||||||
"ayu_RegexFilterQuickAdd" = "Add Filter";
|
"ayu_RegexFilterQuickAdd" = "Add Filter";
|
||||||
"ayu_RegexFilterBulletinText" = "Filter added to the **Shared filters**.";
|
"ayu_RegexFilterBulletinText" = "Filter added to the **Shared filters**.";
|
||||||
|
|
|
@ -42,6 +42,7 @@ rpl::variable<QString> editedMarkReactive;
|
||||||
rpl::variable<int> showPeerIdReactive;
|
rpl::variable<int> showPeerIdReactive;
|
||||||
|
|
||||||
rpl::variable<bool> hideFromBlockedReactive;
|
rpl::variable<bool> hideFromBlockedReactive;
|
||||||
|
rpl::event_stream<> historyUpdateReactive;
|
||||||
|
|
||||||
rpl::lifetime lifetime = rpl::lifetime();
|
rpl::lifetime lifetime = rpl::lifetime();
|
||||||
|
|
||||||
|
@ -249,6 +250,15 @@ AyuGramSettings::AyuGramSettings() {
|
||||||
showUserMessagesInContextMenu = 2;
|
showUserMessagesInContextMenu = 2;
|
||||||
showMessageDetailsInContextMenu = 2;
|
showMessageDetailsInContextMenu = 2;
|
||||||
|
|
||||||
|
showAttachButtonInMessageField = true;
|
||||||
|
showCommandsButtonInMessageField = true;
|
||||||
|
showEmojiButtonInMessageField = true;
|
||||||
|
showMicrophoneButtonInMessageField = true;
|
||||||
|
showAutoDeleteButtonInMessageField = true;
|
||||||
|
|
||||||
|
showAttachPopup = true;
|
||||||
|
showEmojiPopup = true;
|
||||||
|
|
||||||
showLReadToggleInDrawer = false;
|
showLReadToggleInDrawer = false;
|
||||||
showSReadToggleInDrawer = true;
|
showSReadToggleInDrawer = true;
|
||||||
showGhostToggleInDrawer = true;
|
showGhostToggleInDrawer = true;
|
||||||
|
@ -431,6 +441,41 @@ void AyuGramSettings::set_showMessageDetailsInContextMenu(int val) {
|
||||||
showMessageDetailsInContextMenu = val;
|
showMessageDetailsInContextMenu = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AyuGramSettings::set_showAttachButtonInMessageField(bool val) {
|
||||||
|
showAttachButtonInMessageField = val;
|
||||||
|
triggerHistoryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AyuGramSettings::set_showCommandsButtonInMessageField(bool val) {
|
||||||
|
showCommandsButtonInMessageField = val;
|
||||||
|
triggerHistoryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AyuGramSettings::set_showEmojiButtonInMessageField(bool val) {
|
||||||
|
showEmojiButtonInMessageField = val;
|
||||||
|
triggerHistoryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AyuGramSettings::set_showMicrophoneButtonInMessageField(bool val) {
|
||||||
|
showMicrophoneButtonInMessageField = val;
|
||||||
|
triggerHistoryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AyuGramSettings::set_showAutoDeleteButtonInMessageField(bool val) {
|
||||||
|
showAutoDeleteButtonInMessageField = val;
|
||||||
|
triggerHistoryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AyuGramSettings::set_showAttachPopup(bool val) {
|
||||||
|
showAttachPopup = val;
|
||||||
|
triggerHistoryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AyuGramSettings::set_showEmojiPopup(bool val) {
|
||||||
|
showEmojiPopup = val;
|
||||||
|
triggerHistoryUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
void AyuGramSettings::set_showLReadToggleInDrawer(bool val) {
|
void AyuGramSettings::set_showLReadToggleInDrawer(bool val) {
|
||||||
showLReadToggleInDrawer = val;
|
showLReadToggleInDrawer = val;
|
||||||
}
|
}
|
||||||
|
@ -524,4 +569,12 @@ rpl::producer<bool> get_hideFromBlockedReactive() {
|
||||||
return hideFromBlockedReactive.value();
|
return hideFromBlockedReactive.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void triggerHistoryUpdate() {
|
||||||
|
historyUpdateReactive.fire({});
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<> get_historyUpdateReactive() {
|
||||||
|
return historyUpdateReactive.events();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,15 @@ public:
|
||||||
int showUserMessagesInContextMenu;
|
int showUserMessagesInContextMenu;
|
||||||
int showMessageDetailsInContextMenu;
|
int showMessageDetailsInContextMenu;
|
||||||
|
|
||||||
|
bool showAttachButtonInMessageField;
|
||||||
|
bool showCommandsButtonInMessageField;
|
||||||
|
bool showEmojiButtonInMessageField;
|
||||||
|
bool showMicrophoneButtonInMessageField;
|
||||||
|
bool showAutoDeleteButtonInMessageField;
|
||||||
|
|
||||||
|
bool showAttachPopup;
|
||||||
|
bool showEmojiPopup;
|
||||||
|
|
||||||
bool showLReadToggleInDrawer;
|
bool showLReadToggleInDrawer;
|
||||||
bool showSReadToggleInDrawer;
|
bool showSReadToggleInDrawer;
|
||||||
bool showGhostToggleInDrawer;
|
bool showGhostToggleInDrawer;
|
||||||
|
@ -123,6 +132,15 @@ public:
|
||||||
void set_showUserMessagesInContextMenu(int val);
|
void set_showUserMessagesInContextMenu(int val);
|
||||||
void set_showMessageDetailsInContextMenu(int val);
|
void set_showMessageDetailsInContextMenu(int val);
|
||||||
|
|
||||||
|
void set_showAttachButtonInMessageField(bool val);
|
||||||
|
void set_showCommandsButtonInMessageField(bool val);
|
||||||
|
void set_showEmojiButtonInMessageField(bool val);
|
||||||
|
void set_showMicrophoneButtonInMessageField(bool val);
|
||||||
|
void set_showAutoDeleteButtonInMessageField(bool val);
|
||||||
|
|
||||||
|
void set_showAttachPopup(bool val);
|
||||||
|
void set_showEmojiPopup(bool val);
|
||||||
|
|
||||||
void set_showLReadToggleInDrawer(bool val);
|
void set_showLReadToggleInDrawer(bool val);
|
||||||
void set_showSReadToggleInDrawer(bool val);
|
void set_showSReadToggleInDrawer(bool val);
|
||||||
void set_showGhostToggleInDrawer(bool val);
|
void set_showGhostToggleInDrawer(bool val);
|
||||||
|
@ -181,6 +199,13 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
|
||||||
showHideMessageInContextMenu,
|
showHideMessageInContextMenu,
|
||||||
showUserMessagesInContextMenu,
|
showUserMessagesInContextMenu,
|
||||||
showMessageDetailsInContextMenu,
|
showMessageDetailsInContextMenu,
|
||||||
|
showAttachButtonInMessageField,
|
||||||
|
showCommandsButtonInMessageField,
|
||||||
|
showEmojiButtonInMessageField,
|
||||||
|
showMicrophoneButtonInMessageField,
|
||||||
|
showAutoDeleteButtonInMessageField,
|
||||||
|
showAttachPopup,
|
||||||
|
showEmojiPopup,
|
||||||
showLReadToggleInDrawer,
|
showLReadToggleInDrawer,
|
||||||
showSReadToggleInDrawer,
|
showSReadToggleInDrawer,
|
||||||
showGhostToggleInDrawer,
|
showGhostToggleInDrawer,
|
||||||
|
@ -215,4 +240,7 @@ rpl::producer<bool> get_ghostModeEnabledReactive();
|
||||||
|
|
||||||
rpl::producer<bool> get_hideFromBlockedReactive();
|
rpl::producer<bool> get_hideFromBlockedReactive();
|
||||||
|
|
||||||
|
void triggerHistoryUpdate();
|
||||||
|
rpl::producer<> get_historyUpdateReactive();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,12 @@ ayuStreamerModeMenuIcon: icon {{ "ayu/streamer", menuIconColor }};
|
||||||
|
|
||||||
ayuMenuIconToBeginning: icon {{ "ayu/to_beginning", menuIconColor }};
|
ayuMenuIconToBeginning: icon {{ "ayu/to_beginning", menuIconColor }};
|
||||||
|
|
||||||
|
messageFieldAttachIcon: icon {{ "ayu/message_field/attach", menuIconColor }};
|
||||||
|
messageFieldCommandsIcon: icon {{ "ayu/message_field/commands", menuIconColor }};
|
||||||
|
messageFieldEmojiIcon: icon {{ "ayu/message_field/emoji", menuIconColor }};
|
||||||
|
messageFieldVoiceIcon: icon {{ "ayu/message_field/voice", menuIconColor }};
|
||||||
|
messageFieldTTLIcon: icon {{ "ayu/message_field/ttl", menuIconColor }};
|
||||||
|
|
||||||
inChannelBadgeIcon: icon {{ "ayu/channel", msgInDateFg }};
|
inChannelBadgeIcon: icon {{ "ayu/channel", msgInDateFg }};
|
||||||
inChannelBadgeSelectedIcon: icon {{ "ayu/channel", msgInDateFgSelected }};
|
inChannelBadgeSelectedIcon: icon {{ "ayu/channel", msgInDateFgSelected }};
|
||||||
outChannelBadgeIcon: icon {{ "ayu/channel", msgOutDateFg }};
|
outChannelBadgeIcon: icon {{ "ayu/channel", msgOutDateFg }};
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
//
|
//
|
||||||
// Copyright @Radolyn, 2024
|
// Copyright @Radolyn, 2024
|
||||||
#include "settings_ayu.h"
|
#include "settings_ayu.h"
|
||||||
|
|
||||||
|
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
#include "ayu/ui/boxes/edit_deleted_mark.h"
|
#include "ayu/ui/boxes/edit_deleted_mark.h"
|
||||||
#include "ayu/ui/boxes/edit_edited_mark.h"
|
#include "ayu/ui/boxes/edit_edited_mark.h"
|
||||||
|
@ -17,6 +19,7 @@
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "settings/settings_common.h"
|
#include "settings/settings_common.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
|
#include "styles/style_chat_helpers.h"
|
||||||
#include "styles/style_ayu_styles.h"
|
#include "styles/style_ayu_styles.h"
|
||||||
#include "styles/style_basic.h"
|
#include "styles/style_basic.h"
|
||||||
#include "styles/style_boxes.h"
|
#include "styles/style_boxes.h"
|
||||||
|
@ -346,14 +349,14 @@ void AddCollapsibleToggle(not_null<Ui::VerticalLayout*> container,
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddChooseButtonWithIconAndRightTextInner(not_null<Ui::VerticalLayout*> container,
|
void AddChooseButtonWithIconAndRightTextInner(not_null<Ui::VerticalLayout*> container,
|
||||||
not_null<Window::SessionController*> controller,
|
not_null<Window::SessionController*> controller,
|
||||||
int initialState,
|
int initialState,
|
||||||
std::vector<QString> options,
|
std::vector<QString> options,
|
||||||
rpl::producer<QString> text,
|
rpl::producer<QString> text,
|
||||||
rpl::producer<QString> boxTitle,
|
rpl::producer<QString> boxTitle,
|
||||||
const style::SettingsButton & st,
|
const style::SettingsButton &st,
|
||||||
Settings::IconDescriptor && descriptor,
|
Settings::IconDescriptor &&descriptor,
|
||||||
const Fn<void(int)> &setter) {
|
const Fn<void(int)> &setter) {
|
||||||
auto reactiveVal = container->lifetime().make_state<rpl::variable<int>>(initialState);
|
auto reactiveVal = container->lifetime().make_state<rpl::variable<int>>(initialState);
|
||||||
|
|
||||||
rpl::producer<QString> rightTextReactive = reactiveVal->value() | rpl::map(
|
rpl::producer<QString> rightTextReactive = reactiveVal->value() | rpl::map(
|
||||||
|
@ -885,6 +888,166 @@ void SetupContextMenuElements(not_null<Ui::VerticalLayout*> container,
|
||||||
AddDividerText(container, tr::ayu_SettingsContextMenuDescription());
|
AddDividerText(container, tr::ayu_SettingsContextMenuDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetupMessageFieldElements(not_null<Ui::VerticalLayout*> container) {
|
||||||
|
auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
|
AddSkip(container);
|
||||||
|
AddSubsectionTitle(container, tr::ayu_MessageFieldElementsHeader());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_MessageFieldElementAttach(),
|
||||||
|
st::settingsButton,
|
||||||
|
{&st::messageFieldAttachIcon}
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings->showAttachButtonInMessageField)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings->showAttachButtonInMessageField);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
settings->set_showAttachButtonInMessageField(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_MessageFieldElementCommands(),
|
||||||
|
st::settingsButton,
|
||||||
|
{&st::messageFieldCommandsIcon}
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings->showCommandsButtonInMessageField)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings->showCommandsButtonInMessageField);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
settings->set_showCommandsButtonInMessageField(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_MessageFieldElementTTL(),
|
||||||
|
st::settingsButton,
|
||||||
|
{&st::messageFieldTTLIcon}
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings->showAutoDeleteButtonInMessageField)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings->showAutoDeleteButtonInMessageField);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
settings->set_showAutoDeleteButtonInMessageField(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_MessageFieldElementEmoji(),
|
||||||
|
st::settingsButton,
|
||||||
|
{&st::messageFieldEmojiIcon}
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings->showEmojiButtonInMessageField)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings->showEmojiButtonInMessageField);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
settings->set_showEmojiButtonInMessageField(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_MessageFieldElementVoice(),
|
||||||
|
st::settingsButton,
|
||||||
|
{&st::messageFieldVoiceIcon}
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings->showMicrophoneButtonInMessageField)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings->showMicrophoneButtonInMessageField);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
settings->set_showMicrophoneButtonInMessageField(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddSkip(container);
|
||||||
|
AddDivider(container);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetupMessageFieldPopups(not_null<Ui::VerticalLayout*> container) {
|
||||||
|
auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
|
AddSkip(container);
|
||||||
|
AddSubsectionTitle(container, tr::ayu_MessageFieldPopupsHeader());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_MessageFieldElementAttach(),
|
||||||
|
st::settingsButton,
|
||||||
|
{&st::messageFieldAttachIcon}
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings->showAttachPopup)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings->showAttachPopup);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
settings->set_showAttachPopup(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddButtonWithIcon(
|
||||||
|
container,
|
||||||
|
tr::ayu_MessageFieldElementEmoji(),
|
||||||
|
st::settingsButton,
|
||||||
|
{&st::messageFieldEmojiIcon}
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(settings->showEmojiPopup)
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
return (enabled != settings->showEmojiPopup);
|
||||||
|
}) | start_with_next(
|
||||||
|
[=](bool enabled)
|
||||||
|
{
|
||||||
|
settings->set_showEmojiPopup(enabled);
|
||||||
|
AyuSettings::save();
|
||||||
|
},
|
||||||
|
container->lifetime());
|
||||||
|
|
||||||
|
AddSkip(container);
|
||||||
|
AddDivider(container);
|
||||||
|
}
|
||||||
|
|
||||||
void SetupDrawerElements(not_null<Ui::VerticalLayout*> container) {
|
void SetupDrawerElements(not_null<Ui::VerticalLayout*> container) {
|
||||||
auto settings = &AyuSettings::getInstance();
|
auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
|
@ -1250,9 +1413,9 @@ void SetupFolderSettings(not_null<Ui::VerticalLayout*> container, not_null<Windo
|
||||||
// not about folders, but it's a good place for it
|
// not about folders, but it's a good place for it
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
AddButtonWithIcon(
|
AddButtonWithIcon(
|
||||||
container,
|
container,
|
||||||
tr::ayu_HideNotificationBadge(),
|
tr::ayu_HideNotificationBadge(),
|
||||||
st::settingsButtonNoIcon
|
st::settingsButtonNoIcon
|
||||||
)->toggleOn(
|
)->toggleOn(
|
||||||
rpl::single(settings->hideNotificationBadge)
|
rpl::single(settings->hideNotificationBadge)
|
||||||
)->toggledValue(
|
)->toggledValue(
|
||||||
|
@ -1440,6 +1603,8 @@ void SetupCustomization(not_null<Ui::VerticalLayout*> container,
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
AddDivider(container);
|
AddDivider(container);
|
||||||
SetupContextMenuElements(container, controller);
|
SetupContextMenuElements(container, controller);
|
||||||
|
SetupMessageFieldElements(container);
|
||||||
|
SetupMessageFieldPopups(container);
|
||||||
SetupDrawerElements(container);
|
SetupDrawerElements(container);
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
AddDivider(container);
|
AddDivider(container);
|
||||||
|
|
|
@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "chat_helpers/tabbed_selector.h"
|
#include "chat_helpers/tabbed_selector.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "ayu/ayu_settings.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "base/options.h"
|
#include "base/options.h"
|
||||||
#include "styles/style_chat_helpers.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
|
@ -27,6 +28,7 @@ base::options::toggle TabbedPanelShowOnClick({
|
||||||
.id = kOptionTabbedPanelShowOnClick,
|
.id = kOptionTabbedPanelShowOnClick,
|
||||||
.name = "Show tabbed panel by click",
|
.name = "Show tabbed panel by click",
|
||||||
.description = "Show Emoji / Stickers / GIFs panel only after a click.",
|
.description = "Show Emoji / Stickers / GIFs panel only after a click.",
|
||||||
|
.scope = static_cast<base::options::details::ScopeFlag>(0),
|
||||||
});
|
});
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -464,7 +466,9 @@ void TabbedPanel::showStarted() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TabbedPanel::eventFilter(QObject *obj, QEvent *e) {
|
bool TabbedPanel::eventFilter(QObject *obj, QEvent *e) {
|
||||||
if (TabbedPanelShowOnClick.value()) {
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
|
if (TabbedPanelShowOnClick.value() || !settings->showEmojiPopup) {
|
||||||
return false;
|
return false;
|
||||||
} else if (e->type() == QEvent::Enter) {
|
} else if (e->type() == QEvent::Enter) {
|
||||||
otherEnter();
|
otherEnter();
|
||||||
|
|
|
@ -228,6 +228,13 @@ const auto kPsaAboutPrefix = "cloud_lng_about_psa_";
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SWITCH_BUTTON(button, show_v) \
|
||||||
|
if (show_v) { \
|
||||||
|
(button)->show(); \
|
||||||
|
} else { \
|
||||||
|
(button)->hide(); \
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
HistoryWidget::HistoryWidget(
|
HistoryWidget::HistoryWidget(
|
||||||
|
@ -478,12 +485,13 @@ HistoryWidget::HistoryWidget(
|
||||||
|
|
||||||
_fieldCharsCountManager.limitExceeds(
|
_fieldCharsCountManager.limitExceeds(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
const auto hide = _fieldCharsCountManager.isLimitExceeded();
|
const auto hide = _fieldCharsCountManager.isLimitExceeded();
|
||||||
if (_silent) {
|
if (_silent) {
|
||||||
_silent->setVisible(!hide);
|
_silent->setVisible(!hide);
|
||||||
}
|
}
|
||||||
if (_ttlInfo) {
|
if (_ttlInfo) {
|
||||||
_ttlInfo->setVisible(!hide);
|
_ttlInfo->setVisible(!hide && settings->showAutoDeleteButtonInMessageField);
|
||||||
}
|
}
|
||||||
if (_scheduled) {
|
if (_scheduled) {
|
||||||
_scheduled->setVisible(!hide);
|
_scheduled->setVisible(!hide);
|
||||||
|
@ -807,6 +815,15 @@ HistoryWidget::HistoryWidget(
|
||||||
}
|
}
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
AyuSettings::get_historyUpdateReactive() | rpl::start_with_next([=]
|
||||||
|
{
|
||||||
|
refreshAttachBotsMenu();
|
||||||
|
updateHistoryGeometry();
|
||||||
|
updateControlsVisibility();
|
||||||
|
updateControlsGeometry();
|
||||||
|
this->update();
|
||||||
|
}, lifetime());
|
||||||
|
|
||||||
using MessageUpdateFlag = Data::MessageUpdate::Flag;
|
using MessageUpdateFlag = Data::MessageUpdate::Flag;
|
||||||
session().changes().messageUpdates(
|
session().changes().messageUpdates(
|
||||||
MessageUpdateFlag::Destroyed
|
MessageUpdateFlag::Destroyed
|
||||||
|
@ -2640,8 +2657,10 @@ void HistoryWidget::setHistory(History *history) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
const auto was = _attachBotsMenu && _history && _history->peer->isUser();
|
const auto was = _attachBotsMenu && _history && _history->peer->isUser();
|
||||||
const auto now = _attachBotsMenu && history && history->peer->isUser();
|
const auto now = _attachBotsMenu && history && history->peer->isUser() && settings->showAttachPopup;
|
||||||
if (was && !now) {
|
if (was && !now) {
|
||||||
_attachToggle->removeEventFilter(_attachBotsMenu.get());
|
_attachToggle->removeEventFilter(_attachBotsMenu.get());
|
||||||
_attachBotsMenu->hideFast();
|
_attachBotsMenu->hideFast();
|
||||||
|
@ -2722,6 +2741,9 @@ void HistoryWidget::refreshAttachBotsMenu() {
|
||||||
if (!_history) {
|
if (!_history) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
_attachBotsMenu = InlineBots::MakeAttachBotsMenu(
|
_attachBotsMenu = InlineBots::MakeAttachBotsMenu(
|
||||||
this,
|
this,
|
||||||
controller(),
|
controller(),
|
||||||
|
@ -2733,7 +2755,9 @@ void HistoryWidget::refreshAttachBotsMenu() {
|
||||||
}
|
}
|
||||||
_attachBotsMenu->setOrigin(
|
_attachBotsMenu->setOrigin(
|
||||||
Ui::PanelAnimation::Origin::BottomLeft);
|
Ui::PanelAnimation::Origin::BottomLeft);
|
||||||
_attachToggle->installEventFilter(_attachBotsMenu.get());
|
if (settings->showAttachPopup) {
|
||||||
|
_attachToggle->installEventFilter(_attachBotsMenu.get());
|
||||||
|
}
|
||||||
_attachBotsMenu->heightValue(
|
_attachBotsMenu->heightValue(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
moveFieldControls();
|
moveFieldControls();
|
||||||
|
@ -2982,6 +3006,8 @@ bool HistoryWidget::canWriteMessage() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateControlsVisibility() {
|
void HistoryWidget::updateControlsVisibility() {
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
auto fieldDisabledRemoved = (_fieldDisabled != nullptr);
|
auto fieldDisabledRemoved = (_fieldDisabled != nullptr);
|
||||||
const auto hideExtraButtons = _fieldCharsCountManager.isLimitExceeded();
|
const auto hideExtraButtons = _fieldCharsCountManager.isLimitExceeded();
|
||||||
const auto guard = gsl::finally([&] {
|
const auto guard = gsl::finally([&] {
|
||||||
|
@ -3162,27 +3188,27 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
} else if (_kbReplyTo) {
|
} else if (_kbReplyTo) {
|
||||||
_kbScroll->hide();
|
_kbScroll->hide();
|
||||||
_tabbedSelectorToggle->show();
|
SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField);
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
} else {
|
} else {
|
||||||
_kbScroll->hide();
|
_kbScroll->hide();
|
||||||
_tabbedSelectorToggle->show();
|
SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField);
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
if (_keyboard->hasMarkup()) {
|
if (_keyboard->hasMarkup()) {
|
||||||
_botKeyboardShow->show();
|
_botKeyboardShow->show();
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
} else {
|
} else {
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
_botCommandStart->setVisible(_cmdStartShown);
|
_botCommandStart->setVisible(_cmdStartShown && settings->showCommandsButtonInMessageField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_replaceMedia) {
|
if (_replaceMedia) {
|
||||||
_replaceMedia->show();
|
_replaceMedia->show();
|
||||||
_attachToggle->hide();
|
_attachToggle->hide();
|
||||||
} else {
|
} else {
|
||||||
_attachToggle->show();
|
SWITCH_BUTTON(_attachToggle, settings->showAttachButtonInMessageField);
|
||||||
}
|
}
|
||||||
if (_botMenu.button) {
|
if (_botMenu.button) {
|
||||||
_botMenu.button->show();
|
_botMenu.button->show();
|
||||||
|
@ -3210,7 +3236,7 @@ void HistoryWidget::updateControlsVisibility() {
|
||||||
}
|
}
|
||||||
if (_ttlInfo) {
|
if (_ttlInfo) {
|
||||||
const auto was = _ttlInfo->isVisible();
|
const auto was = _ttlInfo->isVisible();
|
||||||
const auto now = (!_editMsgId) && (!hideExtraButtons);
|
const auto now = (!_editMsgId) && (!hideExtraButtons) && settings->showAutoDeleteButtonInMessageField;
|
||||||
if (was != now) {
|
if (was != now) {
|
||||||
_ttlInfo->setVisible(now);
|
_ttlInfo->setVisible(now);
|
||||||
rightButtonsChanged = true;
|
rightButtonsChanged = true;
|
||||||
|
@ -5024,6 +5050,11 @@ bool HistoryWidget::isSearching() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryWidget::showRecordButton() const {
|
bool HistoryWidget::showRecordButton() const {
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
if (!settings->showMicrophoneButtonInMessageField) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return Media::Capture::instance()->available()
|
return Media::Capture::instance()->available()
|
||||||
&& !_voiceRecordBar->isListenState()
|
&& !_voiceRecordBar->isListenState()
|
||||||
&& !_voiceRecordBar->isRecordingByAnotherBar()
|
&& !_voiceRecordBar->isRecordingByAnotherBar()
|
||||||
|
@ -5233,6 +5264,8 @@ void HistoryWidget::showKeyboardHideButton() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::toggleKeyboard(bool manual) {
|
void HistoryWidget::toggleKeyboard(bool manual) {
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
auto fieldEnabled = canWriteMessage() && !_showAnimation;
|
auto fieldEnabled = canWriteMessage() && !_showAnimation;
|
||||||
if (_kbShown || _kbReplyTo) {
|
if (_kbShown || _kbReplyTo) {
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
|
@ -5268,7 +5301,7 @@ void HistoryWidget::toggleKeyboard(bool manual) {
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
if (fieldEnabled) {
|
if (fieldEnabled) {
|
||||||
_botCommandStart->show();
|
SWITCH_BUTTON(_botCommandStart, settings->showCommandsButtonInMessageField);
|
||||||
}
|
}
|
||||||
_kbScroll->hide();
|
_kbScroll->hide();
|
||||||
_kbShown = false;
|
_kbShown = false;
|
||||||
|
@ -5308,11 +5341,7 @@ void HistoryWidget::toggleKeyboard(bool manual) {
|
||||||
}
|
}
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
updateFieldPlaceholder();
|
updateFieldPlaceholder();
|
||||||
if (_botKeyboardHide->isHidden() && canWriteMessage() && !_showAnimation) {
|
SWITCH_BUTTON(_tabbedSelectorToggle, _botKeyboardHide->isHidden() && canWriteMessage() && !_showAnimation && settings->showEmojiButtonInMessageField);
|
||||||
_tabbedSelectorToggle->show();
|
|
||||||
} else {
|
|
||||||
_tabbedSelectorToggle->hide();
|
|
||||||
}
|
|
||||||
updateField();
|
updateField();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5451,6 +5480,8 @@ bool HistoryWidget::fieldOrDisabledShown() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::moveFieldControls() {
|
void HistoryWidget::moveFieldControls() {
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
auto keyboardHeight = 0;
|
auto keyboardHeight = 0;
|
||||||
auto bottom = height();
|
auto bottom = height();
|
||||||
auto maxKeyboardHeight = computeMaxFieldHeight() - fieldHeight();
|
auto maxKeyboardHeight = computeMaxFieldHeight() - fieldHeight();
|
||||||
|
@ -5474,7 +5505,9 @@ void HistoryWidget::moveFieldControls() {
|
||||||
if (_replaceMedia) {
|
if (_replaceMedia) {
|
||||||
_replaceMedia->moveToLeft(left, buttonsBottom);
|
_replaceMedia->moveToLeft(left, buttonsBottom);
|
||||||
}
|
}
|
||||||
_attachToggle->moveToLeft(left, buttonsBottom); left += _attachToggle->width();
|
if (settings->showAttachButtonInMessageField) {
|
||||||
|
_attachToggle->moveToLeft(left, buttonsBottom); left += _attachToggle->width();
|
||||||
|
}
|
||||||
if (_sendAs) {
|
if (_sendAs) {
|
||||||
_sendAs->moveToLeft(left, buttonsBottom); left += _sendAs->width();
|
_sendAs->moveToLeft(left, buttonsBottom); left += _sendAs->width();
|
||||||
}
|
}
|
||||||
|
@ -5488,14 +5521,14 @@ void HistoryWidget::moveFieldControls() {
|
||||||
_send->moveToRight(right, buttonsBottom); right += _send->width();
|
_send->moveToRight(right, buttonsBottom); right += _send->width();
|
||||||
_voiceRecordBar->moveToLeft(0, bottom - _voiceRecordBar->height());
|
_voiceRecordBar->moveToLeft(0, bottom - _voiceRecordBar->height());
|
||||||
_tabbedSelectorToggle->moveToRight(right, buttonsBottom);
|
_tabbedSelectorToggle->moveToRight(right, buttonsBottom);
|
||||||
_botKeyboardHide->moveToRight(right, buttonsBottom); right += _botKeyboardHide->width();
|
_botKeyboardHide->moveToRight(right, buttonsBottom); right += settings->showEmojiButtonInMessageField || !_botKeyboardHide->isHidden() ? _botKeyboardHide->width() : 0;
|
||||||
_botKeyboardShow->moveToRight(right, buttonsBottom);
|
_botKeyboardShow->moveToRight(right, buttonsBottom);
|
||||||
_botCommandStart->moveToRight(right, buttonsBottom);
|
_botCommandStart->moveToRight(right, buttonsBottom);
|
||||||
if (_silent) {
|
if (_silent) {
|
||||||
_silent->moveToRight(right, buttonsBottom);
|
_silent->moveToRight(right, buttonsBottom);
|
||||||
}
|
}
|
||||||
const auto kbShowShown = _history && !_kbShown && _keyboard->hasMarkup();
|
const auto kbShowShown = _history && !_kbShown && _keyboard->hasMarkup();
|
||||||
if (kbShowShown || _cmdStartShown || _silent) {
|
if (kbShowShown || (_cmdStartShown && settings->showCommandsButtonInMessageField) || _silent) {
|
||||||
right += _botCommandStart->width();
|
right += _botCommandStart->width();
|
||||||
}
|
}
|
||||||
if (_scheduled) {
|
if (_scheduled) {
|
||||||
|
@ -5536,12 +5569,14 @@ void HistoryWidget::moveFieldControls() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateFieldSize() {
|
void HistoryWidget::updateFieldSize() {
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
const auto kbShowShown = _history && !_kbShown && _keyboard->hasMarkup();
|
const auto kbShowShown = _history && !_kbShown && _keyboard->hasMarkup();
|
||||||
auto fieldWidth = width()
|
auto fieldWidth = width()
|
||||||
- _attachToggle->width()
|
- (settings->showAttachButtonInMessageField ? _attachToggle->width() : 0)
|
||||||
- st::historySendRight
|
- st::historySendRight
|
||||||
- _send->width()
|
- _send->width()
|
||||||
- _tabbedSelectorToggle->width();
|
- (settings->showEmojiButtonInMessageField ? _tabbedSelectorToggle->width() : 0);
|
||||||
if (_botMenu.button) {
|
if (_botMenu.button) {
|
||||||
fieldWidth -= st::historyBotMenuSkip + _botMenu.button->width();
|
fieldWidth -= st::historyBotMenuSkip + _botMenu.button->width();
|
||||||
}
|
}
|
||||||
|
@ -5551,7 +5586,7 @@ void HistoryWidget::updateFieldSize() {
|
||||||
if (kbShowShown) {
|
if (kbShowShown) {
|
||||||
fieldWidth -= _botKeyboardShow->width();
|
fieldWidth -= _botKeyboardShow->width();
|
||||||
}
|
}
|
||||||
if (_cmdStartShown) {
|
if (_cmdStartShown && settings->showCommandsButtonInMessageField) {
|
||||||
fieldWidth -= _botCommandStart->width();
|
fieldWidth -= _botCommandStart->width();
|
||||||
}
|
}
|
||||||
if (_silent && _silent->isVisible()) {
|
if (_silent && _silent->isVisible()) {
|
||||||
|
@ -5560,7 +5595,7 @@ void HistoryWidget::updateFieldSize() {
|
||||||
if (_scheduled && _scheduled->isVisible()) {
|
if (_scheduled && _scheduled->isVisible()) {
|
||||||
fieldWidth -= _scheduled->width();
|
fieldWidth -= _scheduled->width();
|
||||||
}
|
}
|
||||||
if (_ttlInfo && _ttlInfo->isVisible()) {
|
if (_ttlInfo && _ttlInfo->isVisible() && settings->showAutoDeleteButtonInMessageField) {
|
||||||
fieldWidth -= _ttlInfo->width();
|
fieldWidth -= _ttlInfo->width();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6586,6 +6621,8 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
const auto wasVisible = _kbShown || _kbReplyTo;
|
const auto wasVisible = _kbShown || _kbReplyTo;
|
||||||
const auto wasMsgId = _keyboard->forMsgId();
|
const auto wasMsgId = _keyboard->forMsgId();
|
||||||
auto changed = false;
|
auto changed = false;
|
||||||
|
@ -6628,7 +6665,7 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) {
|
||||||
showKeyboardHideButton();
|
showKeyboardHideButton();
|
||||||
} else {
|
} else {
|
||||||
_kbScroll->hide();
|
_kbScroll->hide();
|
||||||
_tabbedSelectorToggle->show();
|
SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField);
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
}
|
}
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
|
@ -6648,7 +6685,7 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) {
|
||||||
} else {
|
} else {
|
||||||
if (!_showAnimation) {
|
if (!_showAnimation) {
|
||||||
_kbScroll->hide();
|
_kbScroll->hide();
|
||||||
_tabbedSelectorToggle->show();
|
SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField);
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
_botKeyboardShow->show();
|
_botKeyboardShow->show();
|
||||||
_botCommandStart->hide();
|
_botCommandStart->hide();
|
||||||
|
@ -6666,10 +6703,11 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) {
|
||||||
} else {
|
} else {
|
||||||
if (!_scroll->isHidden()) {
|
if (!_scroll->isHidden()) {
|
||||||
_kbScroll->hide();
|
_kbScroll->hide();
|
||||||
|
//SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField);
|
||||||
_tabbedSelectorToggle->show();
|
_tabbedSelectorToggle->show();
|
||||||
_botKeyboardHide->hide();
|
_botKeyboardHide->hide();
|
||||||
_botKeyboardShow->hide();
|
_botKeyboardShow->hide();
|
||||||
_botCommandStart->setVisible(!_editMsgId);
|
_botCommandStart->setVisible(!_editMsgId && settings->showCommandsButtonInMessageField);
|
||||||
}
|
}
|
||||||
_field->setMaxHeight(computeMaxFieldHeight());
|
_field->setMaxHeight(computeMaxFieldHeight());
|
||||||
_kbShown = false;
|
_kbShown = false;
|
||||||
|
|
|
@ -140,11 +140,11 @@ void SetupExperimental(
|
||||||
: rpl::producer<>()));
|
: rpl::producer<>()));
|
||||||
};
|
};
|
||||||
|
|
||||||
addToggle(ChatHelpers::kOptionTabbedPanelShowOnClick);
|
// addToggle(ChatHelpers::kOptionTabbedPanelShowOnClick);
|
||||||
addToggle(Dialogs::kOptionForumHideChatsList);
|
addToggle(Dialogs::kOptionForumHideChatsList);
|
||||||
addToggle(Core::kOptionFractionalScalingEnabled);
|
addToggle(Core::kOptionFractionalScalingEnabled);
|
||||||
addToggle(Window::kOptionViewProfileInChatsListContextMenu);
|
addToggle(Window::kOptionViewProfileInChatsListContextMenu);
|
||||||
addToggle(Info::Profile::kOptionShowPeerIdBelowAbout);
|
// addToggle(Info::Profile::kOptionShowPeerIdBelowAbout);
|
||||||
addToggle(Ui::kOptionUseSmallMsgBubbleRadius);
|
addToggle(Ui::kOptionUseSmallMsgBubbleRadius);
|
||||||
addToggle(Media::Player::kOptionDisableAutoplayNext);
|
addToggle(Media::Player::kOptionDisableAutoplayNext);
|
||||||
addToggle(kOptionSendLargePhotos);
|
addToggle(kOptionSendLargePhotos);
|
||||||
|
|