M3 input text: Don't cut gradient if label text is empty

Resolves #400
This commit is contained in:
Peter Hartmann 2024-11-11 10:24:58 +01:00
parent da1566c0c8
commit 386c679dfb
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,12 @@ namespace
QskBoxBorderColors outlineColors( const QskTextInput* input ) QskBoxBorderColors outlineColors( const QskTextInput* input )
{ {
auto borderColors = input->boxBorderColorsHint( Q::Panel ); auto borderColors = input->boxBorderColorsHint( Q::Panel );
if( input->labelText().isEmpty() )
{
return borderColors;
}
auto topGradient = borderColors.gradientAt( Qt::TopEdge ); auto topGradient = borderColors.gradientAt( Qt::TopEdge );
const auto panelRect = input->subControlRect( Q::Panel ); const auto panelRect = input->subControlRect( Q::Panel );