mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-03 18:25:33 +00:00
fix(Chat/CompactMessageView): removed space above image in msg
Closes #6855
This commit is contained in:
parent
ba50c69b76
commit
07dbca905c
@ -1015,7 +1015,7 @@ Rectangle {
|
|||||||
var symbols = ":='xX><0O;*dB8-D#%\\";
|
var symbols = ":='xX><0O;*dB8-D#%\\";
|
||||||
if ((length > 1) && (symbols.indexOf(getText((cursorPosition - 2), (cursorPosition - 1))) !== -1)
|
if ((length > 1) && (symbols.indexOf(getText((cursorPosition - 2), (cursorPosition - 1))) !== -1)
|
||||||
&& (!getText((cursorPosition - 7), cursorPosition).includes("http"))) {
|
&& (!getText((cursorPosition - 7), cursorPosition).includes("http"))) {
|
||||||
const emojis = EmojiJSON.emoji_json.filter(function (emoji) {
|
const emojis = StatusQUtils.Emoji.emojiJSON.emoji_json.filter(function (emoji) {
|
||||||
if (emoji.aliases_ascii.includes(getText((cursorPosition - 2), cursorPosition)) ||
|
if (emoji.aliases_ascii.includes(getText((cursorPosition - 2), cursorPosition)) ||
|
||||||
emoji.aliases_ascii.includes(getText((cursorPosition - 3), cursorPosition))) {
|
emoji.aliases_ascii.includes(getText((cursorPosition - 3), cursorPosition))) {
|
||||||
var has2Chars = emoji.aliases_ascii.includes(getText((cursorPosition - 2), cursorPosition));
|
var has2Chars = emoji.aliases_ascii.includes(getText((cursorPosition - 2), cursorPosition));
|
||||||
|
@ -24,7 +24,17 @@ Item {
|
|||||||
|
|
||||||
z: 51
|
z: 51
|
||||||
|
|
||||||
implicitHeight: visible ? (showMoreLoader.active ? childrenRect.height - 10 : chatText.height) : 0
|
implicitHeight: {
|
||||||
|
if (!visible)
|
||||||
|
return 0;
|
||||||
|
if (!chatText.visible && showMoreLoader.active)
|
||||||
|
return childrenRect.height - 10;
|
||||||
|
if (root.veryLongChatText && !root.readMore)
|
||||||
|
return Math.min(chatText.contentHeight, 200);
|
||||||
|
if (chatText.getText(0, chatText.text.length) !== "")
|
||||||
|
return chatText.contentHeight;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// This function is to avoid the binding loop warning
|
// This function is to avoid the binding loop warning
|
||||||
function setWidths() {
|
function setWidths() {
|
||||||
@ -44,14 +54,12 @@ Item {
|
|||||||
StyledTextEdit {
|
StyledTextEdit {
|
||||||
id: chatText
|
id: chatText
|
||||||
objectName: "chatText"
|
objectName: "chatText"
|
||||||
visible: !showMoreLoader.active || root.readMore
|
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
font.pixelSize: Style.current.primaryTextFontSize
|
font.pixelSize: Style.current.primaryTextFontSize
|
||||||
readOnly: true
|
readOnly: true
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
color: Style.current.textColor
|
color: Style.current.textColor
|
||||||
height: root.veryLongChatText && !root.readMore ? Math.min(implicitHeight, 200) : implicitHeight
|
|
||||||
clip: height < implicitHeight
|
clip: height < implicitHeight
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
root.linkActivated(link)
|
root.linkActivated(link)
|
||||||
|
@ -537,6 +537,7 @@ Item {
|
|||||||
anchors.rightMargin: root.chatHorizontalPadding
|
anchors.rightMargin: root.chatHorizontalPadding
|
||||||
anchors.topMargin: (!chatName.visible || !chatReply.active || !pinnedRectangleLoader.active) ? 4 : 0
|
anchors.topMargin: (!chatName.visible || !chatReply.active || !pinnedRectangleLoader.active) ? 4 : 0
|
||||||
visible: !editModeOn
|
visible: !editModeOn
|
||||||
|
|
||||||
ChatTextView {
|
ChatTextView {
|
||||||
id: chatText
|
id: chatText
|
||||||
readonly property int leftPadding: chatImage.anchors.leftMargin + chatImage.width + chatHorizontalPadding
|
readonly property int leftPadding: chatImage.anchors.leftMargin + chatImage.width + chatHorizontalPadding
|
||||||
@ -547,11 +548,7 @@ Item {
|
|||||||
anchors.topMargin: isEmoji ? 2 : 0
|
anchors.topMargin: isEmoji ? 2 : 0
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
// using a padding instead of a margin let's us select text more easily
|
|
||||||
anchors.leftMargin: -leftPadding
|
|
||||||
textField.leftPadding: leftPadding
|
|
||||||
textField.rightPadding: Style.current.bigPadding
|
textField.rightPadding: Style.current.bigPadding
|
||||||
|
|
||||||
onLinkActivated: {
|
onLinkActivated: {
|
||||||
if (activityCenterMessage) {
|
if (activityCenterMessage) {
|
||||||
root.clickMessage(false, isSticker, false, null, false, false, false, false, "")
|
root.clickMessage(false, isSticker, false, null, false, false, false, false, "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user