forked from qt-creator/qt-creator
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user