diff --git a/designsystems/fluent2/QskFluent2TextInputSkinlet.h b/designsystems/fluent2/QskFluent2TextInputSkinlet.h index 79e9cd26..17cda6e8 100644 --- a/designsystems/fluent2/QskFluent2TextInputSkinlet.h +++ b/designsystems/fluent2/QskFluent2TextInputSkinlet.h @@ -3,12 +3,13 @@ * SPDX-License-Identifier: BSD-3-Clause *****************************************************************************/ -#ifndef QSK_MATERIAL3_INPUT_SKINLET_H -#define QSK_MATERIAL3_INPUT_SKINLET_H +#ifndef QSK_FLUENT2_INPUT_SKINLET_H +#define QSK_FLUENT2_INPUT_SKINLET_H +#include "QskFluent2Global.h" #include "QskTextInputSkinlet.h" -class QSK_EXPORT QskFluent2TextInputSkinlet : public QskTextInputSkinlet +class QSK_FLUENT2_EXPORT QskFluent2TextInputSkinlet : public QskTextInputSkinlet { Q_GADGET diff --git a/designsystems/material3/QskMaterial3Skin.cpp b/designsystems/material3/QskMaterial3Skin.cpp index b47b2e24..1fcef2f2 100644 --- a/designsystems/material3/QskMaterial3Skin.cpp +++ b/designsystems/material3/QskMaterial3Skin.cpp @@ -502,6 +502,7 @@ void Editor::setupTextInput() setBoxBorderMetrics( Q::Panel | M3::Outlined | Q::Focused, 2_dp, allStates ); setBoxBorderColors( Q::Panel | M3::Outlined | Q::Focused, m_pal.primary, allStates ); + setBoxBorderColors( Q::Panel | M3::Outlined | Q::Error, m_pal.error, allStates ); // LeadingIcon diff --git a/designsystems/material3/QskMaterial3TextInputSkinlet.cpp b/designsystems/material3/QskMaterial3TextInputSkinlet.cpp index 040d506d..44c1b74d 100644 --- a/designsystems/material3/QskMaterial3TextInputSkinlet.cpp +++ b/designsystems/material3/QskMaterial3TextInputSkinlet.cpp @@ -36,12 +36,14 @@ namespace const auto iconMargins = input->marginHint( Q::LeadingIcon ); const auto x1 = iconMargins.left() - margins.left(); - const auto r1 = x1 / panelRect.width(); + auto r1 = x1 / panelRect.width(); + r1 = qBound( 0.0, r1, 1.0 ); const auto w = qskHorizontalAdvance( input->effectiveFont( Q::LabelText ), input->labelText() ); const auto x2 = x1 + w + margins.right(); - const auto r2 = x2 / panelRect.width(); + auto r2 = x2 / panelRect.width(); + r2 = qBound( 0.0, r2, 1.0 ); topGradient.setStops( { { 0.0, topGradient.startColor() }, diff --git a/designsystems/material3/QskMaterial3TextInputSkinlet.h b/designsystems/material3/QskMaterial3TextInputSkinlet.h index 54bc47c7..88077239 100644 --- a/designsystems/material3/QskMaterial3TextInputSkinlet.h +++ b/designsystems/material3/QskMaterial3TextInputSkinlet.h @@ -6,9 +6,10 @@ #ifndef QSK_MATERIAL3_INPUT_SKINLET_H #define QSK_MATERIAL3_INPUT_SKINLET_H +#include "QskMaterial3Global.h" #include "QskTextInputSkinlet.h" -class QSK_EXPORT QskMaterial3TextInputSkinlet : public QskTextInputSkinlet +class QSK_MATERIAL3_EXPORT QskMaterial3TextInputSkinlet : public QskTextInputSkinlet { Q_GADGET diff --git a/src/controls/QskTextInput.cpp b/src/controls/QskTextInput.cpp index e821bf4e..149fb12c 100644 --- a/src/controls/QskTextInput.cpp +++ b/src/controls/QskTextInput.cpp @@ -445,7 +445,7 @@ void QskTextInput::keyReleaseEvent( QKeyEvent* event ) void QskTextInput::mousePressEvent( QMouseEvent* event ) { - if( !isReadOnly() && subControlContentsRect( TrailingIcon ).contains( event->position() ) ) + if( !isReadOnly() && subControlContentsRect( TrailingIcon ).contains( event->pos() ) ) { setInputText( {} ); } diff --git a/src/controls/QskTextInput.h b/src/controls/QskTextInput.h index 41e0fe05..91f4e74e 100644 --- a/src/controls/QskTextInput.h +++ b/src/controls/QskTextInput.h @@ -17,9 +17,11 @@ class QSK_EXPORT QskTextInput : public QskControl { Q_OBJECT - Q_PROPERTY( QString inputText READ inputText WRITE setInputText NOTIFY inputTextChanged USER true ) + Q_PROPERTY( QString inputText READ inputText + WRITE setInputText NOTIFY inputTextChanged USER true ) - Q_PROPERTY( QString labelText READ labelText WRITE setLabelText NOTIFY labelTextChanged ) + Q_PROPERTY( QString labelText READ labelText + WRITE setLabelText NOTIFY labelTextChanged ) Q_PROPERTY( QString hintText READ hintText WRITE setHintText NOTIFY hintTextChanged ) @@ -103,7 +105,7 @@ class QSK_EXPORT QskTextInput : public QskControl Q_ENUM( EchoMode ) QskTextInput( QQuickItem* parent = nullptr ); - QskTextInput( const QString&, QQuickItem* parent = nullptr ); // ### do we need this constructor? + QskTextInput( const QString&, QQuickItem* parent = nullptr ); ~QskTextInput() override;