Apply fixed width for checkmark for all messages
This commit is contained in:
parent
a15079c68f
commit
2dcc01633e
@ -182,6 +182,7 @@ TimelineItem::setupLocalWidgetLayout(Widget *widget,
|
|||||||
messageLayout_->addLayout(widgetLayout, 1);
|
messageLayout_->addLayout(widgetLayout, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
messageLayout_->addWidget(checkmark_);
|
||||||
messageLayout_->addWidget(timestamp_);
|
messageLayout_->addWidget(timestamp_);
|
||||||
mainLayout_->addLayout(messageLayout_);
|
mainLayout_->addLayout(messageLayout_);
|
||||||
}
|
}
|
||||||
@ -232,6 +233,7 @@ TimelineItem::setupWidgetLayout(Widget *widget,
|
|||||||
messageLayout_->addLayout(widgetLayout, 1);
|
messageLayout_->addLayout(widgetLayout, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
messageLayout_->addWidget(checkmark_);
|
||||||
messageLayout_->addWidget(timestamp_);
|
messageLayout_->addWidget(timestamp_);
|
||||||
mainLayout_->addLayout(messageLayout_);
|
mainLayout_->addLayout(messageLayout_);
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
#include "timeline/widgets/ImageItem.h"
|
#include "timeline/widgets/ImageItem.h"
|
||||||
#include "timeline/widgets/VideoItem.h"
|
#include "timeline/widgets/VideoItem.h"
|
||||||
|
|
||||||
|
constexpr const static char *CHECKMARK = "✓";
|
||||||
|
|
||||||
void
|
void
|
||||||
TimelineItem::init()
|
TimelineItem::init()
|
||||||
{
|
{
|
||||||
@ -62,7 +64,11 @@ TimelineItem::init()
|
|||||||
mainLayout_->setContentsMargins(conf::timeline::headerLeftMargin, 0, 0, 0);
|
mainLayout_->setContentsMargins(conf::timeline::headerLeftMargin, 0, 0, 0);
|
||||||
mainLayout_->setSpacing(0);
|
mainLayout_->setSpacing(0);
|
||||||
|
|
||||||
|
// Setting fixed width for checkmark because systems may have a differing width for a
|
||||||
|
// space and the Unicode checkmark.
|
||||||
checkmark_ = new QLabel(" ", this);
|
checkmark_ = new QLabel(" ", this);
|
||||||
|
checkmark_->setFixedWidth(fm.width(CHECKMARK));
|
||||||
|
checkmark_->setFont(font_);
|
||||||
checkmark_->setStyleSheet(
|
checkmark_->setStyleSheet(
|
||||||
QString("font-size: %1px;").arg(conf::timeline::fonts::timestamp));
|
QString("font-size: %1px;").arg(conf::timeline::fonts::timestamp));
|
||||||
}
|
}
|
||||||
@ -351,7 +357,7 @@ TimelineItem::TimelineItem(const mtx::events::RoomEvent<mtx::events::msg::Text>
|
|||||||
void
|
void
|
||||||
TimelineItem::markReceived()
|
TimelineItem::markReceived()
|
||||||
{
|
{
|
||||||
checkmark_->setText("✓");
|
checkmark_->setText(CHECKMARK);
|
||||||
checkmark_->setAlignment(Qt::AlignTop);
|
checkmark_->setAlignment(Qt::AlignTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user