Fix sticker width/height on smaller devices

This commit is contained in:
Sebastian Wolf 2020-11-11 13:33:20 +01:00
parent 2b139b926d
commit f93f62e88c
11 changed files with 43 additions and 2 deletions

View file

@ -27,6 +27,7 @@ Item {
readonly property bool animated: stickerData.is_animated && appSettings.animateStickers
readonly property bool stickerVisible: staticStickerLoader.item ? staticStickerLoader.item.visible :
animatedStickerLoader.item ? animatedStickerLoader.item.visible : false
property real aspectRatio: stickerData.width / stickerData.height
implicitWidth: stickerData.width
implicitHeight: stickerData.height
@ -39,8 +40,8 @@ Item {
}
Item {
width: stickerData.width
height: stickerData.height
width: Math.min( stickerData.width, parent.width )
height: width * aspectRatio
// (centered in image mode, text-like in sticker mode)
x: appSettings.showStickersAsImages ? (parent.width - width)/2 :
messageListItem.isOwnMessage ? (parent.width - width) : 0

View file

@ -1074,6 +1074,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation>Fernschreiber ins Öffnen-Mit-Menü von Sailfish OS integrieren</translation>
</message>
<message>
<source>Animate stickers</source>
<translation>Sticker animieren</translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1068,6 +1068,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1075,6 +1075,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1068,6 +1068,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1074,6 +1074,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1080,6 +1080,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1080,6 +1080,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1074,6 +1074,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1068,6 +1068,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>

View file

@ -1068,6 +1068,10 @@
<source>Integrate Fernschreiber into open-with menu of Sailfish OS</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Animate stickers</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StickerPicker</name>