input text: fix CI build etc.

This commit is contained in:
Peter Hartmann 2024-10-15 12:34:31 +02:00
parent a0642cfde9
commit cb7f9c5442
6 changed files with 17 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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() },

View File

@ -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

View File

@ -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( {} );
}

View File

@ -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;