mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-03 21:54:05 +02:00
feat: send with sound in menu
This commit is contained in:
parent
409165dec6
commit
12b16577ef
4 changed files with 11 additions and 3 deletions
|
@ -66,6 +66,7 @@ ComposeIcons {
|
|||
menuGifAdd: icon;
|
||||
menuGifRemove: icon;
|
||||
menuMute: icon;
|
||||
menuUnmute: icon;
|
||||
menuSchedule: icon;
|
||||
menuWhenOnline: icon;
|
||||
menuSpoiler: icon;
|
||||
|
@ -615,6 +616,7 @@ defaultComposeIcons: ComposeIcons {
|
|||
menuGifAdd: menuIconGif;
|
||||
menuGifRemove: menuIconDelete;
|
||||
menuMute: menuIconMute;
|
||||
menuUnmute: menuIconUnmute;
|
||||
menuSchedule: menuIconSchedule;
|
||||
menuWhenOnline: menuIconWhenOnline;
|
||||
menuSpoiler: menuIconSpoiler;
|
||||
|
|
|
@ -527,7 +527,7 @@ bool ShouldSendSilent(
|
|||
const Api::SendOptions &options) {
|
||||
const auto& settings = AyuSettings::getInstance();
|
||||
if (settings.sendWithoutSound) {
|
||||
return true;
|
||||
return !options.silent;
|
||||
}
|
||||
|
||||
return options.silent
|
||||
|
|
|
@ -644,6 +644,7 @@ storiesEmojiPan: EmojiPan(defaultEmojiPan) {
|
|||
menuGifAdd: icon {{ "menu/gif", storiesComposeWhiteText }};
|
||||
menuGifRemove: icon {{ "menu/delete", storiesComposeWhiteText }};
|
||||
menuMute: icon {{ "menu/mute", storiesComposeWhiteText }};
|
||||
menuUnmute: icon {{ "menu/unmute", storiesComposeWhiteText }};
|
||||
menuSchedule: icon {{ "menu/calendar", storiesComposeWhiteText }};
|
||||
menuWhenOnline: icon {{ "menu/send_when_online", storiesComposeWhiteText }};
|
||||
menuSpoiler: icon {{ "menu/spoiler_on", storiesComposeWhiteText }};
|
||||
|
|
|
@ -58,6 +58,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
// AyuGram includes
|
||||
#include "ayu/ayu_settings.h"
|
||||
|
||||
|
||||
namespace SendMenu {
|
||||
namespace {
|
||||
|
||||
|
@ -690,10 +694,11 @@ FillMenuResult FillSendMenu(
|
|||
: st::defaultComposeIcons;
|
||||
|
||||
if (sending && type != Type::Reminder) {
|
||||
const auto& settings = AyuSettings::getInstance();
|
||||
menu->addAction(
|
||||
tr::lng_send_silent_message(tr::now),
|
||||
settings.sendWithoutSound ? tr::ayu_SendWithSound(tr::now) : tr::lng_send_silent_message(tr::now),
|
||||
[=] { action({ Api::SendOptions{ .silent = true } }, details); },
|
||||
&icons.menuMute);
|
||||
settings.sendWithoutSound ? &icons.menuUnmute : &icons.menuMute);
|
||||
}
|
||||
if (sending && type != Type::SilentOnly) {
|
||||
menu->addAction(
|
||||
|
|
Loading…
Add table
Reference in a new issue