summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-10-09 02:14:31 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-10-09 02:14:31 +0200
commit4002b1ecf150e0135b9af52352ec0b95864a3cab (patch)
tree1229ad5114c75a622ae4a0a0f6b8e81612ee809c /src
parentDon't send avatars over dbus by default (diff)
downloadnheko-4002b1ecf150e0135b9af52352ec0b95864a3cab.tar.xz
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
Diffstat (limited to 'src')
-rw-r--r--src/SingleImagePackModel.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/SingleImagePackModel.cpp b/src/SingleImagePackModel.cpp

index 02c9a3ce..9d8c3409 100644 --- a/src/SingleImagePackModel.cpp +++ b/src/SingleImagePackModel.cpp
@@ -248,6 +248,9 @@ SingleImagePackModel::setIsStickerPack(bool val) using mtx::events::msc2545::PackUsage; if (val != pack.pack->is_sticker()) { pack.pack->usage.set(PackUsage::Sticker, val); + if (!val) + pack.pack->usage.set(PackUsage::Emoji, true); + emit isEmotePackChanged(); emit isStickerPackChanged(); } } @@ -258,7 +261,10 @@ SingleImagePackModel::setIsEmotePack(bool val) using mtx::events::msc2545::PackUsage; if (val != pack.pack->is_emoji()) { pack.pack->usage.set(PackUsage::Emoji, val); + if (!val) + pack.pack->usage.set(PackUsage::Sticker, true); emit isEmotePackChanged(); + emit isStickerPackChanged(); } }