|
|
@ -2,6 +2,7 @@
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
|
|
|
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
|
|
|
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
|
|
|
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
|
|
|
|
|
|
|
* Copyright 2018, Raul Rodrigo Segura (raurodse)
|
|
|
|
* Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com>
|
|
|
|
* Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com>
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
@ -35,6 +36,8 @@
|
|
|
|
#include <QDesktopWidget>
|
|
|
|
#include <QDesktopWidget>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QTreeView>
|
|
|
|
#include <QTreeView>
|
|
|
|
|
|
|
|
#include <QFile>
|
|
|
|
|
|
|
|
#include <QFileInfo>
|
|
|
|
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
static inline int
|
|
|
|
windowDimensionToPixels( const Calamares::Branding::WindowDimension& u )
|
|
|
|
windowDimensionToPixels( const Calamares::Branding::WindowDimension& u )
|
|
|
@ -67,6 +70,8 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|
|
|
using CalamaresUtils::windowPreferredHeight;
|
|
|
|
using CalamaresUtils::windowPreferredHeight;
|
|
|
|
using CalamaresUtils::windowPreferredWidth;
|
|
|
|
using CalamaresUtils::windowPreferredWidth;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this->setObjectName("mainApp");
|
|
|
|
|
|
|
|
|
|
|
|
QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
|
|
|
|
QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
|
|
|
|
QSize minimumSize( qBound( windowMinimumWidth, availableSize.width(), windowPreferredWidth ),
|
|
|
|
QSize minimumSize( qBound( windowMinimumWidth, availableSize.width(), windowPreferredWidth ),
|
|
|
|
qBound( windowMinimumHeight, availableSize.height(), windowPreferredHeight ) );
|
|
|
|
qBound( windowMinimumHeight, availableSize.height(), windowPreferredHeight ) );
|
|
|
@ -86,10 +91,12 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|
|
|
setLayout( mainLayout );
|
|
|
|
setLayout( mainLayout );
|
|
|
|
|
|
|
|
|
|
|
|
QWidget* sideBox = new QWidget( this );
|
|
|
|
QWidget* sideBox = new QWidget( this );
|
|
|
|
|
|
|
|
sideBox->setObjectName("sidebarApp");
|
|
|
|
mainLayout->addWidget( sideBox );
|
|
|
|
mainLayout->addWidget( sideBox );
|
|
|
|
|
|
|
|
|
|
|
|
QBoxLayout* sideLayout = new QVBoxLayout;
|
|
|
|
QBoxLayout* sideLayout = new QVBoxLayout;
|
|
|
|
sideBox->setLayout( sideLayout );
|
|
|
|
sideBox->setLayout( sideLayout );
|
|
|
|
|
|
|
|
// Set this attribute into qss file
|
|
|
|
sideBox->setFixedWidth( qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) );
|
|
|
|
sideBox->setFixedWidth( qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) );
|
|
|
|
sideBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
|
|
|
sideBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
|
|
|
|
|
|
|
|
|
|
@ -97,6 +104,8 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|
|
|
sideLayout->addLayout( logoLayout );
|
|
|
|
sideLayout->addLayout( logoLayout );
|
|
|
|
logoLayout->addStretch();
|
|
|
|
logoLayout->addStretch();
|
|
|
|
QLabel* logoLabel = new QLabel( sideBox );
|
|
|
|
QLabel* logoLabel = new QLabel( sideBox );
|
|
|
|
|
|
|
|
logoLabel->setObjectName("logoApp");
|
|
|
|
|
|
|
|
//Define all values into qss file
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QPalette plt = sideBox->palette();
|
|
|
|
QPalette plt = sideBox->palette();
|
|
|
|
sideBox->setAutoFillBackground( true );
|
|
|
|
sideBox->setAutoFillBackground( true );
|
|
|
@ -154,6 +163,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|
|
|
connect( m_viewManager, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge );
|
|
|
|
connect( m_viewManager, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge );
|
|
|
|
|
|
|
|
|
|
|
|
mainLayout->addWidget( m_viewManager->centralWidget() );
|
|
|
|
mainLayout->addWidget( m_viewManager->centralWidget() );
|
|
|
|
|
|
|
|
setStyleSheet( Calamares::Branding::instance()->stylesheet() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|