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
This commit is contained in:
Thorbjørn Lindeijer
2009-07-10 14:54:46 +02:00
parent b410ddc4bd
commit abee2e0b0d
3 changed files with 21 additions and 4 deletions

View File

@@ -253,7 +253,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
fl->addRow(tr("Working Directory:"), boxlayout);
QGroupBox *box = new QGroupBox(tr("Environment"),this);
QVBoxLayout *boxLayout = new QVBoxLayout();
QVBoxLayout *boxLayout = new QVBoxLayout;
box->setLayout(boxLayout);
box->setFlat(true);

View File

@@ -39,6 +39,7 @@
#include <QtGui/QToolBar>
#include <QtGui/QDesktopServices>
#include <QtGui/QMouseEvent>
#include <QtGui/QScrollArea>
#include <QtCore/QDateTime>
#include <QtCore/QDir>
@@ -58,6 +59,7 @@ struct WelcomeModePrivate
{
WelcomeModePrivate();
QScrollArea *m_scrollArea;
QWidget *m_widget;
QWidget *m_welcomePage;
QButtonGroup *btnGrp;
@@ -140,6 +142,11 @@ WelcomeMode::WelcomeMode() :
m_d->ui.feedbackButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
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());
m_d->btnGrp = new QButtonGroup(this);
@@ -229,7 +236,7 @@ int WelcomeMode::priority() const
QWidget* WelcomeMode::widget()
{
return m_d->m_widget;
return m_d->m_scrollArea;
}
const char* WelcomeMode::uniqueModeName() const

View File

@@ -45,6 +45,7 @@
#include <QtGui/QApplication>
#include <QtGui/QBoxLayout>
#include <QtGui/QComboBox>
#include <QtGui/QScrollArea>
#include <QtGui/QTabWidget>
#include <QtGui/QToolBar>
#include <QtGui/QTreeWidget>
@@ -88,9 +89,18 @@ ProjectWindow::ProjectWindow(QWidget *parent)
m_panelsTabWidget->setDocumentMode(true);
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->setContentsMargins(0, panelsLayout->margin(), 0, 0);
panelsLayout->addWidget(m_panelsTabWidget);
panelsLayout->setMargin(0);
panelsLayout->addWidget(scrollArea);
QWidget *dummy = new QWidget;
QVBoxLayout *dummyLayout = new QVBoxLayout(dummy);