QmlJSInspector: Reposition the Tool Bar

Change-Id: I529f976e90fef1670e65b650525b6f31e8b8f397
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Aurindam Jana
2012-03-26 17:30:57 +02:00
committed by hjk
parent a26db1529f
commit aea3297932
5 changed files with 29 additions and 39 deletions

View File

@@ -126,7 +126,8 @@ public:
DebuggerLanguages m_supportedLanguages;
QStackedWidget *m_toolBarStack;
QWidget *m_debugToolBar;
QHBoxLayout *m_debugToolBarLayout;
QHash<DebuggerLanguage, Context> m_contextsForLanguage;
@@ -151,7 +152,8 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *mw)
: q(mw)
, m_resizeEventFilter(this)
, m_supportedLanguages(AnyLanguage)
, m_toolBarStack(new QStackedWidget)
, m_debugToolBar(new QWidget)
, m_debugToolBarLayout(new QHBoxLayout(m_debugToolBar))
, m_inDebugMode(false)
, m_changingUI(false)
, m_previousDebugLanguages(AnyLanguage)
@@ -163,7 +165,10 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *mw)
, m_previousRunConfiguration(0)
, m_engine(0)
{
m_debugToolBarLayout->setMargin(0);
m_debugToolBarLayout->setSpacing(0);
createViewsMenuItems();
addLanguage(AnyLanguage, Context());
addLanguage(CppLanguage, Context(C_CPPDEBUGGER));
addLanguage(QmlLanguage, Context(C_QMLDEBUGGER));
}
@@ -367,8 +372,10 @@ void DebuggerMainWindowPrivate::activateQmlCppLayout()
{
Context qmlCppContext = m_contextsForLanguage.value(QmlLanguage);
qmlCppContext.add(m_contextsForLanguage.value(CppLanguage));
if (m_toolBars.value(QmlLanguage))
m_toolBarStack->setCurrentWidget(m_toolBars.value(QmlLanguage));
if (m_toolBars.value(QmlLanguage)) {
m_toolBars.value(QmlLanguage)->show();
m_debugToolBarLayout->insertWidget(1, m_toolBars.value(QmlLanguage));
}
if (m_previousDebugLanguages & QmlLanguage) {
m_dockWidgetActiveStateQmlCpp = q->saveSettings();
@@ -387,7 +394,10 @@ void DebuggerMainWindowPrivate::activateCppLayout()
{
Context qmlCppContext = m_contextsForLanguage.value(QmlLanguage);
qmlCppContext.add(m_contextsForLanguage.value(CppLanguage));
m_toolBarStack->setCurrentWidget(m_toolBars.value(CppLanguage));
if (m_toolBars.value(QmlLanguage)) {
m_toolBars.value(QmlLanguage)->hide();
m_debugToolBarLayout->removeWidget(m_toolBars.value(QmlLanguage));
}
if (m_previousDebugLanguages & QmlLanguage) {
m_dockWidgetActiveStateQmlCpp = q->saveSettings();
@@ -408,7 +418,12 @@ void DebuggerMainWindow::setToolBar(DebuggerLanguage language, QWidget *widget)
{
Q_ASSERT(d->m_toolBars.contains(language));
d->m_toolBars[language] = widget;
d->m_toolBarStack->addWidget(widget);
if (language == CppLanguage)
d->m_debugToolBarLayout->addWidget(widget);
//Add widget at the end
if (language == AnyLanguage)
d->m_debugToolBarLayout->insertWidget(-1, widget, 10);
}
QDockWidget *DebuggerMainWindow::dockWidget(const QString &objectName) const
@@ -507,7 +522,7 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
QHBoxLayout *debugToolBarLayout = new QHBoxLayout(debugToolBar);
debugToolBarLayout->setMargin(0);
debugToolBarLayout->setSpacing(0);
debugToolBarLayout->addWidget(d->m_toolBarStack);
debugToolBarLayout->addWidget(d->m_debugToolBar);
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
QDockWidget *dock = new QDockWidget(DebuggerMainWindowPrivate::tr("Debugger Toolbar"));