diff --git a/Telegram/SourceFiles/chat_helpers/chat_helpers.style b/Telegram/SourceFiles/chat_helpers/chat_helpers.style index 930d2c6d4a..9458fee5c5 100644 --- a/Telegram/SourceFiles/chat_helpers/chat_helpers.style +++ b/Telegram/SourceFiles/chat_helpers/chat_helpers.style @@ -230,7 +230,24 @@ defaultTabbedSearch: TabbedSearch { iconPosition: point(7px, -1px); ripple: emptyRippleAnimation; } - cancel: defaultMultiSelectSearchCancel; + cancel: CrossButton { + width: 33px; + height: 33px; + + cross: CrossAnimation { + size: 27px; + skip: 8px; + stroke: 1.; + minScale: 0.3; + } + crossFg: menuIconFg; + crossFgOver: menuIconFg; + crossPosition: point(1px, 3px); + + duration: 150; + loadingPeriod: 1000; + ripple: emptyRippleAnimation; + } defaultFieldWidth: 101px; groupWidth: 30px; height: 33px; diff --git a/Telegram/SourceFiles/ui/controls/tabbed_search.cpp b/Telegram/SourceFiles/ui/controls/tabbed_search.cpp index fccc891f46..8fd8e822be 100644 --- a/Telegram/SourceFiles/ui/controls/tabbed_search.cpp +++ b/Telegram/SourceFiles/ui/controls/tabbed_search.cpp @@ -228,6 +228,7 @@ SearchWithGroups::SearchWithGroups( initField(); initGroups(); initEdges(); + initButtons(); } anim::type SearchWithGroups::animated() const { @@ -334,6 +335,12 @@ void SearchWithGroups::initEdges() { }, lifetime()); } +void SearchWithGroups::initButtons() { + _cancel->setClickedCallback([=] { + _field->setText(QString()); + }); +} + void SearchWithGroups::ensureRounding(int size, float64 ratio) { const auto rounded = qRound(size * ratio); const auto full = QSize(rounded + 4, rounded); diff --git a/Telegram/SourceFiles/ui/controls/tabbed_search.h b/Telegram/SourceFiles/ui/controls/tabbed_search.h index 552f39043b..b9189a0acf 100644 --- a/Telegram/SourceFiles/ui/controls/tabbed_search.h +++ b/Telegram/SourceFiles/ui/controls/tabbed_search.h @@ -59,6 +59,7 @@ private: void initField(); void initGroups(); void initEdges(); + void initButtons(); void ensureRounding(int size, float64 rounding);