Made sticker animation configurable
This commit is contained in:
parent
449784883e
commit
8ca5956722
4 changed files with 30 additions and 1 deletions
|
@ -24,7 +24,7 @@ Item {
|
|||
property ListItem messageListItem
|
||||
|
||||
readonly property var stickerData: messageListItem.myMessage.content.sticker;
|
||||
readonly property bool animated: stickerData.is_animated
|
||||
readonly property bool animated: stickerData.is_animated && appSettings.animateStickers
|
||||
readonly property bool stickerVisible: staticStickerLoader.item ? staticStickerLoader.item.visible :
|
||||
animatedStickerLoader.item ? animatedStickerLoader.item.visible : false
|
||||
|
||||
|
|
|
@ -117,6 +117,15 @@ Page {
|
|||
text: qsTr("Appearance")
|
||||
}
|
||||
|
||||
TextSwitch {
|
||||
checked: appSettings.animateStickers
|
||||
text: qsTr("Animate stickers")
|
||||
automaticCheck: false
|
||||
onClicked: {
|
||||
appSettings.animateStickers = !checked
|
||||
}
|
||||
}
|
||||
|
||||
TextSwitch {
|
||||
checked: appSettings.showStickersAsImages
|
||||
text: qsTr("Show stickers as images")
|
||||
|
|
|
@ -24,6 +24,7 @@ namespace {
|
|||
const QString KEY_SEND_BY_ENTER("sendByEnter");
|
||||
const QString KEY_USE_OPEN_WITH("useOpenWith");
|
||||
const QString KEY_SHOW_STICKERS_AS_IMAGES("showStickersAsImages");
|
||||
const QString KEY_ANIMATE_STICKERS("animateStickers");
|
||||
const QString KEY_NOTIFICATION_FEEDBACK("notificationFeedback");
|
||||
}
|
||||
|
||||
|
@ -73,6 +74,20 @@ void AppSettings::setShowStickersAsImages(bool showAsImages)
|
|||
}
|
||||
}
|
||||
|
||||
bool AppSettings::animateStickers() const
|
||||
{
|
||||
return settings.value(KEY_ANIMATE_STICKERS, true).toBool();
|
||||
}
|
||||
|
||||
void AppSettings::setAnimateStickers(bool animate)
|
||||
{
|
||||
if (animateStickers() != animate) {
|
||||
LOG(KEY_ANIMATE_STICKERS << animate);
|
||||
settings.setValue(KEY_ANIMATE_STICKERS, animate);
|
||||
emit animateStickersChanged();
|
||||
}
|
||||
}
|
||||
|
||||
AppSettings::NotificationFeedback AppSettings::notificationFeedback() const
|
||||
{
|
||||
return (NotificationFeedback) settings.value(KEY_NOTIFICATION_FEEDBACK, (int) NotificationFeedbackAll).toInt();
|
||||
|
|
|
@ -26,6 +26,7 @@ class AppSettings : public QObject {
|
|||
Q_PROPERTY(bool sendByEnter READ getSendByEnter WRITE setSendByEnter NOTIFY sendByEnterChanged)
|
||||
Q_PROPERTY(bool useOpenWith READ getUseOpenWith WRITE setUseOpenWith NOTIFY useOpenWithChanged)
|
||||
Q_PROPERTY(bool showStickersAsImages READ showStickersAsImages WRITE setShowStickersAsImages NOTIFY showStickersAsImagesChanged)
|
||||
Q_PROPERTY(bool animateStickers READ animateStickers WRITE setAnimateStickers NOTIFY animateStickersChanged)
|
||||
Q_PROPERTY(NotificationFeedback notificationFeedback READ notificationFeedback WRITE setNotificationFeedback NOTIFY notificationFeedbackChanged)
|
||||
|
||||
public:
|
||||
|
@ -48,6 +49,9 @@ public:
|
|||
bool showStickersAsImages() const;
|
||||
void setShowStickersAsImages(bool showAsImages);
|
||||
|
||||
bool animateStickers() const;
|
||||
void setAnimateStickers(bool animate);
|
||||
|
||||
NotificationFeedback notificationFeedback() const;
|
||||
void setNotificationFeedback(NotificationFeedback feedback);
|
||||
|
||||
|
@ -55,6 +59,7 @@ signals:
|
|||
void sendByEnterChanged();
|
||||
void useOpenWithChanged();
|
||||
void showStickersAsImagesChanged();
|
||||
void animateStickersChanged();
|
||||
void notificationFeedbackChanged();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue