Skip to content

Commit

Permalink
rlottie: Merge animated emojis and sticker widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
yuraiz committed Feb 13, 2023
1 parent a5964a8 commit edf97cd
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 245 deletions.
1 change: 0 additions & 1 deletion data/resources/resources.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<file compressed="true" preprocess="xml-stripblanks">ui/content-chat-info-window.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/content-event-row.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/content-message-document.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/content-message-animated-emoji.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/content-message-photo.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/content-message-sticker.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/content-message-text.ui</file>
Expand Down
5 changes: 5 additions & 0 deletions data/resources/style-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
background-color: @dark_2;
}

/* sticker must be repainted to a text color in messages */
messagesticker.needs-repainting > overlay > widget > widget {
filter: invert(1);
}

.chat-list row .unread-count-muted {
background-color: @dark_2;
}
Expand Down
27 changes: 0 additions & 27 deletions data/resources/ui/content-message-animated-emoji.ui

This file was deleted.

7 changes: 6 additions & 1 deletion data/resources/ui/content-message-sticker.ui
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<template class="MessageSticker" parent="MessageBase">
<child>
<object class="GtkOverlay" id="overlay">
<child>
<object class="GtkGestureClick" id="click">
<property name="button">1</property>
</object>
</child>
<child>
<object class="AdwBin" id="bin"/>
</child>
Expand All @@ -15,4 +20,4 @@
</object>
</child>
</template>
</interface>
</interface>
176 changes: 0 additions & 176 deletions src/session/content/message_row/animated_emoji.rs

This file was deleted.

6 changes: 2 additions & 4 deletions src/session/content/message_row/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod animated_emoji;
mod base;
mod bubble;
mod document;
Expand All @@ -11,7 +10,6 @@ mod sticker;
mod text;
mod video;

use self::animated_emoji::MessageAnimatedEmoji;
use self::base::{MessageBase, MessageBaseExt, MessageBaseImpl};
use self::bubble::MessageBubble;
use self::document::MessageDocument;
Expand Down Expand Up @@ -338,9 +336,9 @@ impl MessageRow {
}
MessageContent::MessageAnimatedEmoji(data)
if data.animated_emoji.sticker.clone().map(
|s| matches!(s.format, StickerFormat::Tgs)
|s| matches!(s.format, StickerFormat::Webp | StickerFormat::Tgs)
).unwrap_or_default() => {
self.update_specific_content::<_, MessageAnimatedEmoji>(message_.clone());
self.update_specific_content::<_, MessageSticker>(message_.clone());
}
MessageContent::MessagePhoto(_) => {
self.update_specific_content::<_, MessagePhoto>(message_.clone());
Expand Down
Loading

0 comments on commit edf97cd

Please sign in to comment.