diff options
Diffstat (limited to 'src/imports/controls/material')
-rw-r--r-- | src/imports/controls/material/TextField.qml | 8 | ||||
-rw-r--r-- | src/imports/controls/material/ToolBar.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/qquickmaterialstyle.cpp | 15 | ||||
-rw-r--r-- | src/imports/controls/material/qquickmaterialstyle_p.h | 2 |
4 files changed, 20 insertions, 7 deletions
diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml index a6406afa..25811322 100644 --- a/src/imports/controls/material/TextField.qml +++ b/src/imports/controls/material/TextField.qml @@ -42,9 +42,11 @@ T.TextField { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - placeholder.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - placeholder.implicitHeight + 1 + topPadding + bottomPadding) + placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0) + || contentWidth + leftPadding + rightPadding + implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, + background ? background.implicitHeight : 0, + placeholder.implicitHeight + topPadding + bottomPadding) topPadding: 8 bottomPadding: 16 diff --git a/src/imports/controls/material/ToolBar.qml b/src/imports/controls/material/ToolBar.qml index ce4f64ec..0da814f1 100644 --- a/src/imports/controls/material/ToolBar.qml +++ b/src/imports/controls/material/ToolBar.qml @@ -56,7 +56,7 @@ T.ToolBar { background: Rectangle { implicitHeight: 48 - color: control.Material.primaryColor + color: control.Material.toolBarColor layer.enabled: control.Material.elevation > 0 layer.effect: ElevationEffect { diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp index e412ea12..0e9f31df 100644 --- a/src/imports/controls/material/qquickmaterialstyle.cpp +++ b/src/imports/controls/material/qquickmaterialstyle.cpp @@ -953,9 +953,9 @@ QColor QQuickMaterialStyle::scrollBarPressedColor() const QColor QQuickMaterialStyle::dialogColor() const { - if (!m_hasBackground) - return QColor::fromRgba(m_theme == Light ? dialogColorLight : dialogColorDark); - return backgroundColor(); + if (m_hasBackground) + return backgroundColor(); + return QColor::fromRgba(m_theme == Light ? dialogColorLight : dialogColorDark); } QColor QQuickMaterialStyle::backgroundDimColor() const @@ -970,9 +970,18 @@ QColor QQuickMaterialStyle::listHighlightColor() const QColor QQuickMaterialStyle::tooltipColor() const { + if (m_explicitBackground) + return backgroundColor(); return color(Grey, Shade700); } +QColor QQuickMaterialStyle::toolBarColor() const +{ + if (m_explicitBackground) + return backgroundColor(); + return primaryColor(); +} + QColor QQuickMaterialStyle::toolTextColor() const { if (m_hasForeground || m_customPrimary) diff --git a/src/imports/controls/material/qquickmaterialstyle_p.h b/src/imports/controls/material/qquickmaterialstyle_p.h index 56b26dfc..e6e4fe05 100644 --- a/src/imports/controls/material/qquickmaterialstyle_p.h +++ b/src/imports/controls/material/qquickmaterialstyle_p.h @@ -95,6 +95,7 @@ class QQuickMaterialStyle : public QQuickStyleAttached Q_PROPERTY(QColor backgroundDimColor READ backgroundDimColor NOTIFY paletteChanged FINAL) Q_PROPERTY(QColor listHighlightColor READ listHighlightColor NOTIFY paletteChanged FINAL) Q_PROPERTY(QColor tooltipColor READ tooltipColor NOTIFY paletteChanged FINAL) + Q_PROPERTY(QColor toolBarColor READ toolBarColor NOTIFY paletteChanged FINAL) Q_PROPERTY(QColor toolTextColor READ toolTextColor NOTIFY paletteChanged FINAL) Q_PROPERTY(QColor spinBoxDisabledIconColor READ spinBoxDisabledIconColor NOTIFY paletteChanged FINAL) @@ -216,6 +217,7 @@ public: QColor backgroundDimColor() const; QColor listHighlightColor() const; QColor tooltipColor() const; + QColor toolBarColor() const; QColor toolTextColor() const; QColor spinBoxDisabledIconColor() const; |