calamares/0006-Make-the-Summary-page-contents-scrollable.patch
2015-04-10 18:20:30 +02:00

91 lines
3 KiB
Diff

From e81743ecc3bea3c38ec82107a4869947706b7a79 Mon Sep 17 00:00:00 2001
From: Teo Mrnjavac <teo@kde.org>
Date: Thu, 9 Apr 2015 18:02:29 +0200
Subject: [PATCH 06/18] Make the Summary page contents scrollable.
---
src/modules/summary/SummaryPage.cpp | 13 +++++++++++--
src/modules/summary/SummaryPage.h | 5 ++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/modules/summary/SummaryPage.cpp b/src/modules/summary/SummaryPage.cpp
index eb7bd23..8a4e3b5 100644
--- a/src/modules/summary/SummaryPage.cpp
+++ b/src/modules/summary/SummaryPage.cpp
@@ -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*
diff --git a/src/modules/summary/SummaryPage.h b/src/modules/summary/SummaryPage.h
index 6e4fa39..837c694 100644
--- a/src/modules/summary/SummaryPage.h
+++ b/src/modules/summary/SummaryPage.h
@@ -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
--
1.9.0