From 9b2c2a8f121339cf78bb8bb0c85121ff98170e98 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Mon, 27 Feb 2023 15:21:09 +0100 Subject: [PATCH] Squiek settings for the spin box added --- skins/material3/QskMaterial3Skin.cpp | 1 + skins/squiek/QskSquiekSkin.cpp | 9 +++++++++ src/controls/QskSpinBoxSkinlet.cpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/skins/material3/QskMaterial3Skin.cpp b/skins/material3/QskMaterial3Skin.cpp index 7cae6bc6..7e3b5db2 100644 --- a/skins/material3/QskMaterial3Skin.cpp +++ b/skins/material3/QskMaterial3Skin.cpp @@ -859,6 +859,7 @@ void Editor::setupSpinBox() { using Q = QskSpinBox; + setFlagHint( Q::Panel | QskAspect::Style, Q::Buttons ); setSpacing( Q::Panel, 4_dp ); setStrutSize( Q::TextPanel, 80_dp, 40_dp ); diff --git a/skins/squiek/QskSquiekSkin.cpp b/skins/squiek/QskSquiekSkin.cpp index c4c205d7..f5bae580 100644 --- a/skins/squiek/QskSquiekSkin.cpp +++ b/skins/squiek/QskSquiekSkin.cpp @@ -1044,6 +1044,14 @@ void Editor::setupSpinBox() setPadding( subControl, 0.0 ); setStrutSize( subControl, 20, 10 ); setBoxShape( subControl, 0 ); + + const auto downState = ( subControl == Q::UpPanel ) + ? Q::Increasing : Q::Decreasing; + + setButton( subControl | downState, Sunken, 1.0 ); + + setAnimation( subControl | A::Metric, 100 ); + setAnimation( subControl | A::Color, 100 ); } for ( auto subControl : { Q::UpIndicator, Q::DownIndicator } ) @@ -1052,6 +1060,7 @@ void Editor::setupSpinBox() #if 1 setFontRole( subControl, QskSkin::TinyFont ); // until it is no graphic #endif + setAnimation( subControl | A::Color, 100 ); } } diff --git a/src/controls/QskSpinBoxSkinlet.cpp b/src/controls/QskSpinBoxSkinlet.cpp index be8bb182..150eab2f 100644 --- a/src/controls/QskSpinBoxSkinlet.cpp +++ b/src/controls/QskSpinBoxSkinlet.cpp @@ -126,7 +126,7 @@ QRectF QskSpinBoxSkinlet::buttonRect( const QskSkinnable* skinnable, { qreal x, y, w, h; - if ( decoration == QskSpinBox::UpDownControl ) + if ( decoration == Q::UpDownControl ) { const auto hint1 = spinBox->strutSizeHint( Q::UpPanel ); const auto hint2 = spinBox->strutSizeHint( Q::DownPanel );