Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit c331fd6
Author: Uwe Rathmann <[email protected]>
Date:   Tue Dec 10 12:17:51 2024 +0100

    use enums for class members

commit 0d86454
Author: Uwe Rathmann <[email protected]>
Date:   Tue Dec 10 11:27:16 2024 +0100

    elide mode for QskTextField::PlaceholderText added

commit 0038f6d
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 16:03:55 2024 +0100

    more enums specified

commit 5d95913
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 15:56:49 2024 +0100

    QskSizePolicy enums specified

commit 4220edc
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 15:46:43 2024 +0100

    don't use enum bitfields for unspecied enums

commit 36f502b
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 15:43:57 2024 +0100

    QskItem::UpdateFlags sepcified

commit 23beda3
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 15:39:06 2024 +0100

    more enum types specified

commit 0849571
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 15:21:37 2024 +0100

    enum types specified

commit d53579f
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 15:04:37 2024 +0100

    enum types specified

commit 4e6ee36
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 14:53:59 2024 +0100

    NodeRole enums qualified as quint8

commit 3a83f5f
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 13:29:03 2024 +0100

    compiler errors fixed

commit d1fa020
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 12:10:10 2024 +0100

    Markdown format added

commit 66d9783
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 12:01:16 2024 +0100

    QskTextColors is a Q_GADGET now

commit 4ad28e6
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 9 10:04:33 2024 +0100

    don't show the placeholder when text is not empty

commit b6f2003
Author: Uwe Rathmann <[email protected]>
Date:   Wed Dec 4 10:08:39 2024 +0100

    QskTextFieldSkinlet::sizeHint added

commit f0d5332
Author: Uwe Rathmann <[email protected]>
Date:   Tue Dec 3 17:52:39 2024 +0100

    gallery updated, dummy TextFieldSkinlets introduced

commit e86378a
Author: Uwe Rathmann <[email protected]>
Date:   Tue Dec 3 13:33:17 2024 +0100

    fusion skin improved

commit 4540cc1
Author: Uwe Rathmann <[email protected]>
Date:   Tue Dec 3 10:06:26 2024 +0100

    QskTextFieldSkinlet::Selected state introduced

commit 77e556f
Author: Uwe Rathmann <[email protected]>
Date:   Tue Dec 3 09:32:39 2024 +0100

    QskTextField::placeholderText introduced, QskTextField::description
    removed

commit 77739d7
Author: Uwe Rathmann <[email protected]>
Date:   Tue Dec 3 07:44:44 2024 +0100

    skin hint table size reduced

commit 108aa23
Author: Uwe Rathmann <[email protected]>
Date:   Mon Dec 2 12:54:31 2024 +0100

    QskTextInput renamed to QskTextField ( term used by F2/M3 and QC2 )

commit b086496
Author: Uwe Rathmann <[email protected]>
Date:   Sun Dec 1 11:06:51 2024 +0100

    Material3 adjustements for progress bars

commit d18017c
Author: Uwe Rathmann <[email protected]>
Date:   Fri Nov 29 13:55:30 2024 +0100

    QskProgressRing fixed + M3 updates

commit a58d6dd
Author: Uwe Rathmann <[email protected]>
Date:   Fri Nov 29 09:42:01 2024 +0100

    QskProgressIndicator::hasOrigin(), QskSlider::hasOrigin added

commit 12dfac1
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 28 16:06:00 2024 +0100

    QskSlider::inverted introduced

commit db1e9a7
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 28 15:59:59 2024 +0100

    key handling of bounded inputs improved

commit d9a66e4
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 28 15:55:57 2024 +0100

    QskSlider API cleanup

commit 9d13cd1
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 28 15:47:20 2024 +0100

    subcontrol renamed from Knob to Handle

commit 7a180cf
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 28 12:00:46 2024 +0100

    the corrected mouse/touch handling works without extending the handle
    selection area
    handle selection

commit 66085ea
Author: Uwe Rathmann <[email protected]>
Date:   Wed Nov 27 16:27:57 2024 +0100

    QskSlider::origin implemented

commit e2c76aa
Author: Uwe Rathmann <[email protected]>
Date:   Wed Nov 27 16:24:55 2024 +0100

    QskSlider ticks implementaton completed

commit 7773195
Author: Uwe Rathmann <[email protected]>
Date:   Tue Nov 26 13:59:42 2024 +0100

    slider changes on press

commit 59b88ff
Author: Uwe Rathmann <[email protected]>
Date:   Tue Nov 26 13:57:13 2024 +0100

    slider layout code fixed

commit cd65adb
Author: Uwe Rathmann <[email protected]>
Date:   Tue Nov 26 13:48:55 2024 +0100

    QskSkinnable::metric with default value

commit ea3d7a5
Author: Uwe Rathmann <[email protected]>
Date:   Mon Nov 25 09:02:04 2024 +0100

    QskInterval::center(), QskInterval::stretch removed as they the
    implementation is only handling normalized intervals

commit 494c370
Author: Uwe Rathmann <[email protected]>
Date:   Fri Nov 22 17:38:58 2024 +0100

    ticks for F2 sliders

commit f4c2211
Author: Uwe Rathmann <[email protected]>
Date:   Fri Nov 22 17:37:47 2024 +0100

    API extended

commit 5c1e0cc
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 21 19:19:53 2024 +0100

    invalid constexpr qualifier removed

commit 9a5dd88
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 21 17:59:54 2024 +0100

    slider ticks - not only for M3

commit d04c030
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 21 17:59:37 2024 +0100

    using constexpr

commit d87c8e3
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 21 13:54:01 2024 +0100

    API cleanup of the Bounded controls

commit 109fc7d
Author: Uwe Rathmann <[email protected]>
Date:   Wed Nov 20 14:57:16 2024 +0100

    QskBoxClipNode renamed to QskClipNode + more clip options added

commit 1e38340
Author: Uwe Rathmann <[email protected]>
Date:   Wed Nov 20 11:00:17 2024 +0100

    M3 specific definitions moved to M3 classes

commit 97e3ea6
Author: Uwe Rathmann <[email protected]>
Date:   Mon Nov 18 16:44:06 2024 +0100

    Qt5 incompatibility fixed

commit 00f2112
Author: Uwe Rathmann <[email protected]>
Date:   Mon Nov 18 16:15:50 2024 +0100

    QskMaterial3SliderSkinlet introduced

commit 9fc7b1f
Author: Peter Hartmann <[email protected]>
Date:   Mon Nov 18 12:18:30 2024 +0100

    push buttons: Style checked state properly (#477)

    Resolves #367

commit b5c56f7
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 14 10:52:08 2024 +0100

    mismatch between allocated and used memory fixed

commit d1c2751
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 14 10:51:53 2024 +0100

    nullptr check added

commit 8dd5a7b
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 14 08:52:40 2024 +0100

    dangling reference fixed

commit baaccb2
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 14 07:43:34 2024 +0100

    avoid enum bitfields

commit 7f389ef
Author: Uwe Rathmann <[email protected]>
Date:   Wed Nov 13 14:11:11 2024 +0100

    don't subtract the slider margins twice

commit d84ab6e
Author: Peter Hartmann <[email protected]>
Date:   Wed Nov 13 10:00:38 2024 +0100

    Update instructions on how to build the website (#470)

    * Regenerate doxygen file

    ... and change some things

    * Add custom stylesheet from Skia

    * update instructions on how to build the website

commit 525ca3b
Author: Uwe Rathmann <[email protected]>
Date:   Thu Nov 7 17:31:14 2024 +0100

    QskSlider: Adapt to new Material3 style
    ( ValueLabel a.k.a Tooltip is not done yet )
  • Loading branch information
uwerat committed Dec 10, 2024
1 parent 128ce8f commit 8d78024
Show file tree
Hide file tree
Showing 103 changed files with 808 additions and 501 deletions.
28 changes: 21 additions & 7 deletions designsystems/fluent2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,27 @@
# SPDX-License-Identifier: BSD-3-Clause
############################################################################

set(SOURCES
QskFluent2Global.h
QskFluent2Theme.h QskFluent2Theme.cpp
QskFluent2Skin.h QskFluent2Skin.cpp
QskFluent2SkinFactory.h QskFluent2SkinFactory.cpp
list(APPEND HEADERS
QskFluent2Global.h QskFluent2Theme.h QskFluent2SkinFactory.h
)

list(APPEND PRIVATE_HEADERS
QskFluent2TextFieldSkinlet.h
)

list(APPEND SOURCES
QskFluent2Theme.cpp
QskFluent2Skin.cpp
QskFluent2SkinFactory.cpp
QskFluent2TextFieldSkinlet.cpp
)

qt_add_resources(SOURCES QskFluent2Icons.qrc)

qsk_add_plugin(fluent2skin skins QskFluent2SkinFactory ${SOURCES})
set_target_properties(fluent2skin PROPERTIES DEFINE_SYMBOL QSK_FLUENT2_MAKEDLL )
qsk_add_plugin(fluent2skin skins QskFluent2SkinFactory
${SOURCES} ${HEADERS} ${PRIVATE_HEADERS}
)

set_target_properties(fluent2skin PROPERTIES
DEFINE_SYMBOL QSK_FLUENT2_MAKEDLL
)
36 changes: 22 additions & 14 deletions designsystems/fluent2/QskFluent2Skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
*/
#include "QskFluent2Skin.h"
#include "QskFluent2Theme.h"
#include "QskFluent2TextFieldSkinlet.h"

#include <QskSkinHintTableEditor.h>

Expand Down Expand Up @@ -78,7 +79,7 @@
#include <QskTabBar.h>
#include <QskTabButton.h>
#include <QskTabView.h>
#include <QskTextInput.h>
#include <QskTextField.h>
#include <QskTextLabel.h>
#include <QskVirtualKeyboard.h>

Expand Down Expand Up @@ -296,8 +297,8 @@ namespace
void setupTabViewMetrics();
void setupTabViewColors( QskAspect::Section, const QskFluent2Theme& );

void setupTextInputMetrics();
void setupTextInputColors( QskAspect::Section, const QskFluent2Theme& );
void setupTextFieldMetrics();
void setupTextFieldColors( QskAspect::Section, const QskFluent2Theme& );

void setupTextLabelMetrics();
void setupTextLabelColors( QskAspect::Section, const QskFluent2Theme& );
Expand Down Expand Up @@ -355,7 +356,7 @@ void Editor::setupMetrics()
setupTabButtonMetrics();
setupTabBarMetrics();
setupTabViewMetrics();
setupTextInputMetrics();
setupTextFieldMetrics();
setupTextLabelMetrics();
setupVirtualKeyboardMetrics();
}
Expand Down Expand Up @@ -394,7 +395,7 @@ void Editor::setupColors( QskAspect::Section section, const QskFluent2Theme& the
setupTabButtonColors( section, theme );
setupTabBarColors( section, theme );
setupTabViewColors( section, theme );
setupTextInputColors( section, theme );
setupTextFieldColors( section, theme );
setupTextLabelColors( section, theme );
setupVirtualKeyboardColors( section, theme );
};
Expand Down Expand Up @@ -1771,9 +1772,9 @@ void Editor::setupTextLabelColors(
setColor( Q::Text | section, pal.fillColor.text.primary );
}

void Editor::setupTextInputMetrics()
void Editor::setupTextFieldMetrics()
{
using Q = QskTextInput;
using Q = QskTextField;

setStrutSize( Q::Panel, { -1, 30_px } );
setPadding( Q::Panel, { 11_px, 0, 11_px, 0 } );
Expand All @@ -1786,18 +1787,23 @@ void Editor::setupTextInputMetrics()

setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
setFontRole( Q::Text, Fluent2::Body );

setAlignment( Q::PlaceholderText, alignment( Q::Text ) );
setFontRole( Q::PlaceholderText, fontRole( Q::Text ) );
}

void Editor::setupTextInputColors(
void Editor::setupTextFieldColors(
QskAspect::Section section, const QskFluent2Theme& theme )
{
using Q = QskTextInput;
using Q = QskTextField;
using SK = QskTextFieldSkinlet;
using A = QskAspect;

const auto& pal = theme.palette;

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

for( const auto state : { A::NoState, Q::Hovered, Q::Focused, Q::Editing, Q::Disabled } )
{
Expand All @@ -1808,21 +1814,21 @@ void Editor::setupTextInputColors(
panelColor = pal.fillColor.control.defaultColor;
borderColor1 = pal.elevation.textControl.border[0];
borderColor2 = pal.elevation.textControl.border[1];
textColor = pal.fillColor.text.secondary;
textColor = pal.fillColor.text.primary;
}
else if ( state == Q::Hovered )
{
panelColor = pal.fillColor.control.secondary;
borderColor1 = pal.elevation.textControl.border[0];
borderColor2 = pal.elevation.textControl.border[1];
textColor = pal.fillColor.text.secondary;
textColor = pal.fillColor.text.primary;
}
else if ( ( state == Q::Focused ) || ( state == Q::Editing ) )
{
panelColor = pal.fillColor.control.inputActive;
borderColor1 = pal.elevation.textControl.border[0];
borderColor2 = pal.fillColor.accent.defaultColor;
textColor = pal.fillColor.text.secondary;
textColor = pal.fillColor.text.primary;
}
else if ( state == Q::Disabled )
{
Expand Down Expand Up @@ -2027,6 +2033,8 @@ void Editor::setupVirtualKeyboardColors(
QskFluent2Skin::QskFluent2Skin( QObject* parent )
: Inherited( parent )
{
declareSkinlet< QskTextField, QskFluent2TextFieldSkinlet >();

setupFonts();

Editor editor( &hintTable() );
Expand Down
26 changes: 26 additions & 0 deletions designsystems/fluent2/QskFluent2TextFieldSkinlet.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/

#include "QskFluent2TextFieldSkinlet.h"
#include "QskTextField.h"

using Q = QskTextField;

QskFluent2TextFieldSkinlet::QskFluent2TextFieldSkinlet( QskSkin* skin )
: Inherited( skin )
{
}

QskFluent2TextFieldSkinlet::~QskFluent2TextFieldSkinlet()
{
}

QRectF QskFluent2TextFieldSkinlet::subControlRect( const QskSkinnable* skinnable,
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
{
return Inherited::subControlRect( skinnable, contentsRect, subControl );
}

#include "moc_QskFluent2TextFieldSkinlet.cpp"
26 changes: 26 additions & 0 deletions designsystems/fluent2/QskFluent2TextFieldSkinlet.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/

#ifndef QSK_FLUENT2_TEXTFIELD_SKINLET_H
#define QSK_FLUENT2_TEXTFIELD_SKINLET_H

#include "QskFluent2Global.h"
#include "QskTextFieldSkinlet.h"

class QSK_FLUENT2_EXPORT QskFluent2TextFieldSkinlet : public QskTextFieldSkinlet
{
Q_GADGET

using Inherited = QskTextFieldSkinlet;

public:
Q_INVOKABLE QskFluent2TextFieldSkinlet( QskSkin* = nullptr );
~QskFluent2TextFieldSkinlet() override;

QRectF subControlRect( const QskSkinnable*,
const QRectF& rect, QskAspect::Subcontrol ) const override;
};

#endif
25 changes: 15 additions & 10 deletions designsystems/fusion/QskFusionSkin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
#include <QskTabBar.h>
#include <QskTabButton.h>
#include <QskTabView.h>
#include <QskTextInput.h>
#include <QskTextField.h>
#include <QskTextFieldSkinlet.h>
#include <QskTextLabel.h>
#include <QskVirtualKeyboard.h>

Expand Down Expand Up @@ -141,7 +142,7 @@ namespace
Q_INVOKABLE void setupTabButton();
Q_INVOKABLE void setupTabBar();
Q_INVOKABLE void setupTabView();
Q_INVOKABLE void setupTextInput();
Q_INVOKABLE void setupTextField();
Q_INVOKABLE void setupTextLabel();

QskGraphic symbol( const char* name ) const
Expand Down Expand Up @@ -382,34 +383,38 @@ void Editor::setupTextLabel()
setBoxBorderColors( Q::Panel, QskRgb::lighter( m_pal.outline, 108 ) );
}

void Editor::setupTextInput()
void Editor::setupTextField()
{
using Q = QskTextInput;
using Q = QskTextField;
using SK = QskTextFieldSkinlet;
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::PanelSelected | 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 | state, m_pal.color( colorGroup, P::Text ) );
setColor( Q::TextSelected | state, m_pal.color( colorGroup, P::HighlightedText ) );

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
2 changes: 2 additions & 0 deletions designsystems/material3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ list(APPEND HEADERS
list(APPEND PRIVATE_HEADERS
QskMaterial3ProgressBarSkinlet.h
QskMaterial3SliderSkinlet.h
QskMaterial3TextFieldSkinlet.h
)

list(APPEND SOURCES
QskMaterial3Skin.cpp
QskMaterial3SkinFactory.cpp
QskMaterial3ProgressBarSkinlet.cpp
QskMaterial3SliderSkinlet.cpp
QskMaterial3TextFieldSkinlet.cpp
)

qt_add_resources(SOURCES QskMaterial3Icons.qrc)
Expand Down
33 changes: 23 additions & 10 deletions designsystems/material3/QskMaterial3Skin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "QskMaterial3Skin.h"
#include "QskMaterial3ProgressBarSkinlet.h"
#include "QskMaterial3SliderSkinlet.h"
#include "QskMaterial3TextFieldSkinlet.h"

#include <QskSkinHintTableEditor.h>

Expand Down Expand Up @@ -45,7 +46,7 @@
#include <QskTabBar.h>
#include <QskTabButton.h>
#include <QskTabView.h>
#include <QskTextInput.h>
#include <QskTextField.h>
#include <QskTextLabel.h>
#include <QskVirtualKeyboard.h>

Expand Down Expand Up @@ -200,7 +201,7 @@ namespace
Q_INVOKABLE void setupTabButton();
Q_INVOKABLE void setupTabBar();
Q_INVOKABLE void setupTabView();
Q_INVOKABLE void setupTextInput();
Q_INVOKABLE void setupTextField();
Q_INVOKABLE void setupTextLabel();

QskGraphic symbol( const char* name ) const
Expand Down Expand Up @@ -450,13 +451,15 @@ void Editor::setupTextLabel()
}


void Editor::setupTextInput()
void Editor::setupTextField()
{
using Q = QskTextInput;
using Q = QskTextField;
using SK = QskTextFieldSkinlet;

setStrutSize( Q::Panel, -1.0, 56_dp );
setPadding( Q::Panel, { 12_dp, 8_dp, 12_dp, 8_dp } );
setGradient( Q::Panel, m_pal.surfaceVariant );
setColor( Q::Panel | SK::Selected, m_pal.primary12 );
setBoxShape( Q::Panel, m_pal.shapeExtraSmallTop );
setBoxBorderMetrics( Q::Panel, { 0, 0, 0, 1_dp } );
setBoxBorderColors( Q::Panel, m_pal.onSurfaceVariant );
Expand All @@ -476,11 +479,19 @@ void Editor::setupTextInput()
setFontRole( Q::Text, BodyMedium );
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );

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

const auto disabledPanelColor = QskRgb::toTransparentF( m_pal.onSurface, 0.04 );
setGradient( Q::Panel | Q::Disabled, disabledPanelColor );
setBoxBorderColors( Q::Panel | Q::Disabled, m_pal.onSurface38 );

setColor( Q::Text | Q::Disabled, m_pal.onSurface38 );

// PlaceholderText

setColor( Q::PlaceholderText, color( Q::Text ) );
setFontRole( Q::PlaceholderText, fontRole( Q::Text ) );
setAlignment( Q::PlaceholderText, alignment( Q::Text ) );
}

void Editor::setupProgressBar()
Expand Down Expand Up @@ -1069,7 +1080,6 @@ void Editor::setupSwitchButton()
using A = QskAspect;
using Q = QskSwitchButton;

const QskStateCombination allStates ( QskStateCombination::CombinationNoState, QskAspect::AllStates );

setBoxShape( Q::Groove, 100, Qt::RelativeSize );
const QSizeF strutSize( 52_dp, 32_dp );
Expand All @@ -1085,7 +1095,7 @@ void Editor::setupSwitchButton()
setBoxBorderColors( Q::Groove, m_pal.outline );
setBoxBorderColors( Q::Groove | Q::Disabled, m_pal.onSurface12 );

setBoxBorderMetrics( Q::Groove | Q::Checked, 0, allStates );
setBoxBorderMetrics( Q::Groove | Q::Checked, 0 );

setBoxShape( Q::Handle, 100, Qt::RelativeSize );
setStrutSize( Q::Handle, { 30_dp, 30_dp } );
Expand All @@ -1099,11 +1109,13 @@ void Editor::setupSwitchButton()
setStrutSize( Q::Icon, { 16_dp, 16_dp } );
setPadding( Q::Icon, 6_dp );
setSymbol( Q::Icon, symbol( "switchbutton-unchecked" ) );
setSymbol( Q::Icon | Q::Checked, symbol( "switchbutton-checked" ), allStates );
setSymbol( Q::Icon | Q::Checked, symbol( "switchbutton-checked" ) );

setGraphicRole( Q::Icon, QskMaterial3Skin::GraphicRoleSurfaceContainerHighest );
setGraphicRole( Q::Icon | Q::Checked, QskMaterial3Skin::GraphicRoleOnPrimaryContainer, allStates );
setGraphicRole( Q::Icon | Q::Disabled, QskMaterial3Skin::GraphicRoleSurfaceContainerHighest38, allStates );
setGraphicRole( Q::Icon | Q::Checked | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38, allStates );

setGraphicRole( Q::Icon | Q::Checked, QskMaterial3Skin::GraphicRoleOnPrimaryContainer );
setGraphicRole( Q::Icon | Q::Disabled, QskMaterial3Skin::GraphicRoleSurfaceContainerHighest38 );
setGraphicRole( Q::Icon | Q::Checked | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 );

for ( auto state1 : { A::NoState, Q::Hovered, Q::Focused, Q::Pressed } )
{
Expand Down Expand Up @@ -1612,6 +1624,7 @@ QskMaterial3Skin::QskMaterial3Skin( QObject* parent )
{
declareSkinlet< QskProgressBar, QskMaterial3ProgressBarSkinlet >();
declareSkinlet< QskSlider, QskMaterial3SliderSkinlet >();
declareSkinlet< QskTextField, QskMaterial3TextFieldSkinlet >();
}

QskMaterial3Skin::~QskMaterial3Skin()
Expand Down
Loading

0 comments on commit 8d78024

Please sign in to comment.