diff --git a/imports/Spectral/Component/Timeline/MessageDelegate.qml b/imports/Spectral/Component/Timeline/MessageDelegate.qml index e73c589..19db8f9 100644 --- a/imports/Spectral/Component/Timeline/MessageDelegate.qml +++ b/imports/Spectral/Component/Timeline/MessageDelegate.qml @@ -107,8 +107,8 @@ ColumnLayout { selectByMouse: true readOnly: true wrapMode: Label.Wrap - selectedTextColor: "white" - selectionColor: Material.accent + selectedTextColor: Material.accent + selectionColor: "white" textFormat: Text.RichText onLinkActivated: Qt.openUrlExternally(link) diff --git a/src/imageitem.cpp b/src/imageitem.cpp index 3afa7d4..22047fa 100644 --- a/src/imageitem.cpp +++ b/src/imageitem.cpp @@ -54,13 +54,22 @@ void ImageItem::paint(QPainter *painter) { painter->setFont(font); painter->drawText(bounding_rect, Qt::AlignCenter, m_hint.at(0).toUpper()); } else { + QImage scaled; + if (image.width() > image.height()) { + scaled = image.copy((image.width() - image.height()) / 2, 0, + image.height(), image.height()); + } else { + scaled = image.copy(0, (image.height() - image.width()) / 2, + image.width(), image.width()); + } + if (m_round) { QPainterPath clip; clip.addEllipse(bounding_rect); // this is the shape we want to clip to painter->setClipPath(clip); } - painter->drawImage(bounding_rect, image); + painter->drawImage(bounding_rect, scaled); } }