mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Added experimental option to disable floating reactions strip.
This commit is contained in:
parent
86fa98dfbb
commit
a32a9aa3fc
4 changed files with 19 additions and 1 deletions
Telegram/SourceFiles
history/view/reactions
settings
window
|
@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/click_handler_types.h"
|
||||
#include "main/main_session.h"
|
||||
#include "base/event_filter.h"
|
||||
#include "base/options.h"
|
||||
#include "styles/style_chat.h"
|
||||
#include "styles/style_chat_helpers.h"
|
||||
#include "styles/style_menu_icons.h"
|
||||
|
@ -59,8 +60,15 @@ constexpr auto kRefreshListDelay = crl::time(100);
|
|||
return CountMaxSizeWithMargins(st::reactionCornerShadow);
|
||||
}
|
||||
|
||||
base::options::toggle OptionDisableFloatReactions({
|
||||
.id = kOptionDisableFloatReactions,
|
||||
.name = "Disable floating reactions strip",
|
||||
});
|
||||
|
||||
} // namespace
|
||||
|
||||
const char kOptionDisableFloatReactions[] = "disable-float-reactions";
|
||||
|
||||
Button::Button(
|
||||
Fn<void(QRect)> update,
|
||||
ButtonParameters parameters,
|
||||
|
@ -445,6 +453,11 @@ void Manager::showButtonDelayed() {
|
|||
|
||||
void Manager::applyList(const Data::PossibleItemReactionsRef &reactions) {
|
||||
using Button = Strip::AddedButton;
|
||||
if (OptionDisableFloatReactions.value()) {
|
||||
_strip.applyList({}, Button::None);
|
||||
_tagsStrip = {};
|
||||
return;
|
||||
}
|
||||
_strip.applyList(
|
||||
reactions.recent,
|
||||
(/*reactions.customAllowed
|
||||
|
|
|
@ -38,6 +38,8 @@ class Session;
|
|||
|
||||
namespace HistoryView::Reactions {
|
||||
|
||||
extern const char kOptionDisableFloatReactions[];
|
||||
|
||||
enum class ExpandDirection {
|
||||
Up,
|
||||
Down,
|
||||
|
|
|
@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "chat_helpers/tabbed_panel.h"
|
||||
#include "dialogs/dialogs_widget.h"
|
||||
#include "info/profile/info_profile_actions.h"
|
||||
#include "history/view/reactions/history_view_reactions_button.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "mainwindow.h"
|
||||
#include "media/player/media_player_instance.h"
|
||||
|
@ -157,6 +158,7 @@ void SetupExperimental(
|
|||
addToggle(Data::kOptionExternalVideoPlayer);
|
||||
addToggle(Window::kOptionNewWindowsSizeAsFirst);
|
||||
addToggle(Window::kOptionDisableTouchbar);
|
||||
addToggle(HistoryView::Reactions::kOptionDisableFloatReactions);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -76,7 +76,8 @@ base::options::toggle OptionNewWindowsSizeAsFirst({
|
|||
|
||||
base::options::toggle OptionDisableTouchbar({
|
||||
.id = kOptionDisableTouchbar,
|
||||
.name = "Disable Touch Bar (macOS only).",
|
||||
.name = "Disable Touch Bar.",
|
||||
.description = "macOS only",
|
||||
.scope = [] {
|
||||
#ifdef Q_OS_MAC
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue