Commit abee2e0b authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Made it possible to make Qt Creator smaller, based on scroll areas

Scroll areas were added to the welcome mode and the project mode, to
make sure they don't limit how small Qt Creator can be made.

Done with mae
parent b410ddc4
...@@ -253,7 +253,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration * ...@@ -253,7 +253,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
fl->addRow(tr("Working Directory:"), boxlayout); fl->addRow(tr("Working Directory:"), boxlayout);
QGroupBox *box = new QGroupBox(tr("Environment"),this); QGroupBox *box = new QGroupBox(tr("Environment"),this);
QVBoxLayout *boxLayout = new QVBoxLayout(); QVBoxLayout *boxLayout = new QVBoxLayout;
box->setLayout(boxLayout); box->setLayout(boxLayout);
box->setFlat(true); box->setFlat(true);
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <QtGui/QToolBar> #include <QtGui/QToolBar>
#include <QtGui/QDesktopServices> #include <QtGui/QDesktopServices>
#include <QtGui/QMouseEvent> #include <QtGui/QMouseEvent>
#include <QtGui/QScrollArea>
#include <QtCore/QDateTime> #include <QtCore/QDateTime>
#include <QtCore/QDir> #include <QtCore/QDir>
...@@ -58,6 +59,7 @@ struct WelcomeModePrivate ...@@ -58,6 +59,7 @@ struct WelcomeModePrivate
{ {
WelcomeModePrivate(); WelcomeModePrivate();
QScrollArea *m_scrollArea;
QWidget *m_widget; QWidget *m_widget;
QWidget *m_welcomePage; QWidget *m_welcomePage;
QButtonGroup *btnGrp; QButtonGroup *btnGrp;
...@@ -140,6 +142,11 @@ WelcomeMode::WelcomeMode() : ...@@ -140,6 +142,11 @@ WelcomeMode::WelcomeMode() :
m_d->ui.feedbackButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); m_d->ui.feedbackButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
l->addWidget(m_d->m_welcomePage); l->addWidget(m_d->m_welcomePage);
m_d->m_scrollArea = new QScrollArea;
m_d->m_scrollArea->setFrameStyle(QFrame::NoFrame);
m_d->m_scrollArea->setWidget(m_d->m_widget);
m_d->m_scrollArea->setWidgetResizable(true);
updateWelcomePage(WelcomePageData()); updateWelcomePage(WelcomePageData());
m_d->btnGrp = new QButtonGroup(this); m_d->btnGrp = new QButtonGroup(this);
...@@ -229,7 +236,7 @@ int WelcomeMode::priority() const ...@@ -229,7 +236,7 @@ int WelcomeMode::priority() const
QWidget* WelcomeMode::widget() QWidget* WelcomeMode::widget()
{ {
return m_d->m_widget; return m_d->m_scrollArea;
} }
const char* WelcomeMode::uniqueModeName() const const char* WelcomeMode::uniqueModeName() const
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <QtGui/QApplication> #include <QtGui/QApplication>
#include <QtGui/QBoxLayout> #include <QtGui/QBoxLayout>
#include <QtGui/QComboBox> #include <QtGui/QComboBox>
#include <QtGui/QScrollArea>
#include <QtGui/QTabWidget> #include <QtGui/QTabWidget>
#include <QtGui/QToolBar> #include <QtGui/QToolBar>
#include <QtGui/QTreeWidget> #include <QtGui/QTreeWidget>
...@@ -88,9 +89,18 @@ ProjectWindow::ProjectWindow(QWidget *parent) ...@@ -88,9 +89,18 @@ ProjectWindow::ProjectWindow(QWidget *parent)
m_panelsTabWidget->setDocumentMode(true); m_panelsTabWidget->setDocumentMode(true);
QVBoxLayout *panelsLayout = new QVBoxLayout(panelsWidget); QVBoxLayout *panelsLayout = new QVBoxLayout(panelsWidget);
QWidget *marginWidget = new QWidget;
QVBoxLayout *marginLayout = new QVBoxLayout(marginWidget);
marginLayout->setContentsMargins(0, panelsLayout->margin(), 0, 0);
marginLayout->addWidget(m_panelsTabWidget);
QScrollArea *scrollArea = new QScrollArea;
scrollArea->setWidgetResizable(true);
scrollArea->setFrameStyle(QFrame::NoFrame);
scrollArea->setWidget(marginWidget);
panelsLayout->setSpacing(0); panelsLayout->setSpacing(0);
panelsLayout->setContentsMargins(0, panelsLayout->margin(), 0, 0); panelsLayout->setMargin(0);
panelsLayout->addWidget(m_panelsTabWidget); panelsLayout->addWidget(scrollArea);
QWidget *dummy = new QWidget; QWidget *dummy = new QWidget;
QVBoxLayout *dummyLayout = new QVBoxLayout(dummy); QVBoxLayout *dummyLayout = new QVBoxLayout(dummy);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment