forked from qt-creator/qt-creator
QmlDesigner: remove styling of the output pane
Setting objectnames to reduce possible influence to other widgets. Introduce a background QWidget to set the background color. AutofillBackground was not working for unclear reason. Change-Id: I4acd5b7ed5ff9d63b5320b133a82099c5888b839 Task-number: QTCREATORBUG-17172 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
61dadc6da1
commit
55db42fe2c
@@ -1,4 +1,4 @@
|
|||||||
QWidget {
|
QWidget#backgroundWidget {
|
||||||
background-color: creatorTheme.QmlDesignerTabDark
|
background-color: creatorTheme.QmlDesignerTabDark
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ QTabBar::tab:selected {
|
|||||||
color: creatorTheme.QmlDesignerTabDark;
|
color: creatorTheme.QmlDesignerTabDark;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab {
|
QTabBar#centralTabBar::tab {
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "designmodewidget.h"
|
#include "designmodewidget.h"
|
||||||
|
|
||||||
#include "styledoutputpaneplaceholder.h"
|
#include <coreplugin/outputpane.h>
|
||||||
#include "qmldesignerplugin.h"
|
#include "qmldesignerplugin.h"
|
||||||
#include "crumblebar.h"
|
#include "crumblebar.h"
|
||||||
#include "documentwarningwidget.h"
|
#include "documentwarningwidget.h"
|
||||||
@@ -492,20 +492,25 @@ static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widget
|
|||||||
outputPlaceholderSplitter->setStretchFactor(1, 0);
|
outputPlaceholderSplitter->setStretchFactor(1, 0);
|
||||||
outputPlaceholderSplitter->setOrientation(Qt::Vertical);
|
outputPlaceholderSplitter->setOrientation(Qt::Vertical);
|
||||||
|
|
||||||
auto outputPanePlaceholder = new StyledOutputpanePlaceHolder(Core::Constants::MODE_DESIGN, outputPlaceholderSplitter);
|
auto outputPanePlaceholder = new Core::OutputPanePlaceHolder(Core::Constants::MODE_DESIGN, outputPlaceholderSplitter);
|
||||||
|
|
||||||
QTabWidget* tabWidget = createWidgetsInTabWidget(centralWidgetInfos);
|
QTabWidget* tabWidget = createWidgetsInTabWidget(centralWidgetInfos);
|
||||||
tabWidget->setObjectName("centralTabWidget");
|
tabWidget->setObjectName("centralTabWidget");
|
||||||
tabWidget->setTabPosition(QTabWidget::East);
|
tabWidget->setTabPosition(QTabWidget::East);
|
||||||
tabWidget->setTabBarAutoHide(true);
|
tabWidget->tabBar()->setObjectName("centralTabBar");
|
||||||
|
|
||||||
outputPlaceholderSplitter->addWidget(tabWidget);
|
QWidget *backgroundWidget = new QWidget();
|
||||||
|
backgroundWidget->setObjectName("backgroundWidget");
|
||||||
outputPlaceholderSplitter->addWidget(outputPanePlaceholder);
|
backgroundWidget->setLayout(new QVBoxLayout());
|
||||||
|
backgroundWidget->layout()->setMargin(0);
|
||||||
|
backgroundWidget->layout()->addWidget(tabWidget);
|
||||||
|
|
||||||
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/centerwidget.css");
|
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/centerwidget.css");
|
||||||
tabWidget->setStyleSheet(Theming::replaceCssColors(QString::fromUtf8(sheet)));
|
backgroundWidget->setStyleSheet(Theming::replaceCssColors(QString::fromUtf8(sheet)));
|
||||||
outputPlaceholderSplitter->setStyleSheet(Theming::replaceCssColors(QString::fromUtf8(sheet)));
|
|
||||||
|
outputPlaceholderSplitter->addWidget(backgroundWidget);
|
||||||
|
outputPlaceholderSplitter->addWidget(outputPanePlaceholder);
|
||||||
|
|
||||||
return outputPlaceholderSplitter;
|
return outputPlaceholderSplitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,7 +7,6 @@ HEADERS += $$PWD/qmldesignerconstants.h \
|
|||||||
$$PWD/designmodecontext.h \
|
$$PWD/designmodecontext.h \
|
||||||
$$PWD/documentmanager.h \
|
$$PWD/documentmanager.h \
|
||||||
$$PWD/documentwarningwidget.h \
|
$$PWD/documentwarningwidget.h \
|
||||||
$$PWD/styledoutputpaneplaceholder.h \
|
|
||||||
$$PWD/qmldesignericons.h \
|
$$PWD/qmldesignericons.h \
|
||||||
$$PWD/openuiqmlfiledialog.h
|
$$PWD/openuiqmlfiledialog.h
|
||||||
|
|
||||||
@@ -19,7 +18,6 @@ SOURCES += $$PWD/qmldesignerplugin.cpp \
|
|||||||
$$PWD/designmodecontext.cpp \
|
$$PWD/designmodecontext.cpp \
|
||||||
$$PWD/documentmanager.cpp \
|
$$PWD/documentmanager.cpp \
|
||||||
$$PWD/documentwarningwidget.cpp \
|
$$PWD/documentwarningwidget.cpp \
|
||||||
$$PWD/styledoutputpaneplaceholder.cpp \
|
|
||||||
$$PWD/openuiqmlfiledialog.cpp
|
$$PWD/openuiqmlfiledialog.cpp
|
||||||
|
|
||||||
FORMS += $$PWD/settingspage.ui \
|
FORMS += $$PWD/settingspage.ui \
|
||||||
|
@@ -646,8 +646,6 @@ Project {
|
|||||||
"settingspage.ui",
|
"settingspage.ui",
|
||||||
"shortcutmanager.cpp",
|
"shortcutmanager.cpp",
|
||||||
"shortcutmanager.h",
|
"shortcutmanager.h",
|
||||||
"styledoutputpaneplaceholder.cpp",
|
|
||||||
"styledoutputpaneplaceholder.h",
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,65 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "styledoutputpaneplaceholder.h"
|
|
||||||
#include "theming.h"
|
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
|
||||||
|
|
||||||
#include <QChildEvent>
|
|
||||||
#include <QTabWidget>
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
StyledOutputpanePlaceHolder::StyledOutputpanePlaceHolder(Core::Id mode, QSplitter *parent)
|
|
||||||
: Core::OutputPanePlaceHolder(mode, parent)
|
|
||||||
{
|
|
||||||
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css");
|
|
||||||
m_customStylesheet = Theming::replaceCssColors(QString::fromUtf8(sheet));
|
|
||||||
}
|
|
||||||
|
|
||||||
void StyledOutputpanePlaceHolder::childEvent(QChildEvent *event)
|
|
||||||
{
|
|
||||||
Core::OutputPanePlaceHolder::childEvent(event);
|
|
||||||
|
|
||||||
if (event->type() == QEvent::ChildAdded) {
|
|
||||||
if (QWidget *child = qobject_cast<QWidget*>(event->child())) {
|
|
||||||
QList<QTabWidget*> widgets = child->findChildren<QTabWidget*>();
|
|
||||||
if (!widgets.isEmpty())
|
|
||||||
widgets.first()->parentWidget()->setStyleSheet(m_customStylesheet);
|
|
||||||
}
|
|
||||||
} else if (event->type() == QEvent::ChildRemoved) {
|
|
||||||
QWidget *child = qobject_cast<QWidget*>(event->child());
|
|
||||||
if (child) {
|
|
||||||
QList<QTabWidget*> widgets = child->findChildren<QTabWidget*>();
|
|
||||||
if (!widgets.isEmpty())
|
|
||||||
widgets.first()->parentWidget()->setStyleSheet(QString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace QmlDesigner
|
|
@@ -1,46 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <coreplugin/outputpane.h>
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class StyledOutputpanePlaceHolder : public Core::OutputPanePlaceHolder
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit StyledOutputpanePlaceHolder(Core::Id mode, QSplitter *parent = 0);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void childEvent(QChildEvent *event) override;;
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_customStylesheet;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace QmlDesigner
|
|
Reference in New Issue
Block a user