mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +02:00
Fix faved+recent stickers icon highlight.
This commit is contained in:
parent
362b3bc578
commit
4f1a633019
2 changed files with 19 additions and 12 deletions
|
@ -266,16 +266,23 @@ void StickersListWidget::Footer::preloadImages() {
|
||||||
void StickersListWidget::Footer::validateSelectedIcon(
|
void StickersListWidget::Footer::validateSelectedIcon(
|
||||||
uint64 setId,
|
uint64 setId,
|
||||||
ValidateIconAnimations animations) {
|
ValidateIconAnimations animations) {
|
||||||
auto newSelected = 0;
|
auto favedIconIndex = -1;
|
||||||
|
auto newSelected = -1;
|
||||||
for (auto i = 0, l = _icons.size(); i != l; ++i) {
|
for (auto i = 0, l = _icons.size(); i != l; ++i) {
|
||||||
if (_icons[i].setId == setId
|
if (_icons[i].setId == setId
|
||||||
|| (_icons[i].setId == Stickers::FavedSetId
|
|| (_icons[i].setId == Stickers::FavedSetId
|
||||||
&& setId == Stickers::RecentSetId)) {
|
&& setId == Stickers::RecentSetId)) {
|
||||||
newSelected = i;
|
newSelected = i;
|
||||||
break;
|
break;
|
||||||
|
} else if (_icons[i].setId == Stickers::FavedSetId) {
|
||||||
|
favedIconIndex = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setSelectedIcon(newSelected, animations);
|
setSelectedIcon(
|
||||||
|
(newSelected >= 0
|
||||||
|
? newSelected
|
||||||
|
: (favedIconIndex >= 0) ? favedIconIndex : 0),
|
||||||
|
animations);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StickersListWidget::Footer::setSelectedIcon(
|
void StickersListWidget::Footer::setSelectedIcon(
|
||||||
|
|
|
@ -126,11 +126,11 @@ FormRequest::FormRequest(
|
||||||
const QString &callbackUrl,
|
const QString &callbackUrl,
|
||||||
const QString &publicKey,
|
const QString &publicKey,
|
||||||
const QString &payload)
|
const QString &payload)
|
||||||
: botId(botId)
|
: botId(botId)
|
||||||
, scope(scope)
|
, scope(scope)
|
||||||
, callbackUrl(callbackUrl)
|
, callbackUrl(callbackUrl)
|
||||||
, publicKey(publicKey)
|
, publicKey(publicKey)
|
||||||
, payload(payload) {
|
, payload(payload) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EditFile::EditFile(
|
EditFile::EditFile(
|
||||||
|
@ -184,9 +184,9 @@ Value::Value(Type type) : type(type) {
|
||||||
FormController::FormController(
|
FormController::FormController(
|
||||||
not_null<Window::Controller*> controller,
|
not_null<Window::Controller*> controller,
|
||||||
const FormRequest &request)
|
const FormRequest &request)
|
||||||
: _controller(controller)
|
: _controller(controller)
|
||||||
, _request(PreprocessRequest(request))
|
, _request(PreprocessRequest(request))
|
||||||
, _view(std::make_unique<PanelController>(this)) {
|
, _view(std::make_unique<PanelController>(this)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormController::show() {
|
void FormController::show() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue