fix: tabular number message length (#6366)

This commit is contained in:
pajlada
2025-08-02 12:57:04 +02:00
committed by GitHub
parent 4a14064425
commit f6f5cc5dbc
2 changed files with 18 additions and 12 deletions
+1
View File
@@ -20,6 +20,7 @@
- Minor: Added hotkey Action for opening account selector. (#6192)
- Minor: Add a setting to change the emote and badge thumbnail size. (#6126)
- Minor: Add an import and export button to image uploader settings. (#6284)
- Minor: Message character length label is now monospaced. (#6366)
- Minor: Add a setting under Moderation -> Logs to customize the timestamp used for chat logs. (#6338)
- Minor: Add a setting under Moderation -> Logs to use server timestamp from the message instead of the local clock time for logging. (#6346)
- Bugfix: Commands are no longer tab-completable in the middle of messages. (#6273)
+17 -12
View File
@@ -166,18 +166,18 @@ void SplitInput::initLayout()
auto box = hboxLayout.emplace<QVBoxLayout>().withoutMargin();
box->setSpacing(0);
{
auto textEditLength =
box.emplace<QLabel>().assign(&this->ui_.textEditLength);
textEditLength->setAlignment(Qt::AlignRight);
this->ui_.textEditLength = new QLabel();
// Right-align the labels contents
this->ui_.textEditLength->setAlignment(Qt::AlignRight);
box->addWidget(this->ui_.textEditLength);
box->addStretch(1);
box.emplace<SvgButton>(
SvgButton::Src{
.dark = ":/buttons/emote.svg",
.light = ":/buttons/emoteDark.svg",
},
nullptr, QSize{6, 3})
.assign(&this->ui_.emoteButton);
this->ui_.emoteButton = new SvgButton(
{
.dark = ":/buttons/emote.svg",
.light = ":/buttons/emoteDark.svg",
},
nullptr, QSize{6, 3});
box->addWidget(this->ui_.emoteButton, 0, Qt::AlignRight);
}
// ---- misc
@@ -242,6 +242,7 @@ void SplitInput::scaleChangedEvent(float scale)
this->ui_.vbox->setSpacing(this->marginForTheme());
}
}
// TODO: This font does _not_ get updated when you change your chat font
this->ui_.textEdit->setFont(
app->getFonts()->getFont(FontStyle::ChatMedium, scale));
@@ -252,8 +253,12 @@ void SplitInput::scaleChangedEvent(float scale)
this->ui_.textEdit->setStyleSheet(this->theme->splits.input.styleSheet);
this->ui_.textEdit->setPalette(placeholderPalette);
// TODO: This font does _not_ get updated when you change your chat font
// NOTE: We're using TimestampMedium here to get a font that uses the tnum font feature,
// meaning numbers get equal width & don't bounce around while the user is typing.
this->ui_.textEditLength->setFont(
app->getFonts()->getFont(FontStyle::ChatMedium, scale));
app->getFonts()->getFont(FontStyle::TimestampMedium, scale));
// TODO: This font does _not_ get updated when you change your chat font
this->ui_.replyLabel->setFont(
app->getFonts()->getFont(FontStyle::ChatMediumBold, scale));
}