Fusion skin - very first version

This commit is contained in:
Uwe Rathmann 2024-01-24 17:42:32 +01:00
parent 99080bf265
commit ffa207e268
19 changed files with 1730 additions and 1 deletions

View File

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

View File

@ -0,0 +1,13 @@
############################################################################
# QSkinny - Copyright (C) The authors
# SPDX-License-Identifier: BSD-3-Clause
############################################################################
set(SOURCES
QskFusionGlobal.h QskFusionSkin.h QskFusionSkin.cpp
QskFusionSkinFactory.h QskFusionSkinFactory.cpp
)
qt_add_resources(SOURCES icons.qrc)
qsk_add_plugin(fusionskin skins QskFusionSkinFactory ${SOURCES})
set_target_properties(fusionskin PROPERTIES DEFINE_SYMBOL QSK_FUSION_MAKEDLL )

View File

@ -0,0 +1,25 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_FUSION_GLOBAL_H
#define QSK_FUSION_GLOBAL_H
#include "QskGlobal.h"
#ifdef QSK_DLL
#if defined( QSK_FUSION_MAKEDLL ) // create a DLL library
#define QSK_FUSION_EXPORT Q_DECL_EXPORT
#else // use a DLL library
#define QSK_FUSION_EXPORT Q_DECL_IMPORT
#endif
#endif // QSK_DLL
#ifndef QSK_FUSION_EXPORT
#define QSK_FUSION_EXPORT
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_FUSION_SKIN_H
#define QSK_FUSION_SKIN_H
#include "QskFusionGlobal.h"
#include <QskSkin.h>
class QSK_FUSION_EXPORT QskFusionSkin : public QskSkin
{
Q_OBJECT
using Inherited = QskSkin;
public:
QskFusionSkin( QskSkin::ColorScheme, QObject* parent = nullptr );
~QskFusionSkin() override;
enum GraphicRole
{
GraphicNormal,
GraphicDisabled,
GraphicHighlighted,
GraphicError
};
private:
void setGraphicColor( GraphicRole, QRgb );
};
#endif

View File

@ -0,0 +1,37 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "QskFusionSkinFactory.h"
#include "QskFusionSkin.h"
static const QStringList fusionSkinNames =
{ QStringLiteral( "Fusion Light" ), QStringLiteral( "Fusion Dark" ) };
QskFusionSkinFactory::QskFusionSkinFactory( QObject* parent )
: QskSkinFactory( parent )
{
}
QskFusionSkinFactory::~QskFusionSkinFactory()
{
}
QStringList QskFusionSkinFactory::skinNames() const
{
return fusionSkinNames;
}
QskSkin* QskFusionSkinFactory::createSkin( const QString& skinName )
{
if ( QString::compare( skinName, fusionSkinNames[0], Qt::CaseInsensitive ) == 0 )
return new QskFusionSkin( QskSkin::LightScheme );
if ( QString::compare( skinName, fusionSkinNames[1], Qt::CaseInsensitive ) == 0 )
return new QskFusionSkin( QskSkin::DarkScheme );
return nullptr;
}
#include "moc_QskFusionSkinFactory.cpp"

View File

@ -0,0 +1,28 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_FUSION_SKIN_FACTORY_H
#define QSK_FUSION_SKIN_FACTORY_H
#include "QskFusionGlobal.h"
#include <QskSkinFactory.h>
class QSK_FUSION_EXPORT QskFusionSkinFactory : public QskSkinFactory
{
Q_OBJECT
#if defined( QSK_FUSION_MAKEDLL )
Q_PLUGIN_METADATA( IID QskSkinFactoryIID FILE "metadata.json" )
Q_INTERFACES( QskSkinFactory )
#endif
public:
QskFusionSkinFactory( QObject* parent = nullptr );
~QskFusionSkinFactory() override;
QStringList skinNames() const override;
QskSkin* createSkin( const QString& skinName ) override;
};
#endif

View File

@ -0,0 +1,8 @@
<RCC>
<qresource prefix="/fusion">
<file>icons/qvg/check_small.qvg</file>
<file>icons/qvg/combo-box-arrow-closed.qvg</file>
<file>icons/qvg/combo-box-arrow-open.qvg</file>
<file>icons/qvg/segmented-button-check.qvg</file>
</qresource>
</RCC>

View File

@ -0,0 +1,4 @@
<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 9.4L0 5.4L1.4 4L4 6.6L10.6 0L12 1.4L4 9.4Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 175 B

View File

@ -0,0 +1,4 @@
<svg width="8" height="5" viewBox="0 0 8 5" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.25 0.5L4 4.25L7.75 0.5H0.25Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 157 B

View File

@ -0,0 +1,4 @@
<svg width="8" height="5" viewBox="0 0 8 5" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.25 0.5L4 4.25L7.75 0.5H0.25Z" transform="rotate(180 4 2.5)" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

View File

@ -0,0 +1,4 @@
<svg width="14" height="11" viewBox="0 0 14 11" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.24914 8.12738L1.12164 4.99988L0.0566406 6.05738L4.24914 10.2499L13.2491 1.24988L12.1916 0.192383L4.24914 8.12738Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 246 B

View File

@ -0,0 +1,5 @@
{
"FactoryId": "FusionFactory",
"Skins": [ { "Name": "Fusion Light", "Scheme": "Light" },
{ "Name": "Fusion Dark", "Scheme": "Dark" } ]
}

View File

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

View File

@ -49,9 +49,12 @@ static bool pluginPath = initPluginPath();
#if defined( ENSURE_SKINS )
#if 0
#include <squiek/QskSquiekSkinFactory.h>
#endif
#include <material3/QskMaterial3SkinFactory.h>
#include <fluent2/QskFluent2SkinFactory.h>
#include <fusion/QskFusionSkinFactory.h>
static void initSkins()
{
@ -64,9 +67,12 @@ static bool pluginPath = initPluginPath();
we manually add them here.
*/
#if 0
qskSkinManager->registerFactory( "SquiekFactory", new QskSquiekSkinFactory() );
#endif
qskSkinManager->registerFactory( "Material3Factory", new QskMaterial3SkinFactory() );
qskSkinManager->registerFactory( "Fluent2Factory", new QskFluent2SkinFactory() );
qskSkinManager->registerFactory( "FusionFactory", new QskFusionSkinFactory() );
qWarning() << "Couldn't find skin plugins, adding some manually.";