Themes: Add a theme flag for "default" or "flat" ProjectsMode

I'd like a "flat" style to have a "default" projects mode.
This patch introduces a FlatProjectsMode. The painting code of the
widgets in the project mode follow that instead of the
Theme::WidgetStyle.

In the course of it, DoubleTabWidget does not imitate the dummy toolbar
anymore, but calls the style painting code, instead. That makes the
theme color DoubleTabWidget1stEmptyAreaBackgroundColor obsolete, so that
key disappears from the Theme enum and also from the creatorthemes.

Change-Id: Ia1479c761f61753d6738a43bbde368bf0b8814b2
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-03-04 17:55:20 +01:00
parent 383737d020
commit ea01867297
8 changed files with 34 additions and 39 deletions

View File

@@ -146,7 +146,7 @@ QPixmap DetailsWidget::createBackground(const QSize &size, int topHeight, QWidge
else
p.fillRect(fullRect, creatorTheme()->color(Theme::DetailsWidgetBackgroundColor));
if (creatorTheme()->widgetStyle () == Theme::StyleDefault) {
if (!creatorTheme()->flag(Theme::FlatProjectsMode)) {
QLinearGradient lg(topRect.topLeft(), topRect.bottomLeft());
lg.setStops(creatorTheme()->gradient(Theme::DetailsWidgetHeaderGradient));
p.fillRect(topRect, lg);