Skip to content

Commit

Permalink
fusion skin improved
Browse files Browse the repository at this point in the history
  • Loading branch information
uwerat committed Dec 3, 2024
1 parent 4540cc1 commit e86378a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
19 changes: 10 additions & 9 deletions designsystems/fusion/QskFusionSkin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,30 +390,31 @@ void Editor::setupTextField()
using A = QskAspect;
using P = QPalette;

setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignTop );
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
setAlignment( Q::PlaceholderText, Qt::AlignLeft | Qt::AlignVCenter );

for ( auto state : { A::NoState, Q::Disabled } )
{
const auto colorGroup = ( state == A::NoState ) ? P::Active : P::Disabled;

setGradient( Q::Panel | state, m_pal.color( colorGroup, P::Base ) );
setColor( Q::Text | state, m_pal.color( colorGroup, P::Text ) );

setColor( Q::Panel | SK::Selected | state,
m_pal.color( colorGroup, P::Highlight ) );
setColor( Q::Panel | state, m_pal.color( colorGroup, P::Base ) );
setColor( Q::Panel | SK::Selected | state, m_pal.color( colorGroup, P::Highlight ) );

setColor( Q::Text | SK::Selected | state,
m_pal.color( colorGroup, P::HighlightedText ) );
setColor( Q::Text | state, m_pal.color( colorGroup, P::Text ) );
setColor( Q::Text | SK::Selected | state, m_pal.color( colorGroup, P::HighlightedText ) );
setColor( Q::PlaceholderText, m_pal.color( colorGroup, P::PlaceholderText ) );
}

setColor( Q::Panel | Q::ReadOnly, m_pal.disabled( P::Base ) );

setBoxBorderMetrics( Q::Panel, 1_px );

setBoxBorderColors( Q::Panel, m_pal.outline );
#ifdef SHOW_FOCUS
setBoxBorderColors( Q::Panel | Q::Focused, m_pal.highlightedOutline );
#endif

setBoxShape( Q::Panel, 2 );
setBoxShape( Q::Panel, 2_px );
setPadding( Q::Panel, 4_px );
}

Expand Down
10 changes: 5 additions & 5 deletions examples/gallery/inputs/InputPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ namespace
}
};

class InputBox : public QskLinearBox
class TextInputBox : public QskLinearBox
{
public:
InputBox( QQuickItem* parent = nullptr )
TextInputBox( QQuickItem* parent = nullptr )
: QskLinearBox( Qt::Horizontal, parent )
{
setSpacing( 20 );
Expand Down Expand Up @@ -117,8 +117,8 @@ InputPage::InputPage( QQuickItem* parent )
auto spinBox = new QskSpinBox( 0.0, 100.0, 1.0 );
spinBox->setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );

auto inputBox = new InputBox();
inputBox->setSizePolicy( Qt::Vertical, QskSizePolicy::Fixed );
auto textInputBox = new TextInputBox();
textInputBox->setSizePolicy( Qt::Vertical, QskSizePolicy::Fixed );

auto vBox = new QskLinearBox( Qt::Vertical );
vBox->setSpacing( 30 );
Expand All @@ -127,7 +127,7 @@ InputPage::InputPage( QQuickItem* parent )
vBox->addItem( sliders[0].continous );
vBox->addItem( sliders[0].discrete );
vBox->addItem( sliders[0].centered );
vBox->addItem( inputBox );
vBox->addItem( textInputBox );
vBox->addItem( spinBox );

auto mainBox = new QskLinearBox( Qt::Horizontal, this );
Expand Down

0 comments on commit e86378a

Please sign in to comment.