Improve Appearance of Reply Curve (#4077)

This commit is contained in:
Daniel Sage
2022-11-02 04:19:44 -04:00
committed by GitHub
parent 495f3ed4a9
commit 7640677a43
7 changed files with 44 additions and 43 deletions
+9 -7
View File
@@ -678,21 +678,23 @@ void ScalingImageElement::addToContainer(MessageLayoutContainer &container,
ReplyCurveElement::ReplyCurveElement()
: MessageElement(MessageElementFlag::RepliedMessage)
// these values nicely align with a single badge
, neededMargin_(3)
, size_(18, 14)
{
}
void ReplyCurveElement::addToContainer(MessageLayoutContainer &container,
MessageElementFlags flags)
{
static const int width = 18; // Overall width
static const float thickness = 1.5; // Pen width
static const int radius = 6; // Radius of the top left corner
static const int margin = 2; // Top/Left/Bottom margin
if (flags.hasAny(this->getFlags()))
{
QSize boxSize = this->size_ * container.getScale();
container.addElement(new ReplyCurveLayoutElement(
*this, boxSize, 1.5 * container.getScale(),
this->neededMargin_ * container.getScale()));
float scale = container.getScale();
container.addElement(
new ReplyCurveLayoutElement(*this, width * scale, thickness * scale,
radius * scale, margin * scale));
}
}