mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Properly propagate pack usage to UI
We can't have a pack that is neither sticker nor emoji. Which is why none defaults to both on. That wasn't propagated to the UI, which made the interaction very confusing. It also made some states unsettable, since you can't turn anything off from the none state. fixes #1152
This commit is contained in:
parent
30fde1f8ac
commit
4002b1ecf1
1 changed files with 6 additions and 0 deletions
|
@ -248,6 +248,9 @@ SingleImagePackModel::setIsStickerPack(bool val)
|
||||||
using mtx::events::msc2545::PackUsage;
|
using mtx::events::msc2545::PackUsage;
|
||||||
if (val != pack.pack->is_sticker()) {
|
if (val != pack.pack->is_sticker()) {
|
||||||
pack.pack->usage.set(PackUsage::Sticker, val);
|
pack.pack->usage.set(PackUsage::Sticker, val);
|
||||||
|
if (!val)
|
||||||
|
pack.pack->usage.set(PackUsage::Emoji, true);
|
||||||
|
emit isEmotePackChanged();
|
||||||
emit isStickerPackChanged();
|
emit isStickerPackChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,7 +261,10 @@ SingleImagePackModel::setIsEmotePack(bool val)
|
||||||
using mtx::events::msc2545::PackUsage;
|
using mtx::events::msc2545::PackUsage;
|
||||||
if (val != pack.pack->is_emoji()) {
|
if (val != pack.pack->is_emoji()) {
|
||||||
pack.pack->usage.set(PackUsage::Emoji, val);
|
pack.pack->usage.set(PackUsage::Emoji, val);
|
||||||
|
if (!val)
|
||||||
|
pack.pack->usage.set(PackUsage::Sticker, true);
|
||||||
emit isEmotePackChanged();
|
emit isEmotePackChanged();
|
||||||
|
emit isStickerPackChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue