ContextView: Add static_cast for font size

This commit is contained in:
Jonas Kvinge 2023-03-19 19:32:41 +01:00
parent 12aebc2fe9
commit 14d215bdf3
1 changed files with 4 additions and 4 deletions

View File

@ -435,7 +435,7 @@ void ContextView::NoSong() {
widget_album_->show();
}
textedit_top_->setFont(QFont(font_headline_, font_size_headline_ * 1.6));
textedit_top_->setFont(QFont(font_headline_, static_cast<int>(font_size_headline_ * 1.6)));
textedit_top_->SetText(tr("No song playing"));
QString html;
@ -451,14 +451,14 @@ void ContextView::NoSong() {
else html += tr("%1 albums").arg(collectionview_->TotalAlbums());
html += "<br />";
label_stop_summary_->setFont(QFont(font_normal_, font_size_normal_));
label_stop_summary_->setFont(QFont(font_normal_, static_cast<int>(font_size_normal_)));
label_stop_summary_->setText(html);
}
void ContextView::UpdateFonts() {
QFont font(font_normal_, font_size_normal_);
QFont font(font_normal_, static_cast<int>(font_size_normal_));
font.setBold(false);
for (QLabel *l : labels_play_all_) {
l->setFont(font);
@ -471,7 +471,7 @@ void ContextView::UpdateFonts() {
void ContextView::SetSong() {
textedit_top_->setFont(QFont(font_headline_, font_size_headline_));
textedit_top_->setFont(QFont(font_headline_, static_cast<int>(font_size_headline_)));
textedit_top_->SetText(QString("<b>%1</b><br />%2").arg(Utilities::ReplaceMessage(title_fmt_, song_playing_, "<br />", true), Utilities::ReplaceMessage(summary_fmt_, song_playing_, "<br />", true)));
label_stop_summary_->clear();