forked from qt-creator/qt-creator
QmlDesigner: prepare centerWidget to use styled QTabWidget
Change-Id: Ibcc6e7d5866df50448b54ecc4f2aff340b353f77 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
QWidget {
|
||||||
|
background-color: creatorTheme.QmlDesignerTabDark
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabWidget#centralTabWidget::pane {
|
||||||
|
border: 0px;
|
||||||
|
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabWidget#centralTabWidget::tab-bar { alignment: right; }
|
||||||
|
|
||||||
|
QTabBar::tab:selected {
|
||||||
|
border: none;
|
||||||
|
background-color: creatorTheme.QmlDesignerTabLight;
|
||||||
|
color: creatorTheme.QmlDesignerTabDark;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab {
|
||||||
|
width: 16px;
|
||||||
|
height: 80px;
|
||||||
|
|
||||||
|
border-image: none;
|
||||||
|
background-color: creatorTheme.QmlDesignerTabDark;
|
||||||
|
color: creatorTheme.QmlDesignerTabLight;
|
||||||
|
|
||||||
|
margin-top: 0x;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 0px;
|
||||||
|
font: bold;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
@@ -4,5 +4,6 @@
|
|||||||
<file>stylesheet.css</file>
|
<file>stylesheet.css</file>
|
||||||
<file>scrollbar.css</file>
|
<file>scrollbar.css</file>
|
||||||
<file>formeditorstylesheet.css</file>
|
<file>formeditorstylesheet.css</file>
|
||||||
|
<file>centerwidget.css</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@@ -471,7 +471,7 @@ void DesignModeWidget::addNavigatorHistoryEntry(const Utils::FileName &fileName)
|
|||||||
++m_navigatorHistoryCounter;
|
++m_navigatorHistoryCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QWidget *createWidgetsInTabWidget(const QList<WidgetInfo> &widgetInfos)
|
static QTabWidget *createWidgetsInTabWidget(const QList<WidgetInfo> &widgetInfos)
|
||||||
{
|
{
|
||||||
QTabWidget *tabWidget = new QTabWidget;
|
QTabWidget *tabWidget = new QTabWidget;
|
||||||
|
|
||||||
@@ -512,13 +512,18 @@ static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widget
|
|||||||
|
|
||||||
auto outputPanePlaceholder = new StyledOutputpanePlaceHolder(Core::Constants::MODE_DESIGN, outputPlaceholderSplitter);
|
auto outputPanePlaceholder = new StyledOutputpanePlaceHolder(Core::Constants::MODE_DESIGN, outputPlaceholderSplitter);
|
||||||
|
|
||||||
if (centralWidgetInfos.count() == 1)
|
QTabWidget* tabWidget = createWidgetsInTabWidget(centralWidgetInfos);
|
||||||
outputPlaceholderSplitter->addWidget(centralWidgetInfos.first().widget);
|
tabWidget->setObjectName("centralTabWidget");
|
||||||
else
|
tabWidget->setTabPosition(QTabWidget::East);
|
||||||
outputPlaceholderSplitter->addWidget(createWidgetsInTabWidget(centralWidgetInfos));
|
tabWidget->setTabBarAutoHide(true);
|
||||||
|
|
||||||
|
outputPlaceholderSplitter->addWidget(tabWidget);
|
||||||
|
|
||||||
outputPlaceholderSplitter->addWidget(outputPanePlaceholder);
|
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;
|
return outputPlaceholderSplitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user