QmlDesigner: Adding theming support for Qt Quick Designer

With this patch the Qt Quick Designer supports:

*Flat
*Flat Dark
*Flat Light
*Classic

I did not test the dark style.

I added a template engine for the .css files. The syntax for the .css
files
is identical to the QML syntax.

Known issues:
* The icons in the property editor do not play well with the
  Flat Light style. We have to get proper Core:Icon support for the
  icons
  and most icons have to be simplified/flattened to fit the new style/
  theme.
* Some colors in the connection editor are still dark and hardcoded. But
  this looks ok together with all themes.
* The highlight colors are not taken from the theme, yet.

Change-Id: I94f2b75f92db8e131c2b15867dbabe9ae4b2f25a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Thomas Hartmann
2016-07-12 12:37:41 +02:00
parent ff9a49f99f
commit a017138e58
43 changed files with 308 additions and 214 deletions

View File

@@ -33,6 +33,7 @@
#include <texteditor/textdocument.h>
#include <nodeinstanceview.h>
#include <itemlibrarywidget.h>
#include <theming.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/coreconstants.h>
@@ -300,7 +301,7 @@ void DesignModeWidget::setup()
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css");
sheet += Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css");
sheet += "QLabel { background-color: #4f4f4f; }";
navigationView.widget->setStyleSheet(QString::fromUtf8(sheet));
navigationView.widget->setStyleSheet(Theming::replaceCssColors(QString::fromUtf8(sheet)));
}
}