Commit 55db42fe authored by Tim Jenssen's avatar Tim Jenssen Committed by Thomas Hartmann
Browse files

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: default avatarThomas Hartmann <Thomas.Hartmann@theqtcompany.com>
parent 61dadc6d
QWidget {
QWidget#backgroundWidget {
background-color: creatorTheme.QmlDesignerTabDark
}
......@@ -15,7 +15,7 @@ QTabBar::tab:selected {
color: creatorTheme.QmlDesignerTabDark;
}
QTabBar::tab {
QTabBar#centralTabBar::tab {
width: 16px;
height: 80px;
......
......@@ -25,7 +25,7 @@
#include "designmodewidget.h"
#include "styledoutputpaneplaceholder.h"
#include <coreplugin/outputpane.h>
#include "qmldesignerplugin.h"
#include "crumblebar.h"
#include "documentwarningwidget.h"
......@@ -492,20 +492,25 @@ static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widget
outputPlaceholderSplitter->setStretchFactor(1, 0);
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);
tabWidget->setObjectName("centralTabWidget");
tabWidget->setTabPosition(QTabWidget::East);
tabWidget->setTabBarAutoHide(true);
tabWidget->tabBar()->setObjectName("centralTabBar");
outputPlaceholderSplitter->addWidget(tabWidget);
QWidget *backgroundWidget = new QWidget();
backgroundWidget->setObjectName("backgroundWidget");
backgroundWidget->setLayout(new QVBoxLayout());
backgroundWidget->layout()->setMargin(0);
backgroundWidget->layout()->addWidget(tabWidget);
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/centerwidget.css");
backgroundWidget->setStyleSheet(Theming::replaceCssColors(QString::fromUtf8(sheet)));
outputPlaceholderSplitter->addWidget(backgroundWidget);
outputPlaceholderSplitter->addWidget(outputPanePlaceholder);
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/centerwidget.css");
tabWidget->setStyleSheet(Theming::replaceCssColors(QString::fromUtf8(sheet)));
outputPlaceholderSplitter->setStyleSheet(Theming::replaceCssColors(QString::fromUtf8(sheet)));
return outputPlaceholderSplitter;
}
......
......@@ -7,7 +7,6 @@ HEADERS += $$PWD/qmldesignerconstants.h \
$$PWD/designmodecontext.h \
$$PWD/documentmanager.h \
$$PWD/documentwarningwidget.h \
$$PWD/styledoutputpaneplaceholder.h \
$$PWD/qmldesignericons.h \
$$PWD/openuiqmlfiledialog.h
......@@ -19,7 +18,6 @@ SOURCES += $$PWD/qmldesignerplugin.cpp \
$$PWD/designmodecontext.cpp \
$$PWD/documentmanager.cpp \
$$PWD/documentwarningwidget.cpp \
$$PWD/styledoutputpaneplaceholder.cpp \
$$PWD/openuiqmlfiledialog.cpp
FORMS += $$PWD/settingspage.ui \
......
......@@ -646,8 +646,6 @@ Project {
"settingspage.ui",
"shortcutmanager.cpp",
"shortcutmanager.h",
"styledoutputpaneplaceholder.cpp",
"styledoutputpaneplaceholder.h",
]
}
}
/****************************************************************************
**
** 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
/****************************************************************************
**
** 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
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