From 14fcc2fad647ddf73f83e82f6df812e603ca788b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 13 Apr 2018 08:44:02 -0400 Subject: [PATCH] [plasmalnf] Continue fighting with layout - The screenshot stays one size, but different ThemeWidgets may overlap partially when you shrink the screen or have more than three / four themes listed. - Probably needs work in the surrounding container and overall better page-scrollbar support. --- src/modules/plasmalnf/ThemeWidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/plasmalnf/ThemeWidget.cpp b/src/modules/plasmalnf/ThemeWidget.cpp index eb4e5c356..92a88197f 100644 --- a/src/modules/plasmalnf/ThemeWidget.cpp +++ b/src/modules/plasmalnf/ThemeWidget.cpp @@ -62,15 +62,15 @@ ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent) , m_check( new QRadioButton( info.name.isEmpty() ? info.id : info.name, parent ) ) , m_description( new QLabel( info.description, parent ) ) { + const QSize image_size{ + qMax(12 * CalamaresUtils::defaultFontHeight(), 120), + qMax(8 * CalamaresUtils::defaultFontHeight(), 80) }; + QHBoxLayout* layout = new QHBoxLayout( this ); this->setLayout( layout ); layout->addWidget( m_check, 1 ); - const QSize image_size{ - qMax(12 * CalamaresUtils::defaultFontHeight(), 120), - qMax(8 * CalamaresUtils::defaultFontHeight(), 80) }; - QPixmap image( _munge_imagepath( info.imagePath ) ); if ( image.isNull() ) { @@ -88,6 +88,7 @@ ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent) image_label->setPixmap( image ); image_label->setMinimumSize( image_size ); image_label->setMaximumSize( image_size ); + image_label->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); layout->addWidget( image_label, 1 ); layout->addWidget( m_description, 3 );