Make the Summary page contents scrollable.
This commit is contained in:
parent
69f6a2c73c
commit
e6748f8656
@ -1,6 +1,6 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@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
|
||||
@ -25,11 +25,14 @@
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QScrollArea>
|
||||
|
||||
static const int SECTION_SPACING = 12;
|
||||
|
||||
SummaryPage::SummaryPage( QWidget* parent )
|
||||
: QWidget()
|
||||
, m_scrollArea( new QScrollArea( this ) )
|
||||
, m_contentWidget( nullptr )
|
||||
{
|
||||
QVBoxLayout* layout = new QVBoxLayout( this );
|
||||
layout->setContentsMargins( 0, 0, 0, 0 );
|
||||
@ -40,6 +43,12 @@ SummaryPage::SummaryPage( QWidget* parent )
|
||||
"the install procedure." ) );
|
||||
)
|
||||
layout->addWidget( headerLabel );
|
||||
layout->addWidget( m_scrollArea );
|
||||
m_scrollArea->setWidgetResizable( true );
|
||||
m_scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
|
||||
m_scrollArea->setFrameStyle( QFrame::NoFrame );
|
||||
m_scrollArea->setContentsMargins( 0, 0, 0, 0 );
|
||||
}
|
||||
|
||||
|
||||
@ -88,7 +97,7 @@ SummaryPage::createContentWidget()
|
||||
m_contentWidget = new QWidget;
|
||||
m_layout = new QVBoxLayout( m_contentWidget );
|
||||
CalamaresUtils::unmarginLayout( m_layout );
|
||||
layout()->addWidget( m_contentWidget );
|
||||
m_scrollArea->setWidget( m_contentWidget );
|
||||
}
|
||||
|
||||
QLabel*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@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
|
||||
@ -22,6 +22,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
class QLabel;
|
||||
class QScrollArea;
|
||||
class QVBoxLayout;
|
||||
|
||||
class SummaryPage : public QWidget
|
||||
@ -39,6 +40,8 @@ private:
|
||||
void createContentWidget();
|
||||
QLabel* createTitleLabel( const QString& text ) const;
|
||||
QLabel* createBodyLabel( const QString& text ) const;
|
||||
|
||||
QScrollArea* m_scrollArea;
|
||||
};
|
||||
|
||||
#endif // SUMMARYPAGE_H
|
||||
|
Loading…
Reference in New Issue
Block a user