diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-15 14:54:02 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-15 22:21:55 +0000 |
commit | 946e834578c6ca0a591324b5d5fd21e291cfca0b (patch) | |
tree | 2190024dcd45eebc2c43b5c0f2d53b718bac9caa /src/imports | |
parent | 116db644615c84f8d59b4e4b9c074b2167dd9a2c (diff) |
Add Overlay::background that is shown when any modal popup is open
Change-Id: Idc2a5bbb5cf7a08ff21731537a378b1dd8050833
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports')
5 files changed, 20 insertions, 0 deletions
diff --git a/src/imports/controls/ApplicationWindow.qml b/src/imports/controls/ApplicationWindow.qml index 247752cb..5c43c956 100644 --- a/src/imports/controls/ApplicationWindow.qml +++ b/src/imports/controls/ApplicationWindow.qml @@ -42,4 +42,8 @@ T.ApplicationWindow { id: window color: "#ffffff" + + overlay.background: Rectangle { + color: "#7f28282a" + } } diff --git a/src/imports/controls/material/ApplicationWindow.qml b/src/imports/controls/material/ApplicationWindow.qml index bf8b62bc..bbaeac70 100644 --- a/src/imports/controls/material/ApplicationWindow.qml +++ b/src/imports/controls/material/ApplicationWindow.qml @@ -43,4 +43,9 @@ T.ApplicationWindow { id: window color: Material.backgroundColor + + overlay.background: Rectangle { + color: window.Material.backgroundDimColor + Behavior on opacity { NumberAnimation { duration: 100 } } + } } diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp index 0cef6698..191db14f 100644 --- a/src/imports/controls/material/qquickmaterialstyle.cpp +++ b/src/imports/controls/material/qquickmaterialstyle.cpp @@ -730,6 +730,11 @@ QColor QQuickMaterialStyle::comboBoxColor() const return m_theme == Light ? "#ffffff" : backgroundColorDark; } +QColor QQuickMaterialStyle::backgroundDimColor() const +{ + return m_theme == Light ? "#99303030" : "#99fafafa"; +} + QColor QQuickMaterialStyle::color(QQuickMaterialStyle::Color color, QQuickMaterialStyle::Shade shade) const { int count = sizeof(colors) / sizeof(colors[0]); diff --git a/src/imports/controls/material/qquickmaterialstyle_p.h b/src/imports/controls/material/qquickmaterialstyle_p.h index 84601de5..9bfb8176 100644 --- a/src/imports/controls/material/qquickmaterialstyle_p.h +++ b/src/imports/controls/material/qquickmaterialstyle_p.h @@ -93,6 +93,7 @@ class QQuickMaterialStyle : public QQuickStyle Q_PROPERTY(QColor scrollBarPressedColor READ scrollBarPressedColor NOTIFY paletteChanged FINAL) Q_PROPERTY(QColor drawerBackgroundColor READ drawerBackgroundColor NOTIFY paletteChanged FINAL) Q_PROPERTY(QColor comboBoxColor READ comboBoxColor NOTIFY paletteChanged FINAL) + Q_PROPERTY(QColor backgroundDimColor READ backgroundDimColor NOTIFY paletteChanged FINAL) public: enum Theme { @@ -201,6 +202,7 @@ public: QColor scrollBarPressedColor() const; QColor drawerBackgroundColor() const; QColor comboBoxColor() const; + QColor backgroundDimColor() const; Q_INVOKABLE QColor color(Color color, Shade shade) const; diff --git a/src/imports/controls/universal/ApplicationWindow.qml b/src/imports/controls/universal/ApplicationWindow.qml index 773eec52..3113e748 100644 --- a/src/imports/controls/universal/ApplicationWindow.qml +++ b/src/imports/controls/universal/ApplicationWindow.qml @@ -44,6 +44,10 @@ T.ApplicationWindow { color: Universal.altHighColor + overlay.background: Rectangle { + color: window.Universal.baseLowColor + } + FocusRectangle { parent: window.activeFocusControl width: parent ? parent.width : 0 |