Commit cfe69e69 authored by Daniel Teske's avatar Daniel Teske

AndroidManifestWidget: Fix resizing behavior

This time for real. Change layout from
QScrollArea
 -> QStackedWidget
    -> GeneralPage
    -> EditorPage

to
QStackedWidget
  -> QScrollArea
     -> GeneralPage
  -> EditorPage

Change-Id: Id0d4baca297a5b4d58292fa72faa62b66c91a2dd
Task-number: QTCREATORBUG-14127
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent c9dc686a
......@@ -70,6 +70,7 @@
#include <QFileDialog>
#include <QTimer>
#include <QCheckBox>
#include <QScrollArea>
#include <limits>
......@@ -103,7 +104,7 @@ Project *androidProject(const Utils::FileName &fileName)
} // anonymous namespace
AndroidManifestEditorWidget::AndroidManifestEditorWidget()
: QScrollArea(),
: QStackedWidget(),
m_dirty(false),
m_stayClean(false),
m_setAppName(false),
......@@ -118,8 +119,6 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget()
m_editor = new AndroidManifestEditor(this);
setWidgetResizable(true);
connect(&m_timerParseCheck, SIGNAL(timeout()),
this, SLOT(delayedParseCheck()));
......@@ -129,11 +128,8 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget()
void AndroidManifestEditorWidget::initializePage()
{
m_stackedWidget = new QStackedWidget(this);
setWidget(m_stackedWidget);
Core::IContext *myContext = new Core::IContext(this);
myContext->setWidget(m_stackedWidget);
myContext->setWidget(this);
myContext->setContext(Core::Context(androidManifestEditorGeneralPaneContextId)); // where is the context used?
Core::ICore::addContextObject(myContext);
......@@ -458,8 +454,12 @@ void AndroidManifestEditorWidget::initializePage()
topLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
m_stackedWidget->insertWidget(General, mainWidget);
m_stackedWidget->insertWidget(Source, m_textEditorWidget);
QScrollArea *mainWidgetScrollArea = new QScrollArea;
mainWidgetScrollArea->setWidgetResizable(true);
mainWidgetScrollArea->setWidget(mainWidget);
insertWidget(General, mainWidgetScrollArea);
insertWidget(Source, m_textEditorWidget);
}
bool AndroidManifestEditorWidget::eventFilter(QObject *obj, QEvent *event)
......@@ -540,7 +540,7 @@ bool AndroidManifestEditorWidget::isModified() const
AndroidManifestEditorWidget::EditorPage AndroidManifestEditorWidget::activePage() const
{
return AndroidManifestEditorWidget::EditorPage(m_stackedWidget->currentIndex());
return AndroidManifestEditorWidget::EditorPage(currentIndex());
}
bool AndroidManifestEditorWidget::setActivePage(EditorPage page)
......@@ -564,7 +564,7 @@ bool AndroidManifestEditorWidget::setActivePage(EditorPage page)
// m_packageNameLineEdit->setFocus();
}
m_stackedWidget->setCurrentIndex(page);
setCurrentIndex(page);
return true;
}
......
......@@ -35,7 +35,6 @@
#include <QAbstractListModel>
#include <QStackedWidget>
#include <QScrollArea>
#include <QTimer>
QT_BEGIN_NAMESPACE
......@@ -86,7 +85,7 @@ public:
explicit AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent);
};
class AndroidManifestEditorWidget : public QScrollArea
class AndroidManifestEditorWidget : public QStackedWidget
{
Q_OBJECT
public:
......@@ -196,7 +195,6 @@ private:
QTimer m_timerParseCheck;
TextEditor::TextEditorWidget *m_textEditorWidget;
QStackedWidget *m_stackedWidget;
AndroidManifestEditor *m_editor;
};
} // namespace Internal
......
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