windows style: Rename to Fluent2

This commit is contained in:
Peter Hartmann 2023-06-17 12:23:34 +02:00
parent 1ccc37d0fc
commit 4df632cafd
26 changed files with 132 additions and 132 deletions

View File

@ -71,7 +71,7 @@ int main( int argc, char* argv[] )
qskSkinManager->setPluginPaths( QStringList() ); // no plugins qskSkinManager->setPluginPaths( QStringList() ); // no plugins
qskSkinManager->unregisterFactory( "material3factory" ); qskSkinManager->unregisterFactory( "material3factory" );
qskSkinManager->unregisterFactory( "squiekfactory" ); qskSkinManager->unregisterFactory( "squiekfactory" );
qskSkinManager->unregisterFactory( "windowsfactory" ); qskSkinManager->unregisterFactory( "fluent2factory" );
qskSkinManager->registerFactory( qskSkinManager->registerFactory(
QStringLiteral( "SampleSkinFactory" ), new SkinFactory() ); QStringLiteral( "SampleSkinFactory" ), new SkinFactory() );

View File

@ -1,3 +1,3 @@
add_subdirectory(squiek) add_subdirectory(squiek)
add_subdirectory(material3) add_subdirectory(material3)
add_subdirectory(windows) add_subdirectory(fluent2)

View File

@ -4,10 +4,10 @@
############################################################################ ############################################################################
set(SOURCES set(SOURCES
QskWindowsGlobal.h QskWindowsSkin.h QskWindowsSkin.cpp QskFluent2Global.h QskFluent2Skin.h QskFluent2Skin.cpp
QskWindowsSkinFactory.h QskWindowsSkinFactory.cpp QskFluent2SkinFactory.h QskFluent2SkinFactory.cpp
) )
qt_add_resources(SOURCES icons.qrc) qt_add_resources(SOURCES icons.qrc)
qsk_add_plugin(windowsskin skins QskWindowsSkinFactory ${SOURCES}) qsk_add_plugin(fluent2skin skins QskFluent2SkinFactory ${SOURCES})
set_target_properties(windowsskin PROPERTIES DEFINE_SYMBOL QSK_WINDOWS_MAKEDLL ) set_target_properties(fluent2skin PROPERTIES DEFINE_SYMBOL QSK_FLUENT2_MAKEDLL )

View File

@ -3,23 +3,23 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
#ifndef QSK_WINDOWS_GLOBAL_H #ifndef QSK_FLUENT2_GLOBAL_H
#define QSK_WINDOWS_GLOBAL_H #define QSK_FLUENT2_GLOBAL_H
#include "QskGlobal.h" #include "QskGlobal.h"
#ifdef QSK_DLL #ifdef QSK_DLL
#if defined( QSK_WINDOWS_MAKEDLL ) // create a DLL library #if defined( QSK_FLUENT2_MAKEDLL ) // create a DLL library
#define QSK_WINDOWS_EXPORT Q_DECL_EXPORT #define QSK_FLUENT2_EXPORT Q_DECL_EXPORT
#else // use a DLL library #else // use a DLL library
#define QSK_WINDOWS_EXPORT Q_DECL_IMPORT #define QSK_FLUENT2_EXPORT Q_DECL_IMPORT
#endif #endif
#endif // QSK_DLL #endif // QSK_DLL
#ifndef QSK_WINDOWS_EXPORT #ifndef QSK_FLUENT2_EXPORT
#define QSK_WINDOWS_EXPORT #define QSK_FLUENT2_EXPORT
#endif #endif
#endif #endif

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
#include "QskWindowsSkin.h" #include "QskFluent2Skin.h"
#include <QskSkinHintTableEditor.h> #include <QskSkinHintTableEditor.h>
@ -65,7 +65,7 @@ namespace
class Editor : private QskSkinHintTableEditor class Editor : private QskSkinHintTableEditor
{ {
public: public:
Editor( QskSkinHintTable* table, const QskWindowsTheme& palette ) Editor( QskSkinHintTable* table, const QskFluent2Theme& palette )
: QskSkinHintTableEditor( table ) : QskSkinHintTableEditor( table )
, theme( palette ) , theme( palette )
{ {
@ -103,13 +103,13 @@ namespace
QskGraphic symbol( const char* name ) const QskGraphic symbol( const char* name ) const
{ {
const QString path = QStringLiteral( ":windows/icons/qvg/" ) const QString path = QStringLiteral( ":fluent2/icons/qvg/" )
+ name + QStringLiteral( ".qvg" ); + name + QStringLiteral( ".qvg" );
return QskGraphicIO::read( path ); return QskGraphicIO::read( path );
} }
void setBoxBorderGradient( QskAspect aspect, QskWindowsTheme::BorderGradient gradient, QRgb baseColor ) void setBoxBorderGradient( QskAspect aspect, QskFluent2Theme::BorderGradient gradient, QRgb baseColor )
{ {
const QRgb leftTopRightColor = flattenedColor( gradient[ 0 ], baseColor ); const QRgb leftTopRightColor = flattenedColor( gradient[ 0 ], baseColor );
const QRgb bottomColor = flattenedColor( gradient[ 1 ], baseColor ); const QRgb bottomColor = flattenedColor( gradient[ 1 ], baseColor );
@ -117,7 +117,7 @@ namespace
setBoxBorderColors( aspect, { leftTopRightColor, leftTopRightColor, leftTopRightColor, bottomColor } ); setBoxBorderColors( aspect, { leftTopRightColor, leftTopRightColor, leftTopRightColor, bottomColor } );
} }
const QskWindowsTheme& theme; const QskFluent2Theme& theme;
}; };
QFont createFont( const QString& name, qreal lineHeight, QFont createFont( const QString& name, qreal lineHeight,
@ -195,9 +195,9 @@ void Editor::setupCheckBox()
const auto checkMark = symbol( "checkmark" ); const auto checkMark = symbol( "checkmark" );
setSymbol( Q::Indicator | Q::Checked, checkMark, { QskStateCombination::CombinationNoState, Q::Disabled } ); setSymbol( Q::Indicator | Q::Checked, checkMark, { QskStateCombination::CombinationNoState, Q::Disabled } );
setGraphicRole( Q::Indicator, QskWindowsSkin::GraphicRoleFillColorTextOnAccentPrimary ); setGraphicRole( Q::Indicator, QskFluent2Skin::GraphicRoleFillColorTextOnAccentPrimary );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.primary ); setColor( Q::Text, theme.palette.fillColor.text.primary );
@ -211,13 +211,13 @@ void Editor::setupCheckBox()
setBoxBorderColors( Q::Box | Q::Pressed, theme.palette.strokeColor.controlStrongStroke.disabled ); setBoxBorderColors( Q::Box | Q::Pressed, theme.palette.strokeColor.controlStrongStroke.disabled );
setGradient( Q::Box | Q::Pressed | Q::Checked, theme.palette.fillColor.accent.tertiary ); setGradient( Q::Box | Q::Pressed | Q::Checked, theme.palette.fillColor.accent.tertiary );
setBoxBorderColors( Q::Box | Q::Pressed | Q::Checked, theme.palette.fillColor.accent.tertiary ); setBoxBorderColors( Q::Box | Q::Pressed | Q::Checked, theme.palette.fillColor.accent.tertiary );
setGraphicRole( Q::Indicator | Q::Pressed | Q::Checked, QskWindowsSkin::GraphicRoleFillColorTextOnAccentSecondary ); setGraphicRole( Q::Indicator | Q::Pressed | Q::Checked, QskFluent2Skin::GraphicRoleFillColorTextOnAccentSecondary );
setGradient( Q::Box | Q::Disabled, theme.palette.fillColor.controlAlt.disabled ); setGradient( Q::Box | Q::Disabled, theme.palette.fillColor.controlAlt.disabled );
setBoxBorderColors( Q::Box | Q::Disabled, theme.palette.strokeColor.controlStrongStroke.disabled ); setBoxBorderColors( Q::Box | Q::Disabled, theme.palette.strokeColor.controlStrongStroke.disabled );
setGradient( Q::Box | Q::Disabled | Q::Checked, theme.palette.fillColor.accent.disabled ); setGradient( Q::Box | Q::Disabled | Q::Checked, theme.palette.fillColor.accent.disabled );
setBoxBorderColors( Q::Box | Q::Disabled | Q::Checked, theme.palette.fillColor.accent.disabled ); setBoxBorderColors( Q::Box | Q::Disabled | Q::Checked, theme.palette.fillColor.accent.disabled );
setGraphicRole( Q::Indicator | Q::Disabled | Q::Checked, QskWindowsSkin::GraphicRoleFillColorTextOnAccentDisabled ); setGraphicRole( Q::Indicator | Q::Disabled | Q::Checked, QskFluent2Skin::GraphicRoleFillColorTextOnAccentDisabled );
setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled ); setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled );
} }
@ -236,17 +236,17 @@ void Editor::setupComboBox()
setStrutSize( Q::Icon, 12, 12 ); setStrutSize( Q::Icon, 12, 12 );
setPadding( Q::Icon, { 0, 0, 8, 0 } ); setPadding( Q::Icon, { 0, 0, 8, 0 } );
setGraphicRole( Q::Icon, QskWindowsSkin::GraphicRoleFillColorTextPrimary ); setGraphicRole( Q::Icon, QskFluent2Skin::GraphicRoleFillColorTextPrimary );
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter ); setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.primary ); setColor( Q::Text, theme.palette.fillColor.text.primary );
setStrutSize( Q::StatusIndicator, 12, 12 ); setStrutSize( Q::StatusIndicator, 12, 12 );
setSymbol( Q::StatusIndicator, symbol( "spin-box-arrow-down" ) ); setSymbol( Q::StatusIndicator, symbol( "spin-box-arrow-down" ) );
setSymbol( Q::StatusIndicator | Q::PopupOpen, symbol( "spin-box-arrow-up" ) ); setSymbol( Q::StatusIndicator | Q::PopupOpen, symbol( "spin-box-arrow-up" ) );
setGraphicRole( Q::StatusIndicator, QskWindowsSkin::GraphicRoleFillColorTextSecondary ); setGraphicRole( Q::StatusIndicator, QskFluent2Skin::GraphicRoleFillColorTextSecondary );
// Hovered: // Hovered:
@ -272,9 +272,9 @@ void Editor::setupComboBox()
setBoxBorderColors( Q::Panel | Q::Disabled, theme.palette.strokeColor.controlStroke.defaultColor ); setBoxBorderColors( Q::Panel | Q::Disabled, theme.palette.strokeColor.controlStroke.defaultColor );
setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled ); setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled );
setGraphicRole( Q::Icon | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextDisabled ); setGraphicRole( Q::Icon | Q::Disabled, QskFluent2Skin::GraphicRoleFillColorTextDisabled );
setGraphicRole( Q::StatusIndicator | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextDisabled ); setGraphicRole( Q::StatusIndicator | Q::Disabled, QskFluent2Skin::GraphicRoleFillColorTextDisabled );
} }
void Editor::setupDialogButtonBox() void Editor::setupDialogButtonBox()
@ -330,12 +330,12 @@ void Editor::setupMenu()
{ 1.0, theme.palette.fillColor.subtle.secondary } } ); { 1.0, theme.palette.fillColor.subtle.secondary } } );
setBoxBorderColors( Q::Segment | Q::Selected, selectedGradient ); setBoxBorderColors( Q::Segment | Q::Selected, selectedGradient );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.primary ); setColor( Q::Text, theme.palette.fillColor.text.primary );
setStrutSize( Q::Icon, 12, 12 ); setStrutSize( Q::Icon, 12, 12 );
setPadding( Q::Icon, { 8, 8, 0, 8 } ); setPadding( Q::Icon, { 8, 8, 0, 8 } );
setGraphicRole( Q::Icon, QskWindowsSkin::GraphicRoleFillColorTextPrimary ); setGraphicRole( Q::Icon, QskFluent2Skin::GraphicRoleFillColorTextPrimary );
} }
void Editor::setupPageIndicator() void Editor::setupPageIndicator()
@ -366,19 +366,19 @@ void Editor::setupProgressBar()
void Editor::setupPushButton() void Editor::setupPushButton()
{ {
using Q = QskPushButton; using Q = QskPushButton;
using W = QskWindowsSkin; using W = QskFluent2Skin;
setStrutSize( Q::Panel, { 120, 32 } ); setStrutSize( Q::Panel, { 120, 32 } );
setBoxShape( Q::Panel, 4 ); setBoxShape( Q::Panel, 4 );
setBoxBorderMetrics( Q::Panel, 1 ); setBoxBorderMetrics( Q::Panel, 1 );
// Windows buttons don't really have icons, // Fluent buttons don't really have icons,
// but for the sake of compatibility with the // but for the sake of compatibility with the
// gallery app, let's define their style here as well: // gallery app, let's define their style here as well:
setStrutSize( Q::Icon, 12, 12 ); setStrutSize( Q::Icon, 12, 12 );
setPadding( Q::Icon, { 0, 0, 8, 0 } ); setPadding( Q::Icon, { 0, 0, 8, 0 } );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
// Accent buttons: // Accent buttons:
@ -387,7 +387,7 @@ void Editor::setupPushButton()
setGradient( Q::Panel | W::Accent, theme.palette.fillColor.accent.defaultColor ); setGradient( Q::Panel | W::Accent, theme.palette.fillColor.accent.defaultColor );
setColor( Q::Text | W::Accent, theme.palette.fillColor.textOnAccent.primary ); setColor( Q::Text | W::Accent, theme.palette.fillColor.textOnAccent.primary );
setGraphicRole( Q::Icon | W::Accent, QskWindowsSkin::GraphicRoleFillColorTextOnAccentPrimary ); setGraphicRole( Q::Icon | W::Accent, QskFluent2Skin::GraphicRoleFillColorTextOnAccentPrimary );
setBoxBorderGradient( Q::Panel | W::Accent | Q::Hovered, theme.palette.elevation.accentControl.border, setBoxBorderGradient( Q::Panel | W::Accent | Q::Hovered, theme.palette.elevation.accentControl.border,
@ -399,7 +399,7 @@ void Editor::setupPushButton()
setGradient( Q::Panel | W::Accent | Q::Pressed, theme.palette.fillColor.accent.tertiary ); setGradient( Q::Panel | W::Accent | Q::Pressed, theme.palette.fillColor.accent.tertiary );
setColor( Q::Text | W::Accent | Q::Pressed, theme.palette.fillColor.textOnAccent.secondary ); setColor( Q::Text | W::Accent | Q::Pressed, theme.palette.fillColor.textOnAccent.secondary );
setGraphicRole( Q::Icon | W::Accent | Q::Pressed, QskWindowsSkin::GraphicRoleFillColorTextOnAccentSecondary ); setGraphicRole( Q::Icon | W::Accent | Q::Pressed, QskFluent2Skin::GraphicRoleFillColorTextOnAccentSecondary );
const QRgb accentPressedBorderColor = flattenedColor( theme.palette.strokeColor.controlStroke.onAccentDefault, const QRgb accentPressedBorderColor = flattenedColor( theme.palette.strokeColor.controlStroke.onAccentDefault,
theme.palette.fillColor.accent.tertiary ); theme.palette.fillColor.accent.tertiary );
@ -409,7 +409,7 @@ void Editor::setupPushButton()
setGradient( Q::Panel | W::Accent | Q::Disabled, theme.palette.fillColor.accent.disabled ); setGradient( Q::Panel | W::Accent | Q::Disabled, theme.palette.fillColor.accent.disabled );
setColor( Q::Text | W::Accent | Q::Disabled, theme.palette.fillColor.textOnAccent.disabled ); setColor( Q::Text | W::Accent | Q::Disabled, theme.palette.fillColor.textOnAccent.disabled );
setGraphicRole( Q::Icon | W::Accent | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextOnAccentDisabled ); setGraphicRole( Q::Icon | W::Accent | Q::Disabled, QskFluent2Skin::GraphicRoleFillColorTextOnAccentDisabled );
setBoxBorderMetrics( Q::Panel | W::Accent | Q::Disabled, 0 ); setBoxBorderMetrics( Q::Panel | W::Accent | Q::Disabled, 0 );
@ -421,7 +421,7 @@ void Editor::setupPushButton()
setGradient( Q::Panel, theme.palette.fillColor.control.defaultColor ); setGradient( Q::Panel, theme.palette.fillColor.control.defaultColor );
setColor( Q::Text, theme.palette.fillColor.text.primary ); setColor( Q::Text, theme.palette.fillColor.text.primary );
setGraphicRole( Q::Icon, QskWindowsSkin::GraphicRoleFillColorTextPrimary ); setGraphicRole( Q::Icon, QskFluent2Skin::GraphicRoleFillColorTextPrimary );
setBoxBorderGradient( Q::Panel | Q::Hovered, theme.palette.elevation.control.border, setBoxBorderGradient( Q::Panel | Q::Hovered, theme.palette.elevation.control.border,
@ -438,7 +438,7 @@ void Editor::setupPushButton()
setGradient( Q::Panel | Q::Pressed, theme.palette.fillColor.control.tertiary ); setGradient( Q::Panel | Q::Pressed, theme.palette.fillColor.control.tertiary );
setColor( Q::Text | Q::Pressed, theme.palette.fillColor.text.secondary ); setColor( Q::Text | Q::Pressed, theme.palette.fillColor.text.secondary );
setGraphicRole( Q::Icon | Q::Pressed, QskWindowsSkin::GraphicRoleFillColorTextSecondary ); setGraphicRole( Q::Icon | Q::Pressed, QskFluent2Skin::GraphicRoleFillColorTextSecondary );
const QRgb standardDisabledBorderColor = flattenedColor( theme.palette.strokeColor.controlStroke.defaultColor, const QRgb standardDisabledBorderColor = flattenedColor( theme.palette.strokeColor.controlStroke.defaultColor,
@ -448,7 +448,7 @@ void Editor::setupPushButton()
setGradient( Q::Panel | Q::Disabled, theme.palette.fillColor.control.disabled ); setGradient( Q::Panel | Q::Disabled, theme.palette.fillColor.control.disabled );
setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled ); setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled );
setGraphicRole( Q::Icon | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextDisabled ); setGraphicRole( Q::Icon | Q::Disabled, QskFluent2Skin::GraphicRoleFillColorTextDisabled );
} }
void Editor::setupRadioBox() void Editor::setupRadioBox()
@ -461,7 +461,7 @@ void Editor::setupRadioBox()
setStrutSize( Q::CheckIndicatorPanel, { 20, 20 } ); setStrutSize( Q::CheckIndicatorPanel, { 20, 20 } );
setBoxShape( Q::CheckIndicatorPanel, 100, Qt::RelativeSize ); setBoxShape( Q::CheckIndicatorPanel, 100, Qt::RelativeSize );
setBoxBorderMetrics( Q::CheckIndicatorPanel, 1 ); setBoxBorderMetrics( Q::CheckIndicatorPanel, 1 );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.primary ); setColor( Q::Text, theme.palette.fillColor.text.primary );
// Rest // Rest
@ -549,9 +549,9 @@ void Editor::setupSegmentedBar()
setSpacing( Q::Panel, 8 ); setSpacing( Q::Panel, 8 );
setStrutSize( Q::Icon, { 12, 12 } ); setStrutSize( Q::Icon, { 12, 12 } );
setGraphicRole( Q::Icon, QskWindowsSkin::GraphicRoleFillColorTextPrimary ); setGraphicRole( Q::Icon, QskFluent2Skin::GraphicRoleFillColorTextPrimary );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.primary ); setColor( Q::Text, theme.palette.fillColor.text.primary );
setStrutSize( Q::Segment | A::Horizontal, segmentStrutSize ); setStrutSize( Q::Segment | A::Horizontal, segmentStrutSize );
@ -567,7 +567,7 @@ void Editor::setupSegmentedBar()
// Selected: // Selected:
setGradient( Q::Segment | Q::Selected, theme.palette.fillColor.accent.defaultColor ); setGradient( Q::Segment | Q::Selected, theme.palette.fillColor.accent.defaultColor );
setGraphicRole( Q::Icon | Q::Selected, QskWindowsSkin::GraphicRoleFillColorTextOnAccentPrimary ); setGraphicRole( Q::Icon | Q::Selected, QskFluent2Skin::GraphicRoleFillColorTextOnAccentPrimary );
setColor( Q::Text | Q::Selected, theme.palette.fillColor.textOnAccent.primary ); setColor( Q::Text | Q::Selected, theme.palette.fillColor.textOnAccent.primary );
// Disabled: // Disabled:
@ -578,12 +578,12 @@ void Editor::setupSegmentedBar()
setGradient( Q::Segment | Q::Disabled, theme.palette.fillColor.control.disabled ); setGradient( Q::Segment | Q::Disabled, theme.palette.fillColor.control.disabled );
setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled ); setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled );
setGraphicRole( Q::Icon | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextDisabled ); setGraphicRole( Q::Icon | Q::Disabled, QskFluent2Skin::GraphicRoleFillColorTextDisabled );
setGradient( Q::Segment | Q::Selected | Q::Disabled, theme.palette.fillColor.accent.disabled ); setGradient( Q::Segment | Q::Selected | Q::Disabled, theme.palette.fillColor.accent.disabled );
setColor( Q::Text | Q::Selected | Q::Disabled, theme.palette.fillColor.textOnAccent.disabled ); setColor( Q::Text | Q::Selected | Q::Disabled, theme.palette.fillColor.textOnAccent.disabled );
setGraphicRole( Q::Icon | Q::Selected | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextOnAccentDisabled ); setGraphicRole( Q::Icon | Q::Selected | Q::Disabled, QskFluent2Skin::GraphicRoleFillColorTextOnAccentDisabled );
setBoxBorderMetrics( Q::Panel | Q::Selected | Q::Disabled, 0 ); setBoxBorderMetrics( Q::Panel | Q::Selected | Q::Disabled, 0 );
} }
@ -649,7 +649,7 @@ void Editor::setupSpinBox()
theme.palette.fillColor.control.defaultColor ); theme.palette.fillColor.control.defaultColor );
setAlignment( Q::Text, Qt::AlignLeft ); setAlignment( Q::Text, Qt::AlignLeft );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.primary ); setColor( Q::Text, theme.palette.fillColor.text.primary );
setPadding( Q::TextPanel, { 11, 5, 0, 0 } ); setPadding( Q::TextPanel, { 11, 5, 0, 0 } );
@ -665,8 +665,8 @@ void Editor::setupSpinBox()
setSymbol( Q::UpIndicator, symbol( "spin-box-arrow-up" ) ); setSymbol( Q::UpIndicator, symbol( "spin-box-arrow-up" ) );
setSymbol( Q::DownIndicator, symbol( "spin-box-arrow-down" ) ); setSymbol( Q::DownIndicator, symbol( "spin-box-arrow-down" ) );
setGraphicRole( Q::UpIndicator, QskWindowsSkin::GraphicRoleFillColorTextSecondary ); setGraphicRole( Q::UpIndicator, QskFluent2Skin::GraphicRoleFillColorTextSecondary );
setGraphicRole( Q::DownIndicator, QskWindowsSkin::GraphicRoleFillColorTextSecondary ); setGraphicRole( Q::DownIndicator, QskFluent2Skin::GraphicRoleFillColorTextSecondary );
// Hovered: // Hovered:
@ -693,8 +693,8 @@ void Editor::setupSpinBox()
setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled ); setColor( Q::Text | Q::Disabled, theme.palette.fillColor.text.disabled );
setGraphicRole( Q::UpIndicator | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextDisabled ); setGraphicRole( Q::UpIndicator | Q::Disabled, QskFluent2Skin::GraphicRoleFillColorTextDisabled );
setGraphicRole( Q::DownIndicator | Q::Disabled, QskWindowsSkin::GraphicRoleFillColorTextDisabled ); setGraphicRole( Q::DownIndicator | Q::Disabled, QskFluent2Skin::GraphicRoleFillColorTextDisabled );
} }
void Editor::setupTabBar() void Editor::setupTabBar()
@ -718,10 +718,10 @@ void Editor::setupTabButton()
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter ); setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.secondary ); setColor( Q::Text, theme.palette.fillColor.text.secondary );
setFontRole( Q::Text | Q::Checked, QskWindowsSkin::BodyStrong ); setFontRole( Q::Text | Q::Checked, QskFluent2Skin::BodyStrong );
setColor( Q::Text | Q::Checked, theme.palette.fillColor.text.primary ); setColor( Q::Text | Q::Checked, theme.palette.fillColor.text.primary );
setGradient( Q::Panel | Q::Hovered, theme.palette.fillColor.subtle.secondary ); setGradient( Q::Panel | Q::Hovered, theme.palette.fillColor.subtle.secondary );
@ -742,7 +742,7 @@ void Editor::setupTextLabel()
setPadding( Q::Panel, 10 ); setPadding( Q::Panel, 10 );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.primary ); setColor( Q::Text, theme.palette.fillColor.text.primary );
} }
@ -757,7 +757,7 @@ void Editor::setupTextInput()
setPadding( Q::Panel, { 11, 0, 11, 0 } ); setPadding( Q::Panel, { 11, 0, 11, 0 } );
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter ); setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
setFontRole( Q::Text, QskWindowsSkin::Body ); setFontRole( Q::Text, QskFluent2Skin::Body );
setColor( Q::Text, theme.palette.fillColor.text.secondary ); setColor( Q::Text, theme.palette.fillColor.text.secondary );
setGradient( Q::Panel, theme.palette.fillColor.control.defaultColor ); setGradient( Q::Panel, theme.palette.fillColor.control.defaultColor );
@ -881,7 +881,7 @@ void Editor::setupSubWindow()
setHint( Q::TitleBarPanel | QskAspect::Style, Q::TitleBar | Q::Title ); setHint( Q::TitleBarPanel | QskAspect::Style, Q::TitleBar | Q::Title );
setPadding( Q::TitleBarPanel, { 24, 31, 24, 0 } ); setPadding( Q::TitleBarPanel, { 24, 31, 24, 0 } );
setFontRole( Q::TitleBarText, QskWindowsSkin::Subtitle ); setFontRole( Q::TitleBarText, QskFluent2Skin::Subtitle );
setColor( Q::TitleBarText, theme.palette.fillColor.text.primary ); setColor( Q::TitleBarText, theme.palette.fillColor.text.primary );
setAlignment( Q::TitleBarText, Qt::AlignLeft ); setAlignment( Q::TitleBarText, Qt::AlignLeft );
setTextOptions( Q::TitleBarText, Qt::ElideRight, QskTextOptions::NoWrap ); setTextOptions( Q::TitleBarText, Qt::ElideRight, QskTextOptions::NoWrap );
@ -897,7 +897,7 @@ void Editor::setupVirtualKeyboard()
setGradient( Q::ButtonPanel | QskPushButton::Pressed, theme.palette.fillColor.control.tertiary ); setGradient( Q::ButtonPanel | QskPushButton::Pressed, theme.palette.fillColor.control.tertiary );
setColor( Q::ButtonText, theme.palette.fillColor.text.primary ); setColor( Q::ButtonText, theme.palette.fillColor.text.primary );
setFontRole( Q::ButtonText, QskWindowsSkin::BodyLarge ); setFontRole( Q::ButtonText, QskFluent2Skin::BodyLarge );
setColor( Q::ButtonText | QskPushButton::Pressed, theme.palette.fillColor.text.secondary ); setColor( Q::ButtonText | QskPushButton::Pressed, theme.palette.fillColor.text.secondary );
setGradient( Q::Panel, theme.palette.background.fillColor.solidBackground.secondary ); setGradient( Q::Panel, theme.palette.background.fillColor.solidBackground.secondary );
@ -905,9 +905,9 @@ void Editor::setupVirtualKeyboard()
} }
QskWindowsTheme::QskWindowsTheme( Theme lightness ) QskFluent2Theme::QskFluent2Theme( Theme lightness )
: QskWindowsTheme( lightness, : QskFluent2Theme( lightness,
{ // default Windows accent colors: { // default Fluent accent colors:
0xff98ecfe, 0xff98ecfe,
0xff60ccfe, 0xff60ccfe,
0xff0093f9, 0xff0093f9,
@ -919,7 +919,7 @@ QskWindowsTheme::QskWindowsTheme( Theme lightness )
{ {
} }
QskWindowsTheme::QskWindowsTheme( Theme theme, std::array< QRgb, NumAccentColors > accentColors ) QskFluent2Theme::QskFluent2Theme( Theme theme, std::array< QRgb, NumAccentColors > accentColors )
{ {
if( theme == Light ) if( theme == Light )
{ {
@ -1206,7 +1206,7 @@ QskWindowsTheme::QskWindowsTheme( Theme theme, std::array< QRgb, NumAccentColors
} }
} }
QskWindowsSkin::QskWindowsSkin( const QskWindowsTheme& palette, QObject* parent ) QskFluent2Skin::QskFluent2Skin( const QskFluent2Theme& palette, QObject* parent )
: Inherited( parent ) : Inherited( parent )
{ {
setupFonts(); setupFonts();
@ -1216,11 +1216,11 @@ QskWindowsSkin::QskWindowsSkin( const QskWindowsTheme& palette, QObject* parent
editor.setup(); editor.setup();
} }
QskWindowsSkin::~QskWindowsSkin() QskFluent2Skin::~QskFluent2Skin()
{ {
} }
void QskWindowsSkin::setupFonts() void QskFluent2Skin::setupFonts()
{ {
static QString fontName( QStringLiteral( "Segoe UI Variable" ) ); static QString fontName( QStringLiteral( "Segoe UI Variable" ) );
Inherited::setupFonts( fontName ); Inherited::setupFonts( fontName );
@ -1235,7 +1235,7 @@ void QskWindowsSkin::setupFonts()
setFont( Display, createFont( fontName, 68, 92, 0.0, QFont::DemiBold ) ); setFont( Display, createFont( fontName, 68, 92, 0.0, QFont::DemiBold ) );
} }
void QskWindowsSkin::setGraphicColor( GraphicRole role, QRgb rgb ) void QskFluent2Skin::setGraphicColor( GraphicRole role, QRgb rgb )
{ {
QskColorFilter colorFilter; QskColorFilter colorFilter;
colorFilter.setMask( QskRgb::RGBAMask ); colorFilter.setMask( QskRgb::RGBAMask );
@ -1244,7 +1244,7 @@ void QskWindowsSkin::setGraphicColor( GraphicRole role, QRgb rgb )
setGraphicFilter( role, colorFilter ); setGraphicFilter( role, colorFilter );
} }
void QskWindowsSkin::setupGraphicFilters( const QskWindowsTheme& theme ) void QskFluent2Skin::setupGraphicFilters( const QskFluent2Theme& theme )
{ {
setGraphicColor( GraphicRoleFillColorTextDisabled, theme.palette.fillColor.text.disabled ); setGraphicColor( GraphicRoleFillColorTextDisabled, theme.palette.fillColor.text.disabled );
setGraphicColor( GraphicRoleFillColorTextOnAccentDisabled, theme.palette.fillColor.textOnAccent.disabled ); setGraphicColor( GraphicRoleFillColorTextOnAccentDisabled, theme.palette.fillColor.textOnAccent.disabled );
@ -1254,4 +1254,4 @@ void QskWindowsSkin::setupGraphicFilters( const QskWindowsTheme& theme )
setGraphicColor( GraphicRoleFillColorTextSecondary, theme.palette.fillColor.text.secondary ); setGraphicColor( GraphicRoleFillColorTextSecondary, theme.palette.fillColor.text.secondary );
} }
#include "moc_QskWindowsSkin.cpp" #include "moc_QskFluent2Skin.cpp"

View File

@ -3,10 +3,10 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
#ifndef QSK_WINDOWS_SKIN_H #ifndef QSK_FLUENT2_SKIN_H
#define QSK_WINDOWS_SKIN_H #define QSK_FLUENT2_SKIN_H
#include "QskWindowsGlobal.h" #include "QskFluent2Global.h"
#include <QskBoxShapeMetrics.h> #include <QskBoxShapeMetrics.h>
#include <QskGradient.h> #include <QskGradient.h>
@ -15,7 +15,7 @@
#include <array> #include <array>
class QSK_WINDOWS_EXPORT QskWindowsTheme class QSK_FLUENT2_EXPORT QskFluent2Theme
{ {
public: public:
enum Theme enum Theme
@ -37,8 +37,8 @@ class QSK_WINDOWS_EXPORT QskWindowsTheme
NumAccentColors NumAccentColors
}; };
QskWindowsTheme( Theme ); QskFluent2Theme( Theme );
QskWindowsTheme( Theme, std::array< QRgb, NumAccentColors > ); QskFluent2Theme( Theme, std::array< QRgb, NumAccentColors > );
typedef std::array< QRgb, 2 > BorderGradient; typedef std::array< QRgb, 2 > BorderGradient;
@ -329,15 +329,15 @@ class QSK_WINDOWS_EXPORT QskWindowsTheme
Shadow shadow; Shadow shadow;
}; };
class QSK_WINDOWS_EXPORT QskWindowsSkin : public QskSkin class QSK_FLUENT2_EXPORT QskFluent2Skin : public QskSkin
{ {
Q_OBJECT Q_OBJECT
using Inherited = QskSkin; using Inherited = QskSkin;
public: public:
QskWindowsSkin( const QskWindowsTheme&, QObject* parent = nullptr ); QskFluent2Skin( const QskFluent2Theme&, QObject* parent = nullptr );
~QskWindowsSkin() override; ~QskFluent2Skin() override;
enum GraphicRole enum GraphicRole
{ {
@ -366,7 +366,7 @@ class QSK_WINDOWS_EXPORT QskWindowsSkin : public QskSkin
private: private:
void setupFonts(); void setupFonts();
void setupGraphicFilters( const QskWindowsTheme& palette ); void setupGraphicFilters( const QskFluent2Theme& palette );
void setGraphicColor( GraphicRole, QRgb ); void setGraphicColor( GraphicRole, QRgb );
}; };

View File

@ -0,0 +1,42 @@
/******************************************************************************
* QSkinny - Copyright (C) 2023 Edelhirsch Software GmbH
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "QskFluent2SkinFactory.h"
#include "QskFluent2Skin.h"
static const QString fluent2LightSkinName = QStringLiteral( "Fluent2 Light" );
static const QString fluent2DarkSkinName = QStringLiteral( "Fluent2 Dark" );
QskFluent2SkinFactory::QskFluent2SkinFactory( QObject* parent )
: QskSkinFactory( parent )
{
}
QskFluent2SkinFactory::~QskFluent2SkinFactory()
{
}
QStringList QskFluent2SkinFactory::skinNames() const
{
return { fluent2LightSkinName, fluent2DarkSkinName };
}
QskSkin* QskFluent2SkinFactory::createSkin( const QString& skinName )
{
if ( QString::compare( skinName, fluent2LightSkinName, Qt::CaseInsensitive ) == 0 )
{
QskFluent2Theme theme( QskFluent2Theme::Light );
return new QskFluent2Skin( theme );
}
else if ( QString::compare( skinName, fluent2DarkSkinName, Qt::CaseInsensitive ) == 0 )
{
QskFluent2Theme theme( QskFluent2Theme::Dark );
return new QskFluent2Skin( theme );
}
return nullptr;
}
#include "moc_QskFluent2SkinFactory.cpp"

View File

@ -3,23 +3,23 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
#ifndef QSK_WINDOWS_SKIN_FACTORY_H #ifndef QSK_FLUENT2_SKIN_FACTORY_H
#define QSK_WINDOWS_SKIN_FACTORY_H #define QSK_FLUENT2_SKIN_FACTORY_H
#include "QskWindowsGlobal.h" #include "QskFluent2Global.h"
#include <QskSkinFactory.h> #include <QskSkinFactory.h>
class QSK_WINDOWS_EXPORT QskWindowsSkinFactory : public QskSkinFactory class QSK_FLUENT2_EXPORT QskFluent2SkinFactory : public QskSkinFactory
{ {
Q_OBJECT Q_OBJECT
#if defined( QSK_WINDOWS_MAKEDLL ) #if defined( QSK_FLUENT2_MAKEDLL )
Q_PLUGIN_METADATA( IID QskSkinFactoryIID FILE "metadata.json" ) Q_PLUGIN_METADATA( IID QskSkinFactoryIID FILE "metadata.json" )
Q_INTERFACES( QskSkinFactory ) Q_INTERFACES( QskSkinFactory )
#endif #endif
public: public:
QskWindowsSkinFactory( QObject* parent = nullptr ); QskFluent2SkinFactory( QObject* parent = nullptr );
~QskWindowsSkinFactory() override; ~QskFluent2SkinFactory() override;
QStringList skinNames() const override; QStringList skinNames() const override;
QskSkin* createSkin( const QString& skinName ) override; QskSkin* createSkin( const QString& skinName ) override;

View File

@ -1,5 +1,5 @@
<RCC> <RCC>
<qresource prefix="/windows"> <qresource prefix="/fluent2">
<file>icons/qvg/checkmark.qvg</file> <file>icons/qvg/checkmark.qvg</file>
<file>icons/qvg/combo-box-arrow-closed.qvg</file> <file>icons/qvg/combo-box-arrow-closed.qvg</file>
<file>icons/qvg/combo-box-arrow-open.qvg</file> <file>icons/qvg/combo-box-arrow-open.qvg</file>

View File

Before

Width:  |  Height:  |  Size: 777 B

After

Width:  |  Height:  |  Size: 777 B

View File

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 157 B

View File

Before

Width:  |  Height:  |  Size: 187 B

After

Width:  |  Height:  |  Size: 187 B

View File

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 246 B

View File

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 631 B

View File

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 625 B

View File

@ -0,0 +1,4 @@
{
"FactoryId": "Fluent2Factory",
"Skins": [ "Fluent2 Light", "Fluent2 Dark" ]
}

View File

@ -1,42 +0,0 @@
/******************************************************************************
* QSkinny - Copyright (C) 2023 Edelhirsch Software GmbH
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "QskWindowsSkinFactory.h"
#include "QskWindowsSkin.h"
static const QString windowsLightSkinName = QStringLiteral( "Windows Light" );
static const QString windowsDarkSkinName = QStringLiteral( "Windows Dark" );
QskWindowsSkinFactory::QskWindowsSkinFactory( QObject* parent )
: QskSkinFactory( parent )
{
}
QskWindowsSkinFactory::~QskWindowsSkinFactory()
{
}
QStringList QskWindowsSkinFactory::skinNames() const
{
return { windowsLightSkinName, windowsDarkSkinName };
}
QskSkin* QskWindowsSkinFactory::createSkin( const QString& skinName )
{
if ( QString::compare( skinName, windowsLightSkinName, Qt::CaseInsensitive ) == 0 )
{
QskWindowsTheme theme( QskWindowsTheme::Light );
return new QskWindowsSkin( theme );
}
else if ( QString::compare( skinName, windowsDarkSkinName, Qt::CaseInsensitive ) == 0 )
{
QskWindowsTheme theme( QskWindowsTheme::Dark );
return new QskWindowsSkin( theme );
}
return nullptr;
}
#include "moc_QskWindowsSkinFactory.cpp"

View File

@ -1,4 +0,0 @@
{
"FactoryId": "WindowsFactory",
"Skins": [ "Windows Light", "Windows Dark" ]
}

View File

@ -33,7 +33,7 @@ target_include_directories(${target} PUBLIC ${CMAKE_CURRENT_LIST_DIR})
if(ENABLE_ENSURE_SKINS) if(ENABLE_ENSURE_SKINS)
target_include_directories(${target} PRIVATE ${CMAKE_SOURCE_DIR}/skins) target_include_directories(${target} PRIVATE ${CMAKE_SOURCE_DIR}/skins)
target_compile_definitions(${target} PRIVATE ENSURE_SKINS) target_compile_definitions(${target} PRIVATE ENSURE_SKINS)
target_link_libraries(${target} PRIVATE squiekskin material3skin windowsskin) target_link_libraries(${target} PRIVATE squiekskin material3skin fluent2skin)
endif() endif()
set(HIDE_SYSTEM_FONTS ON) set(HIDE_SYSTEM_FONTS ON)

View File

@ -51,7 +51,7 @@ static bool pluginPath = initPluginPath();
#include <squiek/QskSquiekSkinFactory.h> #include <squiek/QskSquiekSkinFactory.h>
#include <material3/QskMaterial3SkinFactory.h> #include <material3/QskMaterial3SkinFactory.h>
#include <windows/QskWindowsSkinFactory.h> #include <fluent2/QskFluent2SkinFactory.h>
static void initSkins() static void initSkins()
{ {
@ -64,7 +64,7 @@ static bool pluginPath = initPluginPath();
qskSkinManager->registerFactory( "SquiekFactory", new QskSquiekSkinFactory() ); qskSkinManager->registerFactory( "SquiekFactory", new QskSquiekSkinFactory() );
qskSkinManager->registerFactory( "Material3Factory", new QskMaterial3SkinFactory() ); qskSkinManager->registerFactory( "Material3Factory", new QskMaterial3SkinFactory() );
qskSkinManager->registerFactory( "WindowsFactory", new QskWindowsSkinFactory() ); qskSkinManager->registerFactory( "Fluent2Factory", new QskFluent2SkinFactory() );
qWarning() << "Couldn't find skin plugins, adding some manually."; qWarning() << "Couldn't find skin plugins, adding some manually.";
} }