QmlDesigner: just color the background

Keep the style responsibility add the widget. So coloring the
background with a helper widget is enough here.

Change-Id: I24bb82786e2a8ef4af01b9719d2bad4aa1997f1f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Tim Jenssen
2017-11-07 14:34:08 +01:00
parent 84c0390bdc
commit 9cb56f4d73

View File

@@ -441,10 +441,22 @@ static QWidget *createbottomSideBarWidget(const QList<WidgetInfo> &widgetInfos)
topWidgetInfos.append(widgetInfo);
}
if (topWidgetInfos.count() == 1)
return topWidgetInfos.first().widget;
else
return createWidgetsInTabWidget(topWidgetInfos);
QWidget *widget = topWidgetInfos.first().widget;
if (topWidgetInfos.count() > 1) {
QWidget *background = new QWidget();
background->setProperty("designerBackgroundColor", true);
QString sheet = QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"));
sheet.prepend("QWidget[designerBackgroundColor=\"true\"] {background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;}");
background->setStyleSheet(Theme::replaceCssColors(sheet));
background->setLayout(new QVBoxLayout);
background->layout()->setContentsMargins(0, 0, 0, 0);
background->layout()->addWidget(createWidgetsInTabWidget(topWidgetInfos));
widget = background;
}
return widget;
}
static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widgetInfos)
@@ -455,9 +467,6 @@ static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widget
outputPlaceholderSplitter->setStretchFactor(1, 0);
outputPlaceholderSplitter->setOrientation(Qt::Vertical);
QString sheet = QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"));
outputPlaceholderSplitter->setStyleSheet(Theme::replaceCssColors(sheet));
SwitchSplitTabWidget *switchSplitTabWidget = new SwitchSplitTabWidget();
foreach (const WidgetInfo &widgetInfo, widgetInfos) {