ContextView: Use fixed size to avoid scrollbar issues

This commit is contained in:
Jonas Kvinge
2022-06-06 20:54:15 +02:00
parent be01e28068
commit a2320b99ae
5 changed files with 26 additions and 5 deletions

View File

@@ -69,6 +69,8 @@
#include "contextview.h"
#include "contextalbum.h"
const int ContextView::kWidgetSpacing = 40;
ContextView::ContextView(QWidget *parent)
: QWidget(parent),
app_(nullptr),
@@ -125,7 +127,7 @@ ContextView::ContextView(QWidget *parent)
lyrics_id_(-1),
font_size_headline_(0),
font_size_normal_(0),
prev_width_(0) {
prev_width_(width()) {
setLayout(layout_container_);
@@ -359,6 +361,17 @@ void ContextView::ReloadSettings() {
}
void ContextView::resizeEvent(QResizeEvent *e) {
if (prev_width_ != width()) {
widget_album_->setFixedWidth(width() - kWidgetSpacing);
prev_width_ = width();
}
QWidget::resizeEvent(e);
}
void ContextView::Playing() {}
void ContextView::Stopped() {