Fix cancel search style in emoji panel.

This commit is contained in:
John Preston 2023-01-24 09:12:04 +04:00
parent 88e7f4b662
commit f19e343025
3 changed files with 26 additions and 1 deletions

View File

@ -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;

View File

@ -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);

View File

@ -59,6 +59,7 @@ private:
void initField();
void initGroups();
void initEdges();
void initButtons();
void ensureRounding(int size, float64 rounding);