Skip to content

Commit

Permalink
QskTextField/QskTextInput seperated
Browse files Browse the repository at this point in the history
  • Loading branch information
uwerat committed Dec 18, 2024
1 parent 74d14b6 commit a91dcd5
Show file tree
Hide file tree
Showing 13 changed files with 1,294 additions and 1,164 deletions.
14 changes: 7 additions & 7 deletions designsystems/fluent2/QskFluent2Skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1776,14 +1776,14 @@ void Editor::setupTextFieldMetrics()
{
using Q = QskTextField;

setStrutSize( Q::Panel, { -1, 30_px } );
setPadding( Q::Panel, { 11_px, 0, 11_px, 0 } );
setStrutSize( Q::TextPanel, { -1, 30_px } );
setPadding( Q::TextPanel, { 11_px, 0, 11_px, 0 } );

setBoxBorderMetrics( Q::Panel, 1_px );
setBoxBorderMetrics( Q::TextPanel, 1_px );
for( const auto& state : { Q::Focused, Q::Editing } )
setBoxBorderMetrics( Q::Panel | state, { 1_px, 1_px, 1_px, 2_px } );
setBoxBorderMetrics( Q::TextPanel | state, { 1_px, 1_px, 1_px, 2_px } );

setBoxShape( Q::Panel, 3_px );
setBoxShape( Q::TextPanel, 3_px );

setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
setFontRole( Q::Text, Fluent2::Body );
Expand All @@ -1801,7 +1801,7 @@ void Editor::setupTextFieldColors(

const auto& pal = theme.palette;

setColor( Q::Panel | SK::Selected, pal.fillColor.accent.selectedTextBackground );
setColor( Q::TextPanel | SK::Selected, pal.fillColor.accent.selectedTextBackground );
setColor( Q::Text | SK::Selected, pal.fillColor.textOnAccent.selectedText );
setColor( Q::PlaceholderText, pal.fillColor.text.secondary );

Expand Down Expand Up @@ -1837,7 +1837,7 @@ void Editor::setupTextFieldColors(
textColor = pal.fillColor.text.disabled;
}

const auto panel = Q::Panel | section | state;
const auto panel = Q::TextPanel | section | state;
const auto text = Q::Text | section | state;

panelColor = rgbSolid( panelColor, pal.background.solid.base );
Expand Down
16 changes: 8 additions & 8 deletions designsystems/fusion/QskFusionSkin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,25 +397,25 @@ void Editor::setupTextField()
{
const auto colorGroup = ( state == A::NoState ) ? P::Active : P::Disabled;

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

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 ) );
setColor( Q::TextPanel | Q::ReadOnly, m_pal.disabled( P::Base ) );

setBoxBorderMetrics( Q::Panel, 1_px );
setBoxBorderMetrics( Q::TextPanel, 1_px );

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

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

void Editor::setupProgressBar()
Expand Down
4 changes: 2 additions & 2 deletions designsystems/material3/QskMaterial3Skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,12 @@ void Editor::setupTextLabel()
void Editor::setupTextField()
{
using Q = QskTextField;
using SK = QskTextFieldSkinlet;
using SK = QskTextInputSkinlet;

setStrutSize( Q::Panel, -1.0, 56_px );
setPadding( Q::Panel, { 12_px, 8_px, 12_px, 8_px } );
setGradient( Q::Panel, m_pal.surfaceVariant );
setColor( Q::Panel | SK::Selected, m_pal.primary12 );
setColor( Q::TextPanel | SK::Selected, m_pal.primary12 );
setBoxShape( Q::Panel, m_pal.shapeExtraSmallTop );
setBoxBorderMetrics( Q::Panel, { 0, 0, 0, 1_px } );
setBoxBorderColors( Q::Panel, m_pal.onSurfaceVariant );
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ list(APPEND HEADERS
controls/QskTabViewSkinlet.h
controls/QskTextField.h
controls/QskTextFieldSkinlet.h
controls/QskTextInput.h
controls/QskTextInputSkinlet.h
controls/QskTextLabel.h
controls/QskTextLabelSkinlet.h
controls/QskVariantAnimator.h
Expand Down Expand Up @@ -387,6 +389,8 @@ list(APPEND SOURCES
controls/QskTabViewSkinlet.cpp
controls/QskTextField.cpp
controls/QskTextFieldSkinlet.cpp
controls/QskTextInput.cpp
controls/QskTextInputSkinlet.cpp
controls/QskTextLabel.cpp
controls/QskTextLabelSkinlet.cpp
controls/QskVariantAnimator.cpp
Expand Down
Loading

0 comments on commit a91dcd5

Please sign in to comment.