|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
|
|
|
|
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
@ -20,6 +20,7 @@
|
|
|
|
|
|
|
|
|
|
#include "ThemeInfo.h"
|
|
|
|
|
|
|
|
|
|
#include "utils/CalamaresUtilsGui.h"
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
|
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
@ -28,16 +29,18 @@
|
|
|
|
|
|
|
|
|
|
ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent)
|
|
|
|
|
: QWidget( parent )
|
|
|
|
|
, m_id( info.id )
|
|
|
|
|
, m_check( new QRadioButton( info.name.isEmpty() ? info.id : info.name, parent ) )
|
|
|
|
|
, m_description( new QLabel( info.description, parent ) )
|
|
|
|
|
, m_id( info.id )
|
|
|
|
|
{
|
|
|
|
|
QHBoxLayout* layout = new QHBoxLayout( this );
|
|
|
|
|
this->setLayout( layout );
|
|
|
|
|
|
|
|
|
|
layout->addWidget( m_check, 1 );
|
|
|
|
|
|
|
|
|
|
constexpr QSize image_size{120, 80};
|
|
|
|
|
const QSize image_size{
|
|
|
|
|
qMax(12 * CalamaresUtils::defaultFontHeight(), 120),
|
|
|
|
|
qMax(8 * CalamaresUtils::defaultFontHeight(), 80) };
|
|
|
|
|
|
|
|
|
|
QPixmap image( info.imagePath );
|
|
|
|
|
if ( info.imagePath.isEmpty() )
|
|
|
|
|