Merge branch 'master' into features/menubutton

This commit is contained in:
Uwe Rathmann 2024-01-30 17:18:55 +01:00
commit 0408c70442
117 changed files with 2774 additions and 2741 deletions

View File

@ -104,7 +104,7 @@ qsk_setup_build()
qsk_setup_install()
add_subdirectory(src)
add_subdirectory(skins)
add_subdirectory(designsystems)
include(CMakePackageConfigHelpers)

View File

@ -47,10 +47,16 @@ function(qsk_add_plugin target TYPE CLASS_NAME)
# So for the moment better don't do:
# qt6_add_plugin(${target} SHARED ${CLASS_NAME} )
if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qt6_add_library(${target} SHARED )
if(BUILD_QSKDLL)
set(library_type SHARED)
else()
add_library(${target} SHARED )
set(library_type STATIC)
endif()
if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qt6_add_library(${target} ${library_type})
else()
add_library(${target} ${library_type})
endif()
set_target_properties(${target} PROPERTIES
@ -118,4 +124,10 @@ function(qsk_add_shaders target)
qt6_add_shaders( ${target} "qskshaders" BATCHABLE PRECOMPILE QUIET
PREFIX "/qskinny/shaders" ${ARGV} OUTPUTS ${outfiles} )
# pass on OUTPUT_TARGETS to the caller of this function
cmake_parse_arguments(PARSE_ARGV 1 arg "" "OUTPUT_TARGETS" "")
if (arg_OUTPUT_TARGETS)
set(${arg_OUTPUT_TARGETS} ${${arg_OUTPUT_TARGETS}} PARENT_SCOPE)
endif()
endfunction()

View File

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

View File

@ -1965,6 +1965,47 @@ QskFluent2Skin::~QskFluent2Skin()
{
}
void QskFluent2Skin::initHints()
{
struct
{
QskFluent2Theme::BaseColors baseColors;
QskFluent2Theme::AccentColors accentColors;
} colors[2];
if( colorScheme() != QskSkin::DarkScheme )
{
colors[0].baseColors = { rgbGray( 243 ), rgbGray( 249 ), rgbGray( 238 ) };
colors[0].accentColors = { 0xff0078d4, 0xff005eb7, 0xff003d92, 0xff001968 };
colors[1].baseColors = { rgbGray( 249 ), rgbGray( 249 ), rgbGray( 238 ) };
colors[1].accentColors = colors[0].accentColors;
}
else
{
colors[0].baseColors = { rgbGray( 32 ), rgbGray( 40 ), rgbGray( 28 ) };
colors[0].accentColors = { 0xff0078d4, 0xff0093f9, 0xff60ccfe, 0xff98ecfe };
colors[1].baseColors = { rgbGray( 40 ), rgbGray( 44 ), rgbGray( 28 ) };
colors[1].accentColors = colors[0].accentColors;
}
setupFonts();
Editor editor( &hintTable() );
editor.setupMetrics();
const QskFluent2Theme themeBody( colorScheme(),
colors[0].baseColors, colors[0].accentColors );
const QskFluent2Theme themeHeader( colorScheme(),
colors[1].baseColors, colors[1].accentColors );
addTheme( QskAspect::Body, themeBody );
addTheme( QskAspect::Header, themeHeader );
addTheme( QskAspect::Footer, themeHeader );
}
void QskFluent2Skin::setupFonts()
{
static QString fontName( QStringLiteral( "Segoe UI Variable" ) );

View File

@ -21,9 +21,6 @@ class QSK_FLUENT2_EXPORT QskFluent2Skin : public QskSkin
QskFluent2Skin( QObject* parent = nullptr );
~QskFluent2Skin() override;
void addTheme( QskAspect::Section, const QskFluent2Theme& );
void setup();
enum GraphicRole
{
GraphicRoleFillColorTextDisabled,
@ -49,7 +46,12 @@ class QSK_FLUENT2_EXPORT QskFluent2Skin : public QskSkin
static constexpr QskAspect::Variation Standard = QskAspect::NoVariation;
static constexpr QskAspect::Variation Accent = QskAspect::Large;
protected:
void initHints() override;
private:
void addTheme( QskAspect::Section, const QskFluent2Theme& );
void setupFonts();
void setupGraphicFilters( const QskFluent2Theme& );
void setGraphicColor( GraphicRole, QRgb );

View File

@ -0,0 +1,33 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "QskFluent2SkinFactory.h"
#include "QskFluent2Skin.h"
static const QString name = QStringLiteral( "Fluent2" );
QskFluent2SkinFactory::QskFluent2SkinFactory( QObject* parent )
: QskSkinFactory( parent )
{
}
QskFluent2SkinFactory::~QskFluent2SkinFactory()
{
}
QStringList QskFluent2SkinFactory::skinNames() const
{
return { name };
}
QskSkin* QskFluent2SkinFactory::createSkin( const QString& skinName )
{
if ( QString::compare( skinName, name, Qt::CaseInsensitive ) == 0 )
return new QskFluent2Skin();
return nullptr;
}
#include "moc_QskFluent2SkinFactory.cpp"

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" ]
}

View File

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

View File

@ -3,23 +3,23 @@
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_SQUIEK_GLOBAL_H
#define QSK_SQUIEK_GLOBAL_H
#ifndef QSK_FUSION_GLOBAL_H
#define QSK_FUSION_GLOBAL_H
#include "QskGlobal.h"
#ifdef QSK_DLL
#if defined( QSK_SQUIEK_MAKEDLL ) // create a DLL library
#define QSK_SQUIEK_EXPORT Q_DECL_EXPORT
#else // use a DLL library
#define QSK_SQUIEK_EXPORT Q_DECL_IMPORT
#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_SQUIEK_EXPORT
#define QSK_SQUIEK_EXPORT
#ifndef QSK_FUSION_EXPORT
#define QSK_FUSION_EXPORT
#endif
#endif

View File

@ -0,0 +1,181 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "QskFusionPalette.h"
#include <QskRgbValue.h>
#if 0
extern QPalette qt_fusionPalette();
#endif
namespace
{
inline constexpr QRgb rgbGray( int value )
{
return qRgb( value, value, value );
}
}
QskFusionPalette::QskFusionPalette( QskSkin::ColorScheme colorScheme )
{
using namespace QskRgb;
using P = QPalette;
struct
{
QRgb base, background, text, disabledText, light, midLight, mid, dark,
darkDisabled, highlight, disabledHighlight, shadow, disabledShadow,
hightlightedText, link;
} colors;
if ( colorScheme == QskSkin::DarkScheme )
{
colors.base = rgbGray( 36 );
colors.background = rgbGray( 50 );
colors.text = rgbGray( 240 );
colors.disabledText = rgbGray( 130 );
colors.light = rgbGray( 75 );
colors.midLight = rgbGray( 42 );
colors.mid = rgbGray( 38 );
colors.dark = rgbGray( 33 );
colors.darkDisabled = rgbGray( 190 );
colors.highlight = qRgb( 48, 140, 198 );
colors.disabledHighlight = rgbGray( 145 );
colors.shadow = rgbGray( 25 );
colors.disabledShadow = rgbGray( 36 );
colors.hightlightedText = colors.text;
colors.link = colors.highlight;
}
else
{
colors.base = White;
colors.background = rgbGray( 239 );
colors.text = Black;
colors.disabledText = rgbGray( 190 );
colors.light = White;
colors.midLight = rgbGray( 202 );
colors.mid = rgbGray( 184 );
colors.dark = rgbGray( 159 );
colors.darkDisabled = rgbGray( 190 );
colors.highlight = qRgb( 48, 140, 198 );
colors.disabledHighlight = rgbGray( 145 );
colors.shadow = rgbGray( 118 );
colors.disabledShadow = rgbGray( 177 );
colors.hightlightedText = White;
colors.link = Blue;
}
setColor( P::WindowText, colors.text );
setColor( P::Button, colors.background );
setColor( P::Light, colors.light );
setColor( P::Midlight, colors.midLight );
setColor( P::Dark, colors.dark );
setColor( P::Mid, colors.mid );
setColor( P::Text, colors.text );
setColor( P::BrightText, colors.light );
setColor( P::ButtonText, colors.text );
setColor( P::Base, colors.base );
setColor( P::Window, colors.background );
setColor( P::Shadow, colors.shadow );
setColor( P::AlternateBase, interpolated( colors.base, colors.background, 0.5 ) );
setColor( P::Highlight, colors.highlight );
setColor( P::HighlightedText, colors.hightlightedText );
setColor( P::Link, colors.link);
setColor( P::LinkVisited, Magenta );
setColor( P::ToolTipBase, qRgb( 255, 255, 220 ) );
setColor( P::ToolTipText, Black );
setColor( P::PlaceholderText, toTransparent( colors.text, 128 ) );
// disabled colors
setColor( P::Disabled, P::Text, colors.disabledText );
setColor( P::Disabled, P::WindowText, colors.disabledText );
setColor( P::Disabled, P::ButtonText, colors.disabledText );
setColor( P::Disabled, P::Base, colors.background );
setColor( P::Disabled, P::Dark, colors.darkDisabled );
setColor( P::Disabled, P::Shadow, colors.disabledShadow );
setColor( P::Disabled, P::Highlight, colors.disabledHighlight );
#if QT_VERSION >= QT_VERSION_CHECK( 6, 6, 0 )
setColor( P::Active, P::Accent, active( P::Highlight ) );
setColor( P::Disabled, P::Accent, disabled( P::Highlight ) );
#endif
initExtraColors();
}
QskFusionPalette::QskFusionPalette( const QPalette& palette )
{
using P = QPalette;
for ( int i = 0; i < 2; i++ )
{
const auto group = static_cast< P::ColorGroup >( i );
for ( int j = 0; j < P::NColorRoles; j++ )
{
const auto role = static_cast< P::ColorRole >( j );
m_colors[ group ][ role ] = palette.color( group, role ).rgba();
}
}
initExtraColors();
}
QskFusionPalette::~QskFusionPalette()
{
}
void QskFusionPalette::initExtraColors()
{
using P = QPalette;
outline = QskRgb::darker( active( P::Window ), 140 );
button = active( P::Button );
{
auto c = QColor::fromRgba( button );
const int val = qGray( button );
c = c.lighter( 100 + qMax( 1, ( 180 - val ) / 6 ) );
c.setHsv(c.hue(), c.saturation() * 0.75, c.value() );
button = c.rgba();
}
{
auto c = QColor::fromRgba( button ).toHsv();
c.setHsv( c.hue(), qMin( 255, (int)( c.saturation() ) ),
qMin( 255, (int)( c.value() * 0.9 ) ) );
groove = c.rgba();
}
tabFrame = QskRgb::lighter( button, 104 );
highlightedOutline = active( QPalette::Highlight );
{
highlightedOutline = QskRgb::darker( highlightedOutline, 125 );
auto c = QColor::fromRgba( highlightedOutline );
if ( c.value() > 160 )
{
c.setHsl(c.hue(), c.saturation(), 160 );
highlightedOutline = c.rgba();
}
}
error = QskRgb::DarkRed; // ????
}

View File

@ -0,0 +1,90 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_FUSION_PALETTE_H
#define QSK_FUSION_PALETTE_H
#include "QskSkin.h"
#include "QskFusionGlobal.h"
#include "QskRgbValue.h"
#include <qpalette.h>
class QskFusionPalette
{
public:
QskFusionPalette( QskSkin::ColorScheme = QskSkin::LightScheme );
QskFusionPalette( const QPalette& );
~QskFusionPalette();
QRgb active( QPalette::ColorRole ) const;
QRgb disabled( QPalette::ColorRole ) const;
QRgb color( QPalette::ColorGroup, QPalette::ColorRole ) const;
QRgb lighter( QPalette::ColorGroup, QPalette::ColorRole, int factor ) const;
QRgb darker( QPalette::ColorGroup, QPalette::ColorRole, int factor ) const;
QRgb outline;
QRgb button;
QRgb groove;
QRgb tabFrame;
QRgb highlightedOutline;
QRgb error;
private:
void initExtraColors();
void setColor( QPalette::ColorRole, QRgb );
void setColor( QPalette::ColorGroup, QPalette::ColorRole, QRgb );
QRgb m_colors[ 2 ][ QPalette::NColorRoles ] = { };
};
inline QRgb QskFusionPalette::color(
QPalette::ColorGroup group, QPalette::ColorRole role ) const
{
Q_ASSERT( group >= 0 && group < 2 );
return m_colors[group][role];
}
inline QRgb QskFusionPalette::lighter( QPalette::ColorGroup group,
QPalette::ColorRole role, int factor ) const
{
return QskRgb::lighter( color( group, role ), factor );
}
inline QRgb QskFusionPalette::darker( QPalette::ColorGroup group,
QPalette::ColorRole role, int factor ) const
{
return QskRgb::darker( color( group, role ), factor );
}
inline QRgb QskFusionPalette::active( QPalette::ColorRole role ) const
{
return m_colors[ QPalette::Active ][ role ];
}
inline QRgb QskFusionPalette::disabled( QPalette::ColorRole role ) const
{
return m_colors[ QPalette::Disabled ][ role ];
}
inline void QskFusionPalette::setColor(
QPalette::ColorRole role, QRgb rgb )
{
setColor( QPalette::Active, role, rgb );
setColor( QPalette::Disabled, role, rgb );
}
inline void QskFusionPalette::setColor(
QPalette::ColorGroup group, QPalette::ColorRole role, QRgb rgb )
{
Q_ASSERT( group >= 0 && group < 2 );
m_colors[group][role] = rgb;
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
/******************************************************************************
* 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( QObject* parent = nullptr );
~QskFusionSkin() override;
enum GraphicRole
{
GraphicNormal,
GraphicDisabled,
GraphicHighlighted,
GraphicError
};
protected:
void initHints() override;
private:
void setGraphicColor( GraphicRole, QRgb );
};
#endif

View File

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

View File

@ -3,24 +3,23 @@
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_SQUIEK_SKIN_FACTORY_H
#define QSK_SQUIEK_SKIN_FACTORY_H
#ifndef QSK_FUSION_SKIN_FACTORY_H
#define QSK_FUSION_SKIN_FACTORY_H
#include "QskSquiekGlobal.h"
#include "QskFusionGlobal.h"
#include <QskSkinFactory.h>
class QSK_SQUIEK_EXPORT QskSquiekSkinFactory : public QskSkinFactory
class QSK_FUSION_EXPORT QskFusionSkinFactory : public QskSkinFactory
{
Q_OBJECT
#if defined( QSK_SQUIEK_MAKEDLL )
#if defined( QSK_FUSION_MAKEDLL )
Q_PLUGIN_METADATA( IID QskSkinFactoryIID FILE "metadata.json" )
Q_INTERFACES( QskSkinFactory )
#endif
public:
QskSquiekSkinFactory( QObject* parent = nullptr );
~QskSquiekSkinFactory() override;
QskFusionSkinFactory( QObject* parent = nullptr );
~QskFusionSkinFactory() override;
QStringList skinNames() const override;
QskSkin* createSkin( const QString& skinName ) override;

View File

@ -0,0 +1,4 @@
{
"FactoryId": "FusionFactory",
"Skins": [ "Fusion" ]
}

View File

@ -48,6 +48,7 @@
#include <QskBoxBorderMetrics.h>
#include <QskBoxShapeMetrics.h>
#include <QskMargins.h>
#include <QskHctColor.h>
#include <QskRgbValue.h>
#include <QskNamespace.h>
@ -72,44 +73,50 @@ namespace
class Editor : private QskSkinHintTableEditor
{
Q_GADGET
public:
Editor( QskSkinHintTable* table, const QskMaterial3Theme& palette )
Editor( QskSkinHintTable* table, const QskMaterial3Theme& theme )
: QskSkinHintTableEditor( table )
, m_pal( palette )
, m_pal( theme )
{
}
void setup();
void setup()
{
for ( int i = 0; i < staticMetaObject.methodCount(); i++ )
staticMetaObject.method( i ).invokeOnGadget( this );
}
private:
void setupBox();
void setupCheckBox();
void setupComboBox();
void setupDialogButtonBox();
void setupDrawer();
void setupFocusIndicator();
void setupInputPanel();
void setupVirtualKeyboard();
void setupListView();
void setupMenu();
void setupPageIndicator();
void setupPopup();
void setupProgressBar();
void setupProgressRing();
void setupRadioBox();
void setupPushButton();
void setupScrollView();
void setupSegmentedBar();
void setupSeparator();
void setupSubWindow();
void setupSlider();
void setupSpinBox();
void setupSwitchButton();
void setupTabButton();
void setupTabBar();
void setupTabView();
void setupTextInput();
void setupTextLabel();
Q_INVOKABLE void setupBox();
Q_INVOKABLE void setupCheckBox();
Q_INVOKABLE void setupComboBox();
Q_INVOKABLE void setupDialogButtonBox();
Q_INVOKABLE void setupDrawer();
Q_INVOKABLE void setupFocusIndicator();
Q_INVOKABLE void setupInputPanel();
Q_INVOKABLE void setupVirtualKeyboard();
Q_INVOKABLE void setupListView();
Q_INVOKABLE void setupMenu();
Q_INVOKABLE void setupPageIndicator();
Q_INVOKABLE void setupPopup();
Q_INVOKABLE void setupProgressBar();
Q_INVOKABLE void setupProgressRing();
Q_INVOKABLE void setupRadioBox();
Q_INVOKABLE void setupPushButton();
Q_INVOKABLE void setupScrollView();
Q_INVOKABLE void setupSegmentedBar();
Q_INVOKABLE void setupSeparator();
Q_INVOKABLE void setupSubWindow();
Q_INVOKABLE void setupSlider();
Q_INVOKABLE void setupSpinBox();
Q_INVOKABLE void setupSwitchButton();
Q_INVOKABLE void setupTabButton();
Q_INVOKABLE void setupTabBar();
Q_INVOKABLE void setupTabView();
Q_INVOKABLE void setupTextInput();
Q_INVOKABLE void setupTextLabel();
QskGraphic symbol( const char* name ) const
{
@ -148,38 +155,6 @@ namespace
}
}
void Editor::setup()
{
setupBox();
setupCheckBox();
setupComboBox();
setupDialogButtonBox();
setupDrawer();
setupFocusIndicator();
setupInputPanel();
setupVirtualKeyboard();
setupListView();
setupMenu();
setupPageIndicator();
setupPopup();
setupProgressBar();
setupProgressRing();
setupPushButton();
setupRadioBox();
setupScrollView();
setupSegmentedBar();
setupSeparator();
setupSlider();
setupSpinBox();
setupSubWindow();
setupSwitchButton();
setupTabButton();
setupTabBar();
setupTabView();
setupTextLabel();
setupTextInput();
}
void Editor::setupCheckBox()
{
// skin hints are ordered according to
@ -1264,93 +1239,129 @@ void Editor::setupSubWindow()
}
QskMaterial3Theme::QskMaterial3Theme( QskSkin::ColorScheme colorScheme )
: QskMaterial3Theme( colorScheme,
{ // default Material colors:
0xff6750A4,
0xff625B71,
0xff7D5260,
0xffB3261E,
0xff605D62,
0xff605D66,
} )
: QskMaterial3Theme( colorScheme, BaseColors() )
{
}
QskMaterial3Theme::QskMaterial3Theme( QskSkin::ColorScheme colorScheme,
std::array< QskHctColor, NumPaletteTypes > palettes )
: m_palettes( palettes )
const BaseColors& baseColors )
{
if ( colorScheme == QskSkin::LightScheme )
{
primary = m_palettes[ Primary ].toned( 40 ).rgb();
onPrimary = m_palettes[ Primary ].toned( 100 ).rgb();
primaryContainer = m_palettes[ Primary ].toned( 90 ).rgb();
onPrimaryContainer = m_palettes[ Primary ].toned( 10 ).rgb();
{
const QskHctColor color( baseColors.primary );
secondary = m_palettes[ Secondary ].toned( 40 ).rgb();
onSecondary = m_palettes[ Secondary ].toned( 100 ).rgb();
secondaryContainer = m_palettes[ Secondary ].toned( 90 ).rgb();
onSecondaryContainer = m_palettes[ Secondary ].toned( 10 ).rgb();
primary = color.toned( 40 ).rgb();
onPrimary = color.toned( 100 ).rgb();
primaryContainer = color.toned( 90 ).rgb();
onPrimaryContainer = color.toned( 10 ).rgb();
}
tertiary = m_palettes[ Tertiary ].toned( 40 ).rgb();
onTertiary = m_palettes[ Tertiary ].toned( 100 ).rgb();
tertiaryContainer = m_palettes[ Tertiary ].toned( 90 ).rgb();
onTertiaryContainer = m_palettes[ Tertiary ].toned( 10 ).rgb();
{
const QskHctColor color( baseColors.secondary );
error = m_palettes[ Error ].toned( 40 ).rgb();
onError = m_palettes[ Error ].toned( 100 ).rgb();
errorContainer = m_palettes[ Error ].toned( 90 ).rgb();
onErrorContainer = m_palettes[ Error ].toned( 10 ).rgb();
secondary = color.toned( 40 ).rgb();
onSecondary = color.toned( 100 ).rgb();
secondaryContainer = color.toned( 90 ).rgb();
onSecondaryContainer = color.toned( 10 ).rgb();
}
background = m_palettes[ Neutral ].toned( 99 ).rgb();
onBackground = m_palettes[ Neutral ].toned( 10 ).rgb();
surface = m_palettes[ Neutral ].toned( 99 ).rgb();
onSurface = m_palettes[ Neutral ].toned( 10 ).rgb();
{
const QskHctColor color( baseColors.tertiary );
surfaceVariant = m_palettes[ NeutralVariant ].toned( 90 ).rgb();
onSurfaceVariant = m_palettes[ NeutralVariant ].toned( 30 ).rgb();
outline = m_palettes[ NeutralVariant ].toned( 50 ).rgb();
outlineVariant = m_palettes[ NeutralVariant ].toned( 80 ).rgb();
tertiary = color.toned( 40 ).rgb();
onTertiary = color.toned( 100 ).rgb();
tertiaryContainer = color.toned( 90 ).rgb();
onTertiaryContainer = color.toned( 10 ).rgb();
}
surfaceContainerHighest = m_palettes[ NeutralVariant ].toned( 90 ).rgb();
{
const QskHctColor color( baseColors.error );
error = color.toned( 40 ).rgb();
onError = color.toned( 100 ).rgb();
errorContainer = color.toned( 90 ).rgb();
onErrorContainer = color.toned( 10 ).rgb();
}
{
const QskHctColor color( baseColors.neutral );
background = color.toned( 99 ).rgb();
onBackground = color.toned( 10 ).rgb();
surface = color.toned( 99 ).rgb();
onSurface = color.toned( 10 ).rgb();
shadow = color.toned( 0 ).rgb();
}
{
const QskHctColor color( baseColors.neutralVariant );
surfaceVariant = color.toned( 90 ).rgb();
onSurfaceVariant = color.toned( 30 ).rgb();
outline = color.toned( 50 ).rgb();
outlineVariant = color.toned( 80 ).rgb();
surfaceContainerHighest = color.toned( 90 ).rgb();
}
shadow = m_palettes[ Neutral ].toned( 0 ).rgb();
}
else if ( colorScheme == QskSkin::DarkScheme )
{
primary = m_palettes[ Primary ].toned( 80 ).rgb();
onPrimary = m_palettes[ Primary ].toned( 20 ).rgb();
primaryContainer = m_palettes[ Primary ].toned( 30 ).rgb();
onPrimaryContainer = m_palettes[ Primary ].toned( 90 ).rgb();
{
const QskHctColor color( baseColors.primary );
secondary = m_palettes[ Secondary ].toned( 80 ).rgb();
onSecondary = m_palettes[ Secondary ].toned( 20 ).rgb();
secondaryContainer = m_palettes[ Secondary ].toned( 30 ).rgb();
onSecondaryContainer = m_palettes[ Secondary ].toned( 90 ).rgb();
primary = color.toned( 80 ).rgb();
onPrimary = color.toned( 20 ).rgb();
primaryContainer = color.toned( 30 ).rgb();
onPrimaryContainer = color.toned( 90 ).rgb();
}
tertiary = m_palettes[ Tertiary ].toned( 80 ).rgb();
onTertiary = m_palettes[ Tertiary ].toned( 20 ).rgb();
tertiaryContainer = m_palettes[ Tertiary ].toned( 30 ).rgb();
onTertiaryContainer = m_palettes[ Tertiary ].toned( 90 ).rgb();
{
const QskHctColor color( baseColors.secondary );
error = m_palettes[ Error ].toned( 80 ).rgb();
onError = m_palettes[ Error ].toned( 20 ).rgb();
errorContainer = m_palettes[ Error ].toned( 30 ).rgb();
onErrorContainer = m_palettes[ Error ].toned( 90 ).rgb();
secondary = color.toned( 80 ).rgb();
onSecondary = color.toned( 20 ).rgb();
secondaryContainer = color.toned( 30 ).rgb();
onSecondaryContainer = color.toned( 90 ).rgb();
}
background = m_palettes[ Neutral ].toned( 10 ).rgb();
onBackground = m_palettes[ Neutral ].toned( 90 ).rgb();
surface = m_palettes[ Neutral ].toned( 10 ).rgb();
onSurface = m_palettes[ Neutral ].toned( 80 ).rgb();
{
const QskHctColor color( baseColors.tertiary );
surfaceVariant = m_palettes[ NeutralVariant ].toned( 30 ).rgb();
onSurfaceVariant = m_palettes[ NeutralVariant ].toned( 80 ).rgb();
outline = m_palettes[ NeutralVariant ].toned( 60 ).rgb();
outlineVariant = m_palettes[ NeutralVariant ].toned( 30 ).rgb();
tertiary = color.toned( 80 ).rgb();
onTertiary = color.toned( 20 ).rgb();
tertiaryContainer = color.toned( 30 ).rgb();
onTertiaryContainer = color.toned( 90 ).rgb();
}
surfaceContainerHighest = m_palettes[ NeutralVariant ].toned( 22 ).rgb();
{
const QskHctColor color( baseColors.error );
shadow = m_palettes[ Neutral ].toned( 0 ).rgb();
error = color.toned( 80 ).rgb();
onError = color.toned( 20 ).rgb();
errorContainer = color.toned( 30 ).rgb();
onErrorContainer = color.toned( 90 ).rgb();
}
{
const QskHctColor color( baseColors.neutral );
background = color.toned( 10 ).rgb();
onBackground = color.toned( 90 ).rgb();
surface = color.toned( 10 ).rgb();
onSurface = color.toned( 80 ).rgb();
shadow = color.toned( 0 ).rgb();
}
{
const QskHctColor color( baseColors.neutralVariant );
surfaceVariant = color.toned( 30 ).rgb();
onSurfaceVariant = color.toned( 80 ).rgb();
outline = color.toned( 60 ).rgb();
outlineVariant = color.toned( 30 ).rgb();
surfaceContainerHighest = color.toned( 22 ).rgb();
}
}
primary8 = QskRgb::toTransparentF( primary, 0.08 );
@ -1382,14 +1393,9 @@ QskMaterial3Theme::QskMaterial3Theme( QskSkin::ColorScheme colorScheme,
shapeExtraSmallTop = QskBoxShapeMetrics( 4_dp, 4_dp, 0, 0 );
}
QskMaterial3Skin::QskMaterial3Skin( const QskMaterial3Theme& palette, QObject* parent )
QskMaterial3Skin::QskMaterial3Skin( QObject* parent )
: Inherited( parent )
{
setupFonts();
setupGraphicFilters( palette );
Editor editor( &hintTable(), palette );
editor.setup();
}
QskMaterial3Skin::~QskMaterial3Skin()
@ -1418,16 +1424,28 @@ void QskMaterial3Skin::setGraphicColor( GraphicRole role, QRgb rgb )
setGraphicFilter( role, colorFilter );
}
void QskMaterial3Skin::setupGraphicFilters( const QskMaterial3Theme& palette )
void QskMaterial3Skin::setupGraphicFilters( const QskMaterial3Theme& theme )
{
setGraphicColor( GraphicRoleOnPrimary, palette.onPrimary );
setGraphicColor( GraphicRoleOnSecondaryContainer, palette.onSecondaryContainer );
setGraphicColor( GraphicRoleOnError, palette.onError );
setGraphicColor( GraphicRoleOnSurface, palette.onSurface );
setGraphicColor( GraphicRoleOnSurface38, palette.onSurface38 );
setGraphicColor( GraphicRoleOnSurfaceVariant, palette.onSurfaceVariant );
setGraphicColor( GraphicRolePrimary, palette.primary );
setGraphicColor( GraphicRoleSurface, palette.surface );
setGraphicColor( GraphicRoleOnPrimary, theme.onPrimary );
setGraphicColor( GraphicRoleOnSecondaryContainer, theme.onSecondaryContainer );
setGraphicColor( GraphicRoleOnError, theme.onError );
setGraphicColor( GraphicRoleOnSurface, theme.onSurface );
setGraphicColor( GraphicRoleOnSurface38, theme.onSurface38 );
setGraphicColor( GraphicRoleOnSurfaceVariant, theme.onSurfaceVariant );
setGraphicColor( GraphicRolePrimary, theme.primary );
setGraphicColor( GraphicRoleSurface, theme.surface );
}
void QskMaterial3Skin::initHints()
{
const QskMaterial3Theme theme( colorScheme() );
setupFonts();
setupGraphicFilters( theme );
Editor editor( &hintTable(), theme );
editor.setup();
}
#include "moc_QskMaterial3Skin.cpp"
#include "QskMaterial3Skin.moc"

View File

@ -8,30 +8,30 @@
#include "QskMaterial3Global.h"
#include <QskBoxShapeMetrics.h>
#include <QskHctColor.h>
#include <QskSkin.h>
#include <QskBoxShapeMetrics.h>
#include <QskShadowMetrics.h>
#include <array>
#include <qcolor.h>
class QSK_MATERIAL3_EXPORT QskMaterial3Theme
{
public:
enum PaletteType
class BaseColors
{
Primary,
Secondary,
Tertiary,
Error,
Neutral,
NeutralVariant,
public:
BaseColors() = default;
NumPaletteTypes
QRgb primary = 0xff6750A4;
QRgb secondary = 0xff625B71;
QRgb tertiary = 0xff7D5260;
QRgb error = 0xffB3261E;
QRgb neutral = 0xff605D62;
QRgb neutralVariant = 0xff605D66;
};
QskMaterial3Theme( QskSkin::ColorScheme );
QskMaterial3Theme( QskSkin::ColorScheme, std::array< QskHctColor, NumPaletteTypes > );
QskMaterial3Theme( QskSkin::ColorScheme, const BaseColors& );
QRgb primary;
QRgb primary8; // ### rename to primaryHovered or so?
@ -94,9 +94,6 @@ class QSK_MATERIAL3_EXPORT QskMaterial3Theme
const qreal draggedOpacity = 0.16;
QskBoxShapeMetrics shapeExtraSmallTop;
private:
std::array< QskHctColor, NumPaletteTypes > m_palettes;
};
class QSK_MATERIAL3_EXPORT QskMaterial3Skin : public QskSkin
@ -106,7 +103,7 @@ class QSK_MATERIAL3_EXPORT QskMaterial3Skin : public QskSkin
using Inherited = QskSkin;
public:
QskMaterial3Skin( const QskMaterial3Theme&, QObject* parent = nullptr );
QskMaterial3Skin( QObject* parent = nullptr );
~QskMaterial3Skin() override;
enum GraphicRole
@ -135,9 +132,12 @@ class QSK_MATERIAL3_EXPORT QskMaterial3Skin : public QskSkin
static constexpr QskAspect::Variation Outlined = QskAspect::Small;
static constexpr QskAspect::Variation Text = QskAspect::Tiny;
protected:
void initHints() override;
private:
void setupFonts();
void setupGraphicFilters( const QskMaterial3Theme& palette );
void setupGraphicFilters( const QskMaterial3Theme& );
void setGraphicColor( GraphicRole, QRgb );
};

View File

@ -6,8 +6,7 @@
#include "QskMaterial3SkinFactory.h"
#include "QskMaterial3Skin.h"
static const QString materialLightSkinName = QStringLiteral( "Material3 Light" );
static const QString materialDarkSkinName = QStringLiteral( "Material3 Dark" );
static const QString name = QStringLiteral( "Material3" );
QskMaterial3SkinFactory::QskMaterial3SkinFactory( QObject* parent )
: QskSkinFactory( parent )
@ -20,21 +19,13 @@ QskMaterial3SkinFactory::~QskMaterial3SkinFactory()
QStringList QskMaterial3SkinFactory::skinNames() const
{
return { materialLightSkinName, materialDarkSkinName };
return { name };
}
QskSkin* QskMaterial3SkinFactory::createSkin( const QString& skinName )
{
if ( QString::compare( skinName, materialLightSkinName, Qt::CaseInsensitive ) == 0 )
{
QskMaterial3Theme theme( QskSkin::LightScheme );
return new QskMaterial3Skin( theme );
}
else if ( QString::compare( skinName, materialDarkSkinName, Qt::CaseInsensitive ) == 0 )
{
QskMaterial3Theme theme( QskSkin::DarkScheme );
return new QskMaterial3Skin( theme );
}
if ( QString::compare( skinName, name, Qt::CaseInsensitive ) == 0 )
return new QskMaterial3Skin();
return nullptr;
}

View File

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 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

@ -0,0 +1,4 @@
{
"FactoryId": "Material3Factory",
"Skins": [ "Material3" ]
}

View File

@ -24,6 +24,7 @@
#include <QskTextLabel.h>
#include <QskSwitchButton.h>
#include <QskPushButton.h>
#include <QskPageIndicator.h>
#include <QskScrollArea.h>
#include <QskMenuButton.h>
#include <QskWindow.h>
@ -150,9 +151,9 @@ namespace
const auto names = qskSkinManager->skinNames();
if ( ( index >= 0 ) && ( index < names.size() )
&& ( index != names.indexOf( qskSetup->skinName() ) ) )
&& ( index != names.indexOf( qskSkinManager->skinName() ) ) )
{
Skinny::setSkin( index, 500 );
qskSkinManager->setSkin( names[index] );
}
}
};
@ -186,7 +187,7 @@ namespace
Q_OBJECT
public:
Header( QQuickItem* parent = nullptr )
Header( int tabCount, QQuickItem* parent = nullptr )
: QskLinearBox( Qt::Horizontal, parent )
{
setPaddingHint( QskBox::Panel, 5 );
@ -197,6 +198,9 @@ namespace
new FileButton( "File", this );
new SkinButton( "Skin", this );
addStretch( 10 );
m_pageIndicator = new QskPageIndicator( tabCount, this );
m_pageIndicator->setCurrentIndex( 0 );
addStretch( 10 );
{
@ -218,9 +222,18 @@ namespace
}
}
public Q_SLOTS:
void setCurrentTab( int index )
{
m_pageIndicator->setCurrentIndex( index );
}
Q_SIGNALS:
void enabledToggled( bool );
void drawerRequested();
private:
QskPageIndicator* m_pageIndicator;
};
class MainView : public QskMainView
@ -229,20 +242,23 @@ namespace
MainView( QQuickItem* parent = nullptr )
: QskMainView( parent )
{
auto header = new Header( this );
auto tabView = new TabView( this );
tabView->addPage( "Buttons", new ButtonPage() );
tabView->addPage( "Labels", new LabelPage() );
tabView->addPage( "Inputs", new InputPage() );
tabView->addPage( "Progress\nBars", new ProgressBarPage() );
tabView->addPage( "Indicators", new ProgressBarPage() );
tabView->addPage( "Selectors", new SelectorPage() );
tabView->addPage( "Dialogs", new DialogPage() );
tabView->addPage( "ListBox", new ListBoxPage() );
auto header = new Header( tabView->count(), this );
connect( header, &Header::enabledToggled,
tabView, &TabView::setPagesEnabled );
connect( tabView, &TabView::currentIndexChanged,
header, &Header::setCurrentTab );
auto drawer = new Drawer( tabView );
drawer->setEdge( Qt::RightEdge );

View File

@ -57,23 +57,27 @@ namespace
}
}
Skin::Skin( const Palette& palette, QObject* parent )
Skin::Skin( QObject* parent )
: QskSkin( parent )
{
setObjectName( "iot" );
declareSkinlet< CircularProgressBar, CircularProgressBarSkinlet >();
declareSkinlet< Diagram, DiagramSkinlet >();
declareSkinlet< LightDisplay, LightDisplaySkinlet >();
declareSkinlet< StorageBar, StorageBarSkinlet >();
initHints( palette );
setColorScheme( LightScheme );
}
Skin::~Skin()
{
}
void Skin::initHints( const Palette& palette )
void Skin::initHints()
{
const auto palette = Skin::palette( colorScheme() );
QFontDatabase db;
db.addApplicationFont( ":/fonts/ProximaNova-Regular.otf" ); // ### use fontconfig
@ -311,39 +315,41 @@ void Skin::initHints( const Palette& palette )
}
}
Skin::Palette DaytimeSkin::palette() const
Skin::Palette Skin::palette( QskSkin::ColorScheme colorScheme ) const
{
return {
0xff6d7bfb,
0xfffbfbfb,
Qt::white,
0xfff7f7f7,
0xffe5e5e5,
0xfff4f4f4,
Qt::black,
0xffe5e5e5,
0xffc4c4c4,
{ { { 0.0, 0xffff3122 }, { 0.2, 0xfffeeeb7 }, { 0.3, 0xffa7b0ff }, { 0.5, 0xff6776ff },
{ 1.0, Qt::black } } },
0x10000000,
0xffdddddd
};
}
Skin::Palette NighttimeSkin::palette() const
{
return {
0xff2937A7,
0xff040404,
Qt::black,
0xff0a0a0a,
0xff1a1a1a,
0xff0c0c0c,
Qt::white,
0xff4a4a4a,
0xff555555,
{ { { 0.0, 0xff991100 }, { 0.2, 0xff9a7a57 }, { 0.5, 0xff3726af }, { 1.0, Qt::black } } },
0x10ffffff,
0xff222222
};
if ( colorScheme == DarkScheme )
{
return {
0xff2937A7,
0xff040404,
Qt::black,
0xff0a0a0a,
0xff1a1a1a,
0xff0c0c0c,
Qt::white,
0xff4a4a4a,
0xff555555,
{ { { 0.0, 0xff991100 }, { 0.2, 0xff9a7a57 }, { 0.5, 0xff3726af }, { 1.0, Qt::black } } },
0x10ffffff,
0xff222222
};
}
else
{
return {
0xff6d7bfb,
0xfffbfbfb,
Qt::white,
0xfff7f7f7,
0xffe5e5e5,
0xfff4f4f4,
Qt::black,
0xffe5e5e5,
0xffc4c4c4,
{ { { 0.0, 0xffff3122 }, { 0.2, 0xfffeeeb7 }, { 0.3, 0xffa7b0ff }, { 0.5, 0xff6776ff },
{ 1.0, Qt::black } } },
0x10000000,
0xffdddddd
};
}
}

View File

@ -27,7 +27,7 @@ class Skin : public QskSkin
QRgb deviceGraphic;
};
Skin( const Palette& palette, QObject* parent = nullptr );
Skin( QObject* parent = nullptr );
~Skin() override;
enum SkinFontRole
@ -36,29 +36,8 @@ class Skin : public QskSkin
};
private:
void initHints( const Palette& palette );
};
class DaytimeSkin : public Skin
{
public:
DaytimeSkin( QObject* parent = nullptr )
: Skin( palette(), parent )
{
}
private:
Palette palette() const;
};
class NighttimeSkin : public Skin
{
public:
NighttimeSkin( QObject* parent = nullptr )
: Skin( palette(), parent )
{
}
private:
Palette palette() const;
void initHints() override;
Palette palette( ColorScheme ) const;
void initHints( const Palette& );
};

View File

@ -11,50 +11,15 @@
#include <SkinnyShortcut.h>
#endif
#include <QskSkinManager.h>
#include <QskSetup.h>
#include <QskShortcutMap.h>
#include <QskSkinFactory.h>
#include <QskSkinManager.h>
#include <QskWindow.h>
#include <QskObjectCounter.h>
#include <QGuiApplication>
#include <QTimer>
namespace
{
class SkinFactory : public QskSkinFactory
{
Q_OBJECT
public:
SkinFactory( QObject* parent = nullptr )
: QskSkinFactory( parent )
{
}
QStringList skinNames() const override
{
return { "DaytimeSkin", "NighttimeSkin" };
}
QskSkin* createSkin( const QString& skinName ) override
{
if( skinName == "DaytimeSkin" )
{
return new DaytimeSkin;
}
if( skinName == "NighttimeSkin" )
{
return new NighttimeSkin;
}
return nullptr;
}
};
}
int main( int argc, char* argv[] )
{
#ifdef ITEM_STATISTICS
@ -64,24 +29,14 @@ int main( int argc, char* argv[] )
QGuiApplication app( argc, argv );
qskSetup->setItemUpdateFlag( QskQuickItem::PreferRasterForTextures, true );
qskSkinManager->setSkin( new Skin() );
Qsk::addGraphicProvider( QString(), new GraphicProvider() );
// disable default skins
qskSkinManager->setPluginPaths( QStringList() ); // no plugins
qskSkinManager->unregisterFactory( "material3factory" );
qskSkinManager->unregisterFactory( "squiekfactory" );
qskSkinManager->unregisterFactory( "fluent2factory" );
qskSkinManager->registerFactory(
QStringLiteral( "SampleSkinFactory" ), new SkinFactory() );
qskSetup->setSkin( "DaytimeSkin" );
#ifdef USE_SHORTCUTS
// With CTRL-B you can rotate a couple of visual debug modes
SkinnyShortcut::enable( SkinnyShortcut::RotateSkin | SkinnyShortcut::DebugBackground |
SkinnyShortcut::DebugStatistics | SkinnyShortcut::Quit );
SkinnyShortcut::enable( SkinnyShortcut::ChangeColorScheme
| SkinnyShortcut::DebugBackground | SkinnyShortcut::DebugStatistics
| SkinnyShortcut::Quit );
#endif
MainWindow window;
@ -89,16 +44,14 @@ int main( int argc, char* argv[] )
for( int i = 1; i < argc; i++ )
{
if( argv[i] == QStringLiteral("--screenshot") && i + 1 < argc )
{
QTimer::singleShot( 500, &window, [&app, &window, filename = QString(argv[i + 1])]()
{ auto image = window.grabWindow(); image.save(filename); } );
if( argv[i] == QStringLiteral( "--screenshot" ) && i + 1 < argc )
{
QTimer::singleShot( 500, &window, [&app, &window, filename = QString(argv[i + 1])]()
{ auto image = window.grabWindow(); image.save(filename); } );
break;
}
break;
}
}
return app.exec();
}
#include "main.moc"

View File

@ -179,8 +179,8 @@ namespace
{
class SkinBlue : public MySkin
{
public:
SkinBlue()
protected:
void initHints() override
{
using namespace QskRgb;
@ -201,8 +201,8 @@ namespace
class SkinPink : public MySkin
{
public:
SkinPink()
protected:
void initHints() override
{
using namespace QskRgb;

View File

@ -17,8 +17,9 @@
#include <QskSkinManager.h>
#include <QskAnimationHint.h>
#include <QskSkinTransition.h>
#include <QskSetup.h>
#include <QskSkinManager.h>
#include <QskSkin.h>
#include <QskSetup.h>
#include <QGuiApplication>
@ -102,22 +103,14 @@ class Window : public QskWindow
private:
void setAlternativeSkin( bool on )
{
auto oldSkin = qskSetup->skin();
if ( oldSkin->parent() == qskSetup )
oldSkin->setParent( nullptr ); // otherwise setSkin deletes it
auto newSkin = qskSetup->setSkin( alternativeSkin( on ) );
QskSkinTransition transition;
transition.setSourceSkin( qskSkinManager->skin() );
transition.setSourceSkin( oldSkin );
transition.setTargetSkin( newSkin );
transition.setAnimation( QskAnimationHint( 600, QEasingCurve::Linear ) );
transition.process();
if ( oldSkin->parent() == nullptr )
delete oldSkin;
if ( auto skin = qskSkinManager->setSkin( alternativeSkin( on ) ) )
{
transition.setTargetSkin( skin );
transition.run( 600 );
}
}
QString alternativeSkin( bool on ) const

View File

@ -15,9 +15,8 @@
#include <QskLinearBox.h>
#include <QskPushButton.h>
#include <QskRgbValue.h>
#include <QskSetup.h>
#include <QskSkinManager.h>
#include <QskSkin.h>
#include <QskTabView.h>
#include <QskBoxShapeMetrics.h>
#include <QDir>
@ -75,18 +74,7 @@ class GraphicLabel : public QskGraphicLabel
MainWindow::MainWindow()
{
m_tabView = new QskTabView();
m_tabView->setTabBarEdge( Qt::LeftEdge );
const QString resourceDir( ":/qvg" );
const QStringList icons = QDir( resourceDir ).entryList();
for ( const auto& icon : icons )
{
auto title = icon;
m_tabView->addTab( title.replace( ".qvg", "" ),
new GraphicLabel( QskGraphicIO::read( resourceDir + "/" + icon ) ) );
}
auto label = new GraphicLabel( QskGraphicIO::read( QString( ":/qvg/Tux.qvg" ) ) );
auto invertButton = new QskPushButton( "Inverted" );
invertButton->setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
@ -97,34 +85,24 @@ MainWindow::MainWindow()
box->setPanel( true );
box->setPadding( 5 );
box->addItem( invertButton );
box->addItem( m_tabView );
box->addItem( label );
addItem( box );
connect( invertButton, &QskPushButton::toggled,
this, &MainWindow::setDarknessMode );
label, &GraphicLabel::setDarknessMode );
connect( qskSetup, &QskSetup::skinChanged,
connect( qskSkinManager, &QskSkinManager::skinChanged,
this, &MainWindow::setGraphicRoles );
setGraphicRoles( qskSetup->skin() );
}
void MainWindow::setDarknessMode( bool on )
{
for ( int i = 0; i < m_tabView->count(); i++ )
{
auto label = static_cast< GraphicLabel* >( m_tabView->pageAt( i ) );
label->setDarknessMode( on );
}
setGraphicRoles( qskSkinManager->skin() );
}
void MainWindow::setGraphicRoles( QskSkin* skin )
{
// substituting black and white
// substituting black
QskColorFilter colorFilter;
colorFilter.addColorSubstitution( qRgb( 0, 0, 0 ), qRgb( 189, 183, 107 ) );
colorFilter.addColorSubstitution( qRgb( 255, 255, 255 ), qRgb( 50, 50, 50 ) );
colorFilter.addColorSubstitution( QskRgb::Black, QskRgb::DarkKhaki );
skin->setGraphicFilter( GraphicLabel::Inverted, colorFilter );
}

View File

@ -7,7 +7,6 @@
#include <QskWindow.h>
class QskTabView;
class QskSkin;
class MainWindow : public QskWindow
@ -18,9 +17,5 @@ class MainWindow : public QskWindow
MainWindow();
private Q_SLOTS:
void setDarknessMode( bool on );
void setGraphicRoles( QskSkin* );
private:
QskTabView* m_tabView;
};

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +1,8 @@
<!-- after running a SVG cleaner for https://en.m.wikipedia.org/wiki/File:Tux-simple-flat-monochrome.svg -->
<RCC>
<qresource>
<file>qvg/01.01.10.qvg</file>
<file>qvg/01.03.04q.qvg</file>
<file>qvg/01.25.18.qvg</file>
<file>qvg/01.08.05q.qvg</file>
<file>qvg/Tux.qvg</file>
</qresource>
</RCC>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="800px" height="800px" viewBox="-381.075 -382.167 800 800" enable-background="new -381.075 -382.167 800 800"
xml:space="preserve">
<polygon fill="#000000" points="-104.76,16.668 -255.968,129.074 -254.442,154.977 -91.809,34.083 "/>
<path fill="#000000" d="M154.213-63.271h-40.228c-7.579,0-13.687,4.17-13.687,9.321v164.349
c20.155-15.33,42.487-29.809,67.601-43.186V-53.95C167.899-59.101,161.768-63.271,154.213-63.271z"/>
<path opacity="0.5" fill="#000000" d="M-381.001,245.091c0-72.09-0.073-144.167-0.073-216.281
c18.114-1.459,36.069-2.686,53.901-3.643l11.811-252.473l-58.979-73.144c58.979-49.56,460.095-37.75,689.021-54.282l-9.419,47.193
l-21.242,7.089c47.193,92.006,101.45,221.812,120.338,353.948c4.562-0.602,9.517-0.884,14.569-1.055l-0.049,51.571
c-10.253-0.552-20.604-0.933-31.053-0.933c-206.139,0-382.438,117.75-460.132,287.095c-10.78,0-216.587,0.05-308.717,0.074
C-381.05,341.855-381.001,293.485-381.001,245.091z M-235.142,322.479c56.637-4.71,110.894-9.419,165.2-11.774
C14.976,185.658,92.842,55.864,359.517,1.583c-33.04-99.108-68.459-198.228-101.45-297.311
c-167.542-2.367-335.097,28.281-502.627,68.422C-263.448-43.255-265.839,138.44-235.142,322.479z"/>
<path opacity="0.5" fill="#000000" d="M418.827,390.397l-438.939-0.221c74.396-143.492,228.631-242.293,407.936-242.293
c10.449,0,20.751,0.393,31.004,1.03V390.397z"/>
<path fill="#000000" d="M131.205-245.322c-45.845,0-83.029,37.173-83.029,83.042c0,45.856,37.185,83.029,83.029,83.029
c45.868,0,83.054-37.173,83.054-83.029C214.259-208.149,177.073-245.322,131.205-245.322z"/>
<path fill="#000000" d="M-147.514-63.639c-7.494,4.795,10.866,46.923,41,94.104c30.133,47.192,60.647,81.557,68.141,76.774
c7.493-4.783-10.866-46.924-41-94.104C-109.519-34.045-140.02-68.422-147.514-63.639z"/>
<polygon fill="#000000" points="70.466,135.03 -64.546,135.03 -193.368,319.007 -121.887,313.595 -36.839,192.134 15.58,192.134 "/>
<rect x="-102.51" y="-22.796" transform="matrix(0.9659 -0.2588 0.2588 0.9659 0.6694 2.0766)" fill="#000000" width="221.463" height="42.584"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="255.079px" height="123.311px" viewBox="0 0 255.079 123.311" enable-background="new 0 0 255.079 123.311"
fill="#000000" xml:space="preserve">
<path d="M109.102,70.704l6.089-0.338l9.81,4.736h10.826l2.029-1.354c-0.677-3.045-1.354-6.09-1.354-9.472
c0-18.269,15.562-33.153,34.506-33.153c10.488,0,19.621,4.398,25.711,11.164l2.705-1.353c-8.795-9.135-21.313-13.87-27.4-12.855
c-1.354-9.134-5.074-18.268-8.119-24.356l1.354-0.678L165.936,0c-15.563,1.016-42.964,0.338-47.023,3.722l3.721,5.074l-0.676,17.253
c-18.269,1.016-39.243,5.751-56.496,11.841c-3.722,1.353-5.075,3.044-4.398,4.735l3.383,8.119
c4.736-3.721,10.826-6.089,17.591-6.089c14.885,0,27.064,11.502,27.064,25.71C109.102,70.366,109.102,70.366,109.102,70.704
L109.102,70.704z M127.708,8.796c11.501-3.045,23.003-5.074,34.505-4.735c2.029,6.766,4.397,13.531,6.767,20.298
c-18.269,3.721-23.342,12.517-29.433,20.974c-3.721,0.338-7.441,0.677-11.162,1.016C126.017,33.83,126.355,21.313,127.708,8.796
L127.708,8.796z"/>
<path d="M82.038,47.023c13.532,0,24.357,10.487,24.357,23.343c0,12.854-10.826,23.342-24.357,23.342
c-13.531,0-24.357-10.487-24.357-23.342C57.681,57.51,68.506,47.023,82.038,47.023L82.038,47.023z"/>
<path d="M171.01,34.506c17.253,0,31.461,13.194,31.461,29.771c0,16.576-14.208,29.77-31.461,29.77
c-17.254,0-31.124-13.193-31.124-29.77C139.886,47.7,153.756,34.506,171.01,34.506L171.01,34.506z"/>
<rect x="9.643" y="118.065" width="237.82" height="4.06"/>
<path fill="#FFFFFF" d="M4.907,106.902L49.9,66.306c6.089-4.398,14.885-3.045,19.283,2.706c4.736,6.09,3.383,14.885-2.707,19.282
l-51.759,31.801l0,0c-4.06,2.367-8.796,1.69-11.502-1.691C0.847,115.02,1.524,110.285,4.907,106.902L4.907,106.902z"/>
<path d="M3.892,105.548l44.994-40.596l2.368,2.706L6.26,108.254L3.892,105.548z M48.885,64.953L48.885,64.953l1.015,1.354
L48.885,64.953z M48.885,64.953L48.885,64.953l2.368,3.045l0,0L48.885,64.953z M48.885,64.953L48.885,64.953l1.015,1.354
L48.885,64.953z M48.885,64.953c3.383-2.706,7.781-3.721,11.502-3.044l-0.338,3.721c-3.044-0.338-6.089,0.339-8.795,2.368
L48.885,64.953z M60.387,61.908c4.06,0.676,7.781,2.706,10.487,6.089l-3.045,2.368c-2.03-2.707-4.736-4.398-7.781-4.736
L60.387,61.908z M70.875,67.998L70.875,67.998l-3.045,2.368l0,0L70.875,67.998z M67.83,70.366L67.83,70.366l1.354-1.354
L67.83,70.366z M70.875,67.998L70.875,67.998l-3.045,2.368l0,0L70.875,67.998z M70.875,67.998L70.875,67.998l-1.691,1.016
L70.875,67.998z M70.875,67.998c0.676,1.016,1.353,2.03,1.691,3.044l-3.383,1.691c-0.338-1.015-1.015-1.691-1.354-2.367
L70.875,67.998z M72.566,71.042c0.338,1.017,0.677,2.03,1.015,3.385l-3.721,0.677c0-1.017-0.338-1.691-0.676-2.369L72.566,71.042z
M73.581,74.425c1.015,5.752-1.015,11.841-6.089,15.563l-2.03-3.045c3.721-3.045,5.413-7.442,4.397-11.84L73.581,74.425z
M67.492,89.987L67.492,89.987L67.492,89.987l-1.015-1.691L67.492,89.987z M67.492,89.987l-51.759,31.8l-1.691-3.383l51.421-31.8
L67.492,89.987z M15.732,121.787l-1.354,0.677l-1.015-1.354l1.353-1.015L15.732,121.787z M13.364,121.11L13.364,121.11l3.044-2.368
v0.338L13.364,121.11z M14.041,118.404l1.353-1.015l1.015,1.353l-1.691,1.354L14.041,118.404z M15.732,121.787L15.732,121.787
l-1.691-3.383l0,0L15.732,121.787z M15.732,121.787L15.732,121.787l-1.015-1.69L15.732,121.787z M15.732,121.787
c-0.677,0.338-1.354,0.677-2.03,0.677l-1.354-3.384c0.677-0.338,1.015-0.338,1.692-0.676L15.732,121.787z M13.703,122.463
c-0.677,0.339-1.354,0.677-2.03,0.677l-0.677-3.722c0.338,0,1.015-0.339,1.353-0.339L13.703,122.463z M11.673,123.139
c-3.721,0.677-7.442-0.677-9.811-3.722l3.045-2.028c1.354,1.689,3.721,2.366,6.089,2.028L11.673,123.139z M1.862,119.418
L1.862,119.418l1.354-1.015L1.862,119.418z M1.862,119.418L1.862,119.418l3.045-2.028l0,0L1.862,119.418z M4.907,117.389
L4.907,117.389l-1.691,1.015L4.907,117.389z M1.862,119.418c-0.338-0.339-0.676-1.015-1.015-1.69l3.383-1.691
c0.338,0.676,0.338,1.016,0.676,1.354L1.862,119.418z M0.847,117.727c-0.338-0.678-0.676-1.354-0.676-2.03l3.721-0.677
c0,0.339,0.339,0.677,0.339,1.016L0.847,117.727z M0.171,115.697c-0.677-3.383,0.676-7.442,3.721-10.148l2.369,2.706
c-1.692,2.03-2.707,4.397-2.369,6.767L0.171,115.697z M6.598,105.886l1.015,1.354l-1.353,1.015l-1.354-1.353L6.598,105.886z
M3.554,108.254v-0.338l3.044-2.029l0,0L3.554,108.254z M3.554,107.917l-1.015-1.354l1.353-1.016l1.015,1.354L3.554,107.917z"/>
<path d="M10.658,109.608c1.015-1.017,2.707-0.677,3.721,0.677c1.015,1.015,0.677,2.706-0.676,3.721
c-1.015,1.016-2.707,0.678-3.721-0.676C8.966,112.314,9.305,110.623,10.658,109.608L10.658,109.608z"/>
<path d="M56.328,73.072c2.03-1.354,4.736-1.015,6.428,1.015c1.353,2.03,1.015,4.736-1.015,6.091c-2.03,1.69-4.736,1.354-6.089-0.678
C53.96,77.47,54.298,74.763,56.328,73.072L56.328,73.072z"/>
<path fill="#FFFFFF" d="M250.17,106.902l-44.993-40.596c-6.089-4.398-14.886-3.045-19.282,2.706
c-4.736,6.09-3.383,14.885,2.706,19.282l51.76,31.801l0,0c4.06,2.367,8.795,1.69,11.502-1.691
C254.231,115.02,253.554,110.285,250.17,106.902L250.17,106.902z"/>
<path d="M248.818,108.254l-44.993-40.596l2.368-2.706l44.993,40.596L248.818,108.254z M206.193,64.953L206.193,64.953l-1.016,1.354
L206.193,64.953z M203.825,67.998L203.825,67.998l2.368-3.045l0,0L203.825,67.998z M206.193,64.953L206.193,64.953l-1.016,1.354
L206.193,64.953z M203.825,67.998c-2.707-2.029-5.751-2.707-8.796-2.368l-0.338-3.721c3.722-0.677,8.119,0.338,11.502,3.044
L203.825,67.998z M195.029,65.629c-3.045,0.338-5.751,2.029-7.78,4.736l-3.045-2.368c2.707-3.383,6.428-5.413,10.487-6.089
L195.029,65.629z M187.249,70.366L187.249,70.366l-3.045-2.368l0,0L187.249,70.366z M187.249,70.366L187.249,70.366l-1.354-1.354
L187.249,70.366z M187.249,70.366L187.249,70.366l-3.045-2.368l0,0L187.249,70.366z M184.204,67.998L184.204,67.998l1.691,1.016
L184.204,67.998z M187.249,70.366c-0.338,0.676-1.016,1.354-1.354,2.367l-3.383-1.691c0.338-1.014,1.015-2.028,1.691-3.044
L187.249,70.366z M185.895,72.733c-0.338,0.678-0.677,1.354-0.677,2.369l-3.722-0.678c0.338-1.354,0.676-2.367,1.016-3.384
L185.895,72.733z M185.218,75.102c-1.015,4.396,0.677,8.795,4.397,11.84l-2.029,3.045c-5.074-3.722-7.104-9.811-6.09-15.563
L185.218,75.102z M187.586,89.987L187.586,89.987L187.586,89.987l1.015-1.691L187.586,89.987z M189.618,86.604l51.42,31.8
l-1.691,3.383l-51.76-31.8L189.618,86.604z M241.713,121.11l-1.016,1.354l-1.354-0.677l1.016-1.69L241.713,121.11z M238.668,119.08
v-0.338l3.045,2.368l0,0L238.668,119.08z M238.668,118.742l1.016-1.353l1.354,1.015l-0.677,1.691L238.668,118.742z M241.038,118.404
L241.038,118.404l-1.691,3.383l0,0L241.038,118.404z M239.345,121.787L239.345,121.787l1.016-1.69L239.345,121.787z
M241.038,118.404c0.676,0.338,1.016,0.338,1.691,0.676l-1.354,3.384c-0.678,0-1.354-0.339-2.03-0.677L241.038,118.404z
M242.729,119.08c0.338,0,1.016,0.339,1.354,0.339l-0.678,3.722c-0.676,0-1.353-0.338-2.029-0.677L242.729,119.08z M244.083,119.418
c2.367,0.338,4.735-0.339,6.09-2.028l3.043,2.028c-2.366,3.045-6.088,4.397-9.811,3.722L244.083,119.418z M253.215,119.418
L253.215,119.418l-1.354-1.015L253.215,119.418z M250.17,117.389L250.17,117.389l3.045,2.028l0,0L250.17,117.389z M250.17,117.389
L250.17,117.389l1.691,1.015L250.17,117.389z M250.17,117.389c0.338-0.34,0.338-0.679,0.678-1.354l3.383,1.691
c-0.339,0.677-0.677,1.353-1.016,1.69L250.17,117.389z M250.848,116.036c0-0.339,0.338-0.677,0.338-1.016l3.723,0.677
c0,0.677-0.34,1.354-0.678,2.03L250.848,116.036z M251.186,115.02c0.338-2.368-0.678-4.735-2.368-6.767l2.368-2.706
c3.045,2.706,4.396,6.767,3.723,10.148L251.186,115.02z M248.818,108.254l-1.354-1.015l1.017-1.354l1.69,1.016L248.818,108.254z
M248.48,105.886L248.48,105.886l3.044,2.029v0.338L248.48,105.886z M251.186,105.548l1.354,1.016l-1.016,1.354l-1.354-1.015
L251.186,105.548z"/>
<path d="M244.42,109.608c-1.017-1.017-2.707-0.677-3.723,0.677c-1.015,1.015-0.677,2.706,0.678,3.721
c1.015,1.016,2.705,0.678,3.721-0.676C246.111,112.314,245.773,110.623,244.42,109.608L244.42,109.608z"/>
<path d="M198.75,73.072c-2.03-1.354-4.736-1.015-6.429,1.015c-1.354,2.03-1.015,4.736,1.015,6.091
c2.029,1.69,4.736,1.354,6.09-0.678C201.118,77.47,200.78,74.763,198.75,73.072L198.75,73.072z"/>
</svg>

Before

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -1,105 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="283.51px" height="178.51px" viewBox="0 0 283.51 178.51" style="enable-background:new 0 0 283.51 178.51;"
fill="#000000" xml:space="preserve">
<path d="M109.211,59.505c19.63,0,37.113,7.973,49.074,20.854l4.6-2.455c-16.561-17.176-40.177-26.375-51.525-24.844
c-2.452-17.175-9.507-34.045-15.645-46.006l2.765-0.921L99.702,0C69.95,2.149,17.809,0.615,10.143,7.056l7.666,9.508l-1.533,32.818
C10.94,49.662,5.497,50.141,0,50.758v83.054l3.086-0.084l19.019,8.896l20.243-0.307l4.295-2.146
c-1.841-5.83-2.762-11.967-2.762-18.097C43.881,87.415,73.018,59.505,109.211,59.505z M28.238,88.027
c-3.988-23.924-3.682-47.54-1.229-71.464c21.777-5.214,43.555-9.202,65.329-8.894c4.295,12.881,8.896,25.763,13.188,38.645
C70.871,53.37,60.748,70.24,49.707,86.496C42.651,86.802,35.599,87.415,28.238,88.027z M109.211,65.332
c-32.817,0-59.195,25.458-59.195,56.744c0,31.28,26.378,56.435,59.195,56.435c32.816,0,59.195-25.152,59.195-56.435
C168.406,90.79,142.028,65.332,109.211,65.332z"/>
<g>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="98.7395" y1="575.1162" x2="98.7395" y2="612.5811" gradientTransform="matrix(1 0 0 1 102.625 -538.8701)">
<stop offset="0" style="stop-color:#FFFFFF"/>
<stop offset="0.75" style="stop-color:#E8C23D"/>
</linearGradient>
<path style="fill:url(#SVGID_1_);" d="M237.696,36.308l0.347-0.061c6.912,0,12.521,8.374,12.521,18.701
c0,10.33-5.607,18.704-12.521,18.704l-0.283,0.06c-0.05,0-72.562,0-72.604,0l-0.464-0.06c-6.919,0-12.526-8.374-12.526-18.704
c0-10.327,5.607-18.701,12.526-18.701l0.464,0.061c0.038,0,72.542,0,72.579,0"/>
<path style="fill:#F9CB3E;" d="M250.661,56.349c0,10.324-5.604,18.699-12.516,18.699c-6.913,0-12.519-8.375-12.519-18.699
c0-10.332,5.604-18.705,12.519-18.705C245.055,37.644,250.661,46.017,250.661,56.349z"/>
<path style="fill:#000000;" d="M270.238,42.732c-5.452,0.001-10.129,3.292-12.169,7.993c-1.207,0-3.538,0-6.228,0
c-0.618-3.431-1.821-6.535-3.511-9.063c-2.491-3.732-6.164-6.311-10.433-6.316c-0.349,0-0.69,0.024-1.03,0.058
c-7.777,0-65.47,0-71.229,0v-0.058c-4.087,0.003-7.629,2.371-10.105,5.846v-0.228c-8.305,0-15.036,6.731-15.036,15.039
c0,8.305,6.732,15.034,15.036,15.035v-0.347c2.384,3.346,5.752,5.654,9.641,5.831v0.08c0.063,0,72.512,0,72.621-0.004
l-0.001-0.064c0.035,0,0.07,0.004,0.105,0.004c4.269-0.004,7.942-2.583,10.433-6.317c1.658-2.481,2.852-5.52,3.479-8.881h6.287
c2.054,4.667,6.711,7.93,12.14,7.929c7.333,0,13.271-5.94,13.271-13.266C283.509,48.672,277.571,42.734,270.238,42.732z
M144.287,56.003c0.011-5.487,3.936-10.042,9.132-11.039c-1.4,3.199-2.197,6.953-2.202,10.976
c0.005,4.077,0.818,7.88,2.256,11.107C148.248,66.071,144.298,61.506,144.287,56.003z M165.638,72.81v-0.061
c-2.649,0.006-5.237-1.604-7.281-4.636c-2.024-3.014-3.354-7.347-3.352-12.172c-0.003-4.817,1.328-9.153,3.352-12.168
c1.924-2.855,4.331-4.43,6.816-4.604v0.027c0.028,0,45.257,0,64.281,0c-0.726,0.743-1.393,1.57-1.99,2.466
c-2.507,3.758-3.979,8.772-3.984,14.278c0.005,5.51,1.479,10.526,3.984,14.281c0.631,0.945,1.336,1.815,2.107,2.589
C211.717,72.81,170.475,72.81,165.638,72.81z M245.18,68.112c-2.042,3.033-4.631,4.641-7.281,4.637
c-2.649,0.005-5.237-1.605-7.28-4.637c-2.025-3.014-3.354-7.349-3.349-12.172c-0.005-4.817,1.326-9.155,3.349-12.168
c1.831-2.718,4.1-4.282,6.458-4.576c0.423,0,0.66,0,0.662,0v-0.049c0.054-0.001,0.106-0.012,0.16-0.012
c2.65-0.005,5.239,1.605,7.281,4.637c1.26,1.873,2.246,4.259,2.813,6.953c-3.967,0-7.911,0-9.709,0
c-4.271,0-4.034,10.615,0,10.615h1.788h7.876C247.376,63.958,246.41,66.281,245.18,68.112z M270.238,65.479
c-5.231-0.01-9.463-4.246-9.479-9.476c0.015-5.235,4.246-9.47,9.479-9.479c5.234,0.007,9.471,4.244,9.479,9.479
C279.711,61.234,275.472,65.469,270.238,65.479z"/>
</g>
<g>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="67.5588" y1="600.5449" x2="67.5588" y2="638.0107" gradientTransform="matrix(1 0 0 1 102.625 -538.8701)">
<stop offset="0" style="stop-color:#FFFFFF"/>
<stop offset="0.75" style="stop-color:#455BA8"/>
</linearGradient>
<path style="fill:url(#SVGID_2_);" d="M206.517,61.737l0.351-0.061c6.909,0,12.516,8.374,12.516,18.701
c0,10.331-5.604,18.704-12.516,18.704l-0.289,0.061c-0.045,0-72.562,0-72.604,0l-0.463-0.061c-6.92,0-12.527-8.373-12.527-18.704
c0-10.327,5.607-18.701,12.527-18.701l0.463,0.061c0.04,0,72.544,0,72.577,0"/>
<path style="fill:#455BA8;" d="M218.661,80.349c0,10.324-5.604,18.699-12.516,18.699c-6.913,0-12.519-8.375-12.519-18.699
c0-10.332,5.604-18.705,12.519-18.705C213.055,61.644,218.661,70.017,218.661,80.349z"/>
<path style="fill:#000000;" d="M238.476,67.138c-5.395,0-10.023,3.223-12.101,7.843c-1.294,0-3.65,0-6.324,0
c-0.627-3.372-1.819-6.422-3.482-8.912c-2.491-3.735-6.162-6.313-10.422-6.319c-0.349,0-0.69,0.024-1.03,0.058
c-7.765,0-65.463,0-71.245,0V59.75c-4.088,0.005-7.628,2.371-10.106,5.849v-0.227c-8.306,0-15.037,6.732-15.04,15.034
c0.004,8.306,6.734,15.036,15.04,15.036v-0.348c2.384,3.342,5.75,5.653,9.642,5.83v0.079c0.063,0,72.523,0,72.634-0.002
l-0.001-0.065c0.036,0,0.072,0.004,0.108,0.004c4.26-0.004,7.931-2.584,10.422-6.316c1.682-2.52,2.883-5.611,3.504-9.031h6.188
c2.021,4.749,6.728,8.082,12.216,8.083c7.333-0.002,13.267-5.945,13.271-13.267C251.745,73.079,245.809,67.14,238.476,67.138z
M112.518,80.406c0.009-5.485,3.936-10.039,9.13-11.034c-1.401,3.198-2.196,6.952-2.201,10.977
c0.004,4.074,0.817,7.876,2.253,11.102C116.481,90.476,112.527,85.914,112.518,80.406z M133.872,97.213v-0.06
c-2.65,0.008-5.238-1.603-7.283-4.637c-2.026-3.011-3.354-7.352-3.35-12.167c-0.004-4.822,1.323-9.158,3.35-12.17
c1.925-2.858,4.33-4.43,6.816-4.604V63.6c0.028,0,45.284,0,64.307,0c-0.726,0.744-1.393,1.572-1.988,2.469
c-2.514,3.757-3.987,8.773-3.989,14.278c0.002,5.506,1.475,10.522,3.989,14.277c0.629,0.943,1.335,1.814,2.105,2.589
C179.974,97.213,138.711,97.213,133.872,97.213z M213.418,92.513c-2.045,3.038-4.629,4.644-7.271,4.641
c-2.645,0.004-5.229-1.603-7.271-4.641c-2.028-3.007-3.354-7.348-3.354-12.166c0-4.822,1.325-9.156,3.354-12.168
c1.836-2.732,4.111-4.293,6.476-4.579c0.404,0,0.632,0,0.634,0v-0.047c0.055-0.001,0.107-0.012,0.163-0.012
c2.642-0.005,5.226,1.6,7.271,4.638c1.235,1.837,2.205,4.17,2.777,6.802c-3.872,0-7.675,0-9.43,0c-4.271,0-4.035,10.612,0,10.612
h1.785h7.673C215.655,88.275,214.671,90.649,213.418,92.513z M238.476,89.885c-5.231-0.011-9.47-4.247-9.479-9.476
c0.009-5.235,4.246-9.469,9.479-9.479c5.235,0.009,9.469,4.244,9.479,9.479C247.946,85.639,243.712,89.874,238.476,89.885z"/>
</g>
<g>
<path style="fill:#CB5933;" d="M186.764,104.972c0,10.33-5.605,18.705-12.524,18.705c-6.914,0-12.521-8.375-12.521-18.705
c0-10.324,5.604-18.697,12.521-18.697C181.156,86.274,186.764,94.646,186.764,104.972z"/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="35.6541" y1="625.1738" x2="35.6541" y2="662.6396" gradientTransform="matrix(1 0 0 1 102.625 -538.8701)">
<stop offset="0" style="stop-color:#FFFFFF"/>
<stop offset="0.75" style="stop-color:#CB5933"/>
</linearGradient>
<path style="fill:url(#SVGID_3_);" d="M174.611,86.364l0.35-0.06c6.918,0,12.523,8.373,12.523,18.703
c0,10.329-5.605,18.7-12.523,18.7l-0.285,0.063c-0.045,0-72.566,0-72.611,0l-0.463-0.063c-6.921,0-12.527-8.371-12.527-18.7
c0-10.33,5.606-18.703,12.527-18.703l0.463,0.06c0.039,0,72.549,0,72.586,0"/>
<path style="fill:#000000;" d="M206.583,91.767c-5.44,0-10.11,3.277-12.16,7.965c-1.431,0-3.716,0-6.241,0
c-0.62-3.42-1.822-6.514-3.507-9.035c-2.489-3.735-6.164-6.311-10.435-6.313c-0.351,0-0.696,0.024-1.039,0.058
c-7.792,0-65.443,0-71.24,0v-0.058c-4.087,0.002-7.627,2.367-10.105,5.843v-0.227c-8.307,0-15.037,6.729-15.04,15.036
c0.003,8.305,6.733,15.036,15.04,15.034v-0.344c2.383,3.344,5.749,5.65,9.637,5.834v0.076c0.066,0,72.529,0,72.644-0.001
l-0.001-0.067c0.036,0,0.07,0.004,0.106,0.004c4.272-0.006,7.946-2.58,10.435-6.321c1.663-2.485,2.857-5.534,3.484-8.907h6.266
c2.051,4.686,6.721,7.965,12.158,7.965c7.329,0,13.265-5.947,13.269-13.271C219.846,97.704,213.91,91.767,206.583,91.767z
M80.609,105.034c0.009-5.484,3.932-10.038,9.13-11.036c-1.402,3.198-2.198,6.953-2.201,10.974
c0.003,4.079,0.816,7.883,2.252,11.107C84.568,115.104,80.619,110.541,80.609,105.034z M101.961,121.843v-0.062
c-2.65,0.012-5.237-1.599-7.285-4.634c-2.025-3.016-3.354-7.351-3.35-12.174c-0.004-4.817,1.325-9.152,3.35-12.166
c1.927-2.854,4.33-4.427,6.815-4.603v0.023c0.032,0,45.281,0,64.308,0c-0.726,0.744-1.393,1.571-1.989,2.466
c-2.509,3.758-3.981,8.772-3.986,14.275c0.005,5.512,1.478,10.526,3.986,14.277c0.631,0.947,1.337,1.818,2.108,2.594
C148.065,121.843,106.812,121.843,101.961,121.843z M181.521,117.144c-2.046,3.037-4.63,4.642-7.282,4.64
c-2.65,0.004-5.237-1.603-7.279-4.64c-2.026-3.013-3.354-7.348-3.346-12.172c-0.008-4.818,1.32-9.152,3.346-12.166
c1.834-2.725,4.108-4.287,6.474-4.577c0.41,0,0.642,0,0.644,0v-0.048c0.055-0.001,0.108-0.012,0.163-0.012
c2.651-0.004,5.235,1.605,7.282,4.637c1.255,1.867,2.238,4.243,2.808,6.926c-3.73,0-7.336,0-9.031,0c-4.271,0-4.031,10.61,0,10.61
h1.788h7.212C183.725,112.974,182.755,115.308,181.521,117.144z M206.584,114.513c-5.232-0.013-9.472-4.25-9.478-9.479
c0.006-5.233,4.245-9.469,9.478-9.477c5.232,0.008,9.466,4.242,9.478,9.477C216.05,110.265,211.814,114.5,206.584,114.513z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 9.4 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,21 @@
<svg width="218.65" height="253.5" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<g style="display:inline" transform="translate(-.85 -6)">
<path id="u" style="display:inline" d="M106.95 6c-6 0-12.02 1.18-17.46 4.12-5.78 3.11-10.52 8.09-13.43 13.97-2.92 5.88-4.06 12.16-4.24 19.08-.33 13.14.3 20.92 1.29 33.41.26 3.8.74 6.02.25 9.93-1.62 8.3-8.88 13.88-12.76 21.17-4.27 8.04-6.07 17.13-9.29 25.65-2.95 7.79-7.09 15.1-9.88 22.95-2.565 7.195-3.92 14.86-3.842 22.488a7.49 7.49 0 0 1 1.947.101c1.327.244 2.582.821 3.692 1.57 2.228 1.516 3.88 3.719 5.459 5.903a260.186 260.186 0 0 1 4.433 6.295c-2.584-8.692-3.346-17.929-2.459-26.967.91-9.32 3.5-18.44 7.28-27.01 6.746-9.529 7.158-15.985 9.89-25.8 1.53-5.13 4.67-9.61 7.78-13.97 1.79-2.51 3.62-5.1 4.44-8.08.77-2.79.59-5.73.7-8.62.06-1.45.19-2.9.54-4.3.155-.604.374-1.193.62-1.767-.227-.187-.44-.393-.592-.643a2.225 2.225 0 0 1-.195-.478c-.018-.038-.038-.076-.05-.115a1.51 1.51 0 0 1-.06-.426c-.008-.29.058-.57.118-.85.153-.756.238-1.52.484-2.252.306-.918.869-1.743 1.48-2.5a17.699 17.699 0 0 1 1.782-1.87c-.09-.02-.18-.037-.268-.06-1.35-.33-1.811-.78-2.781-1.77-.97-1-1.947-2.367-2.467-3.667-1.04-2.58-1.77-5.572-1.97-8.342-.22-3.07-.441-6.078.529-8.998.49-1.45 1.28-2.602 2.41-3.652a6.553 6.553 0 0 1 4.12-1.764c1.15-.06 2.31.23 3.35.74 1.03.51 1.95 1.079 2.75 1.909 1.66 1.71 2.85 3.544 3.6 5.804.648 1.978.924 4.06 1.02 6.143-.543 1.93-2.09 2.909-3.527 4.623-.85.96-1.823 2.356-2.633 3.346-.4.5-.76 1.029-1.01 1.619a4.318 4.318 0 0 0-.385 1.676 20.357 20.357 0 0 1 6.987-4.776c-.005.017-.005.034-.01.051.345-.142.678-.315 1.031-.437.954-.332 1.938-.59 2.936-.76.498-.085.999-.149 1.502-.188a15.237 15.237 0 0 1 1.51-.04c.602.013 1.203.064 1.798.156a12.84 12.84 0 0 1 1.766.398c.688.212 1.357.483 2.011.785a37.31 37.31 0 0 1 1.934.975l.057.03c1.213.653 2.417 1.33 3.656 1.94.4.2.807.391 1.215.577-.156-.569.125-2.03-.245-2.49-1.719-1.436-3.353-2.47-5.03-3.938-.76-.96-1.094-1.119-1.624-2.229-.423-.884-1.037-1.504-1.414-2.73-.298-1.917-.233-3.632.524-5.738.98-2.74 3-5.643 5.39-7.293.75-.51 1.531-.883 2.371-1.213 1.48-.57 3.1-.74 4.67-.52 1.57.22 3.08.734 4.4 1.594 2.66 1.72 4.54 4.022 5.58 7.012.96 2.75 1.24 5.559 1.08 8.459-.13 2.29-.54 4.58-1.5 6.66-.96 2.07-2.51 3.918-4.53 4.978a8.835 8.835 0 0 1-.823.366c.173.06.352.103.52.177.612.272 1.199.665 1.539 1.243.164.279.26.598.268.925.118.158.225.324.31.502.374.808.356 1.744.203 2.62-.153.875-.433 1.725-.56 2.601-.007.049-.012.1-.018.148.065.06.138.108.201.168 1.46 1.39 2.52 3.132 3.39 4.942.86 1.81 1.54 3.708 2.32 5.558 1.9 4.5 4.39 8.73 6.44 13.18 2.524 13.668 9.193 21.172 14.88 32.47 6.74 13.93 6.68 30.17 4.85 45.53-.14 1.163-.336 2.328-.503 3.494 2.091.296 4.181.605 6.223 1.147 1.76.46 3.48 1.08 5.23 1.56 2.385.641 4.855 1.005 7.309.936.04-.123.09-.242.13-.365 4.01-12.3 4.751-25.551 3.061-38.381-1.69-12.83-5.761-25.27-11.111-37.05-6.72-14.759-12.369-20.1-16.469-33.07-4.42-14.02-.77-24.61-4.06-37.32-1.17-4.32-3.04-8.45-5.45-12.23-2.82-4.43-6.4-8.391-10.65-11.47C124.13 8.62 115.61 6 106.95 6Zm38.816 200.4c-1.674 1.876-3.462 3.66-5.266 5.41-5.48 5.31-11.17 10.56-17.91 14.15-12.89 6.87-29.09 6.86-42.2.41a49.169 49.169 0 0 1-8.173-5.079c.25.325.507.645.752.975 1.949 2.635 3.673 5.486 4.539 8.644 1.128 4.106.687 8.627-1.262 12.408-.202.393-.425.774-.658 1.149 2.614-.64 5.233-1.249 7.861-1.797 13.14-2.69 27.8-1.61 39.99.15 4.13.63 8.231 1.44 12.291 2.43 2.302.557 4.605 1.14 6.91 1.703-.88-2.164-1.12-4.588-1.12-6.953-.01-5.23.96-10.41 1.87-15.57.76-4.29 1.48-8.58 1.95-12.91.184-1.703.32-3.41.426-5.12z"/>
<g style="display:inline">
<path id="v" style="display:inline" d="M71.48 91.84c-1.21 2.3-5.965 5.853-8.355 8.853-12.875 14.606-17.045 29.65-18.327 34.03-1.654 5.69-8.64 18.88-11.429 24.117-1.5 2.81-3.019 5.67-3.539 8.81-.41 2.48-.18 5.04.46 7.47.562 2.17 1.436 4.25 2.435 6.259.791-.905 1.74-1.684 2.85-2.139 1.245-.514 2.643-.615 3.96-.37 1.327.243 2.582.82 3.692 1.57 2.228 1.515 3.88 3.718 5.459 5.902 3.636 5 7.13 10.106 10.306 15.412 2.294 3.848 4.418 7.802 6.963 11.475.2.093.395.198.596.29 2.4 1.09 4.918 2.072 7.558 2.112 1.32.03 2.652-.19 3.862-.72 1.2-.53 2.28-1.381 3-2.491.88-1.36 1.18-3.05 1-4.66-.18-1.61-.81-3.15-1.65-4.53-2.06-3.38-5.31-5.83-8.44-8.25a283.381 283.381 0 0 1-19.55-16.58c-1.76-1.65-3.53-3.34-4.76-5.42-1.2-2.02-1.852-4.32-2.292-6.63-1.21-6.33-.9-12.99 1.25-19.07.85-2.38 1.961-4.65 3.041-6.93 1.86-3.95 3.62-7.98 6.07-11.6 3.05-4.51 7.13-8.33 9.61-13.17 2.1-4.09 2.95-8.68 3.76-13.2.64-3.54 1.85-7 2.47-10.54z"/>
<path id="w" fill="#000000" d="M162.76 127.12c5.24 4.22 8.57 10.59 9.6 17.24.8 5.18.28 10.51-.89 15.62-1.17 5.12-2.97 10.06-4.77 15-.71 1.96-1.43 3.95-1.71 6.02-.29 2.08-.11 4.27.89 6.11 1.15 2.11 3.29 3.56 5.59 4.24 2.27.68 4.72.66 7.02.09 2.3-.57 6.17-1.31 8.04-2.77 4.75-3.69 5.88-10.1 7.01-15.72 1.17-5.87.6-12.02-.43-17.95-1.41-8.09-3.78-15.99-6.79-23.62a82.272 82.272 0 0 0-8.44-15.96c-3.32-4.89-8.02-8.7-11.5-13.48-1.21-1.66-2.66-3.38-3.84-5.06-2.56-3.62-1.98-2.94-3.57-5.29-1.15-1.7-2.97-2.28-4.88-3.02-1.92-.74-4.06-.96-6.04-.41-2.6.73-4.73 2.79-5.86 5.24-1.13 2.46-1.33 5.28-.89 7.95.57 3.44 2.14 6.64 3.92 9.64 2 3.39 4.32 6.66 7.35 9.18 3.16 2.63 6.98 4.37 10.19 6.95z" style="display:inline"/>
</g>
<g style="display:inline">
<path id="x" fill="#000000" d="M34.98 175.33c1.38-.57 2.93-.68 4.39-.41 1.47.27 2.86.91 4.09 1.74 2.47 1.68 4.3 4.12 6.05 6.54 4.03 5.54 7.9 11.2 11.42 17.08 2.85 4.78 5.46 9.71 8.76 14.18 2.15 2.93 4.57 5.64 6.73 8.55 2.16 2.92 4.07 6.08 5.03 9.58 1.25 4.55.76 9.56-1.4 13.75-1.52 2.95-3.86 5.48-6.7 7.19-2.84 1.71-5.83 2.47-9.15 2.47-5.27 0-10.42-2.83-15.32-4.78-9.98-3.98-20.82-5.22-31.11-8.32-3.16-.95-6.27-2.08-9.45-2.95-1.42-.39-2.85-.73-4.19-1.34-1.34-.6-2.59-1.51-3.33-2.77-.57-.98-.8-2.13-.8-3.26 0-1.14.28-2.26.67-3.32.77-2.13 2.02-4.06 2.86-6.17 1.37-3.44 1.62-7.23 1.43-10.93-.18-3.69-.78-7.36-1.03-11.05-.12-1.65-.16-3.32.16-4.95.31-1.62 1.01-3.21 2.2-4.35 1.1-1.06 2.55-1.69 4.05-2 1.49-.31 3.03-.32 4.55-.29 1.52.03 3.05.12 4.57-.01 1.52-.12 3.05-.46 4.37-1.22 1.26-.72 2.29-1.79 3.14-2.96.85-1.17 1.54-2.45 2.25-3.72.7-1.26 1.43-2.52 2.36-3.64.92-1.12 2.06-2.09 3.4-2.64z" style="display:inline;fill:#000;fill-opacity:0;stroke:#000;stroke-width:7;stroke-dasharray:none;stroke-opacity:1" transform="translate(4.008 21.022) scale(.9024)"/>
<path id="y" fill="#000000" d="M213.47 222.92c-2.26 2.68-5.4 4.45-8.53 6.05-5.33 2.71-10.86 5.1-15.87 8.37-3.36 2.19-6.46 4.76-9.36 7.53-2.48 2.37-4.83 4.9-7.61 6.91-2.81 2.03-6.05 3.5-9.48 4.01-.95.14-1.9.21-2.86.21-3.24 0-6.48-.78-9.46-2.08-2.7-1.17-5.3-2.86-6.86-5.36-1.56-2.52-1.92-5.59-1.92-8.56-.01-5.23.96-10.41 1.87-15.57.76-4.29 1.48-8.58 1.95-12.91.85-7.86.84-15.81.28-23.71-.1-1.32-.21-2.65-.01-3.96.2-1.31.74-2.62 1.74-3.48.93-.8 2.17-1.16 3.4-1.22 1.22-.07 2.44.12 3.65.3 2.85.42 5.73.74 8.52 1.48 1.76.46 3.48 1.08 5.23 1.56 2.94.79 6.01 1.17 9.02.82 3.25-.38 6.41-1.6 9.68-1.52 1.34.03 2.67.28 3.95.69 1.3.41 2.59 1 3.55 1.98.73.74 1.24 1.67 1.62 2.64.57 1.44.88 2.98 1.01 4.52.11 1.37.09 2.76.35 4.11.43 2.21 1.6 4.24 3.04 5.97 1.45 1.74 3.18 3.21 4.91 4.66 1.73 1.45 3.46 2.89 5.32 4.16.87.6 1.77 1.16 2.6 1.81.83.66 1.59 1.42 2.11 2.34.45.81.69 1.72.69 2.65 0 .52-.07 1.04-.23 1.56-.45 1.43-1.28 2.82-2.3 4.04z" style="display:inline;fill:#000;fill-opacity:0;stroke:#000;stroke-width:7;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"/>
</g>
<g style="display:inline">
<path id="z" fill="#000000" d="M189.55 178.72c-.35-.95-.97-1.79-1.72-2.47-.75-.68-1.64-1.2-2.57-1.6-1.86-.79-3.89-1.09-5.89-1.46-1.87-.35-3.74-.78-5.62-1.1-1.96-.33-3.98-.55-5.92-.11-1.69.38-3.26 1.26-4.54 2.43-1.28 1.17-2.28 2.63-3 4.21-1.27 2.79-1.67 5.92-1.43 8.97.18 2.27.76 4.61 2.25 6.32 1.21 1.39 2.92 2.26 4.68 2.78 3.04.9 6.35.85 9.36-.13a24.7 24.7 0 0 0 12.35-9.29c.98-1.43 1.82-2.98 2.2-4.66.29-1.28.3-2.66-.15-3.89z"/>
</g>
<g style="display:inline">
<path id="C" fill="#000000" d="M80.75 50.99c-.32 1.94-.33 3.97.33 5.81.44 1.22 1.17 2.33 2.05 3.28.57.62 1.23 1.18 1.99 1.55.77.37 1.65.52 2.48.32.76-.19 1.42-.68 1.91-1.29s.82-1.34 1.05-2.09c.69-2.21.58-4.62-.11-6.83-.49-1.61-1.32-3.16-2.6-4.24-.62-.52-1.34-.93-2.12-1.11-.78-.19-1.63-.14-2.36.19-.81.37-1.44 1.07-1.85 1.86-.41.79-.62 1.67-.77 2.55z"/>
<path id="F" fill="#000000" d="M117.14 45.52c-.9.06-1.78.37-2.55.85-.76.48-1.41 1.13-1.92 1.88-1.03 1.49-1.48 3.31-1.55 5.12-.05 1.35.1 2.72.55 4 .45 1.28 1.2 2.47 2.25 3.33 1.07.89 2.42 1.42 3.81 1.49 1.39.06 2.79-.34 3.93-1.13.91-.63 1.64-1.5 2.16-2.48.52-.97.84-2.05.98-3.15.25-1.93-.03-3.95-.93-5.69-.89-1.74-2.41-3.17-4.24-3.84-.8-.29-1.65-.44-2.49-.38z"/>
<path id="G" d="M101.57 58.446c-2.009-.045-4.039.324-5.946.988a20.297 20.297 0 0 0-8.764 5.991 17.64 17.64 0 0 0-3.765 3.435c-.612.757-1.173 1.58-1.48 2.499-.244.725-.61 2.82-.602 3.103.114 1.236 1.09 1.849 2.057 2.438 4.41 2.787 5.944 7.626 9.69 10.252 1.564 1.105 3.434 1.725 5.338 1.92 2.235.222 4.496-.135 6.655-.773 1.998-.586 3.927-1.41 5.695-2.507 3.374-2.074 6.188-5.117 9.902-6.486 3.254-.8 4.315-1.704 5.348-7.615.171-.646.239-4.15-2.321-5.288-.842-.374-1.752-.552-2.645-.773a37.631 37.631 0 0 1-7.939-2.899c-1.258-.62-2.481-1.308-3.713-1.97-1.275-.68-2.568-1.335-3.945-1.76a13.34 13.34 0 0 0-3.564-.555z" style="display:inline;fill:none;fill-opacity:1;stroke:#000;stroke-width:5.95;stroke-dasharray:none;stroke-opacity:1"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -4,7 +4,7 @@
############################################################################
set(SOURCES
SkinFactory.h SkinFactory.cpp
Skin.h Skin.cpp
Dial.h Dial.cpp
DialSkinlet.h DialSkinlet.cpp
Dashboard.h Dashboard.cpp

70
playground/dials/Skin.cpp Normal file
View File

@ -0,0 +1,70 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "Skin.h"
#include "Dial.h"
#include "DialSkinlet.h"
#include <QskBoxBorderColors.h>
#include <QskTextLabel.h>
#include <QskSkinHintTableEditor.h>
#include <QskRgbValue.h>
#include <QskPlatform.h>
static inline QFont qskFont( qreal pointSize )
{
QFont font( "Roboto" );
font.setPointSizeF( pointSize / qskDpToPixels( 1.0 ) );
return font;
}
Skin::Skin()
{
declareSkinlet< Dial, DialSkinlet >();
initHints();
}
void Skin::initHints()
{
using namespace QskRgb;
setFont( QskSkin::DefaultFont, qskFont( 13 ) );
setFont( QskSkin::LargeFont, qskFont( 20 ) );
const auto rgb1 = qRgb( 1, 16, 27 ); // Maastricht blue
const auto rgb2 = qRgb( 255, 0, 22 ); // Ruddy
const auto rgb3 = qRgb( 41, 234, 212 ); // Turquoise
const auto rgb4 = qRgb( 253, 255, 252 ); // baby powder
QskSkinHintTableEditor ed( &hintTable() );
ed.setColor( QskTextLabel::Text, rgb4 );
{
using Q = Dial;
ed.setBoxBorderMetrics( Q::Panel, 2 );
ed.setBoxShape( Q::Panel, 100, Qt::RelativeSize );
ed.setGradient( Q::Panel, rgb1 );
ed.setBoxBorderColors( Q::Panel, rgb3 );
ed.setBoxBorderMetrics( Q::Knob, 2 );
ed.setStrutSize( Q::Knob, 30, 30 );
ed.setBoxShape( Q::Knob, 100, Qt::RelativeSize );
QskGradient gradient( rgb2, rgb1 );
gradient.setLinearDirection( 0.0, 0.0, 1.0, 1.0 );
ed.setGradient( Q::Knob, gradient );
ed.setMetric( Q::Needle | QskAspect::Size, 2 );
ed.setMetric( Q::Needle | QskAspect::Margin, 10 );
ed.setColor( Q::Needle, rgb2 );
ed.setSpacing( Q::TickLabels, 4 );
ed.setStrutSize( Q::TickLabels, 2, 15 );
ed.setColor( Q::TickLabels, rgb4 );
ed.setFontRole( Q::TickLabels, QskSkin::SmallFont );
}
}

View File

@ -5,13 +5,12 @@
#pragma once
#include <QskSkinFactory.h>
#include <QskSkin.h>
class SkinFactory : public QskSkinFactory
class Skin : public QskSkin
{
Q_OBJECT
public:
QStringList skinNames() const override;
QskSkin* createSkin( const QString& ) override;
Skin();
void initHints() override;
};

View File

@ -1,91 +0,0 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "SkinFactory.h"
#include "Dial.h"
#include "DialSkinlet.h"
#include <QskBoxBorderColors.h>
#include <QskTextLabel.h>
#include <QskSkinHintTableEditor.h>
#include <QskSkin.h>
#include <QskPlatform.h>
#include <QskRgbValue.h>
namespace
{
inline QFont qskFont( qreal pointSize )
{
QFont font( "Roboto" );
font.setPointSizeF( pointSize / qskDpToPixels( 1.0 ) );
return font;
}
class Skin : public QskSkin
{
public:
Skin()
{
using namespace QskRgb;
declareSkinlet< Dial, DialSkinlet >();
setFont( QskSkin::DefaultFont, qskFont( 13 ) );
setFont( QskSkin::LargeFont, qskFont( 20 ) );
const auto rgb1 = qRgb( 1, 16, 27 ); // Maastricht blue
const auto rgb2 = qRgb( 255, 0, 22 ); // Ruddy
const auto rgb3 = qRgb( 41, 234, 212 ); // Turquoise
const auto rgb4 = qRgb( 253, 255, 252 ); // baby powder
QskSkinHintTableEditor ed( &hintTable() );
ed.setColor( QskTextLabel::Text, rgb4 );
{
using Q = Dial;
ed.setBoxBorderMetrics( Q::Panel, 2 );
ed.setBoxShape( Q::Panel, 100, Qt::RelativeSize );
ed.setGradient( Q::Panel, rgb1 );
ed.setBoxBorderColors( Q::Panel, rgb3 );
ed.setBoxBorderMetrics( Q::Knob, 2 );
ed.setStrutSize( Q::Knob, 30, 30 );
ed.setBoxShape( Q::Knob, 100, Qt::RelativeSize );
QskGradient gradient( rgb2, rgb1 );
gradient.setLinearDirection( 0.0, 0.0, 1.0, 1.0 );
ed.setGradient( Q::Knob, gradient );
ed.setMetric( Q::Needle | QskAspect::Size, 2 );
ed.setMetric( Q::Needle | QskAspect::Margin, 10 );
ed.setColor( Q::Needle, rgb2 );
ed.setSpacing( Q::TickLabels, 4 );
ed.setStrutSize( Q::TickLabels, 2, 15 );
ed.setColor( Q::TickLabels, rgb4 );
ed.setFontRole( Q::TickLabels, QskSkin::SmallFont );
}
}
};
}
QStringList SkinFactory::skinNames() const
{
return { "Skin" };
}
QskSkin* SkinFactory::createSkin( const QString& skinName )
{
if ( skinName == "Skin" )
return new Skin();
return nullptr;
}
#include "moc_SkinFactory.cpp"

View File

@ -4,7 +4,7 @@
*****************************************************************************/
#include "Dashboard.h"
#include "SkinFactory.h"
#include "Skin.h"
#include <SkinnyShortcut.h>
@ -44,12 +44,11 @@ int main( int argc, char** argv )
QskObjectCounter counter( true );
#endif
qskSkinManager->setPluginPaths( QStringList() ); // no skin plugins
qskSkinManager->registerFactory( QStringLiteral( "sample" ), new SkinFactory() );
QGuiApplication app( argc, argv );
qskSkinManager->setSkin( new Skin() );
SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts );
SkinnyShortcut::enable( SkinnyShortcut::DebugBackground |
SkinnyShortcut::DebugStatistics | SkinnyShortcut::Quit );
Window window;
window.show();

View File

@ -15,7 +15,7 @@
#include <QskTextLabel.h>
#include <QskWindow.h>
#include <QskRgbValue.h>
#include <QskSetup.h>
#include <QskSkinManager.h>
#include <QDoubleValidator>
#include <QFontMetricsF>
@ -208,7 +208,7 @@ int main( int argc, char** argv )
Skinny::init(); // we need a skin
SkinnyShortcut::enable( SkinnyShortcut::Quit | SkinnyShortcut::DebugBackground );
qskSetup->setSkin( "squiek" );
qskSkinManager->setSkin( "fusion" );
QskWindow window;
window.setColor( QskRgb::Wheat );

View File

@ -7,17 +7,20 @@ set(HEADERS
QskQmlGlobal.h
QskShortcutQml.h
QskLayoutQml.h
QskMainQml.h
QskQml.h)
set(SOURCES
QskShortcutQml.cpp
QskLayoutQml.cpp
QskMainQml.cpp
QskQml.cpp)
set(target qskqmlexport)
qsk_add_library(${target} SHARED ${SOURCES} ${HEADERS})
if(BUILD_QSKDLL)
qsk_add_library(${target} SHARED ${SOURCES} ${HEADERS})
else()
qsk_add_library(${target} STATIC ${SOURCES} ${HEADERS})
endif()
target_link_libraries(${target} PRIVATE qskinny)
target_include_directories(${target} PUBLIC

View File

@ -1,69 +0,0 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "QskMainQml.h"
#include <QskSkinManager.h>
#include <QskSkin.h>
static void qskRegisterConverter()
{
QMetaType::registerConverter< int, QskSetupFlagsQml >();
}
Q_CONSTRUCTOR_FUNCTION( qskRegisterConverter )
QskMain::QskMain( QObject* parent )
: QObject( parent )
{
// how to supress warnings about a missing skinListChanged
// as we don't have it ??
connect( setup(), &QskSetup::skinChanged,
this, &QskMain::skinChanged, Qt::QueuedConnection );
connect( setup(), &QskSetup::itemUpdateFlagsChanged,
this, &QskMain::itemUpdateFlagsChanged, Qt::QueuedConnection );
}
QStringList QskMain::skinList() const
{
auto manager = QskSkinManager::instance();
return manager ? manager->skinNames() : QStringList();
}
QQmlListProperty< QObject > QskMain::data()
{
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
using SizeType = qsizetype;
#else
using SizeType = int;
#endif
return QQmlListProperty< QObject >(
this, nullptr,
[]( QQmlListProperty< QObject >* property, QObject* value )
{
auto main = static_cast< QskMain* >( property->object );
main->m_data.append( value );
},
[]( QQmlListProperty< QObject >* property )
{
auto main = static_cast< const QskMain* >( property->object );
return static_cast< SizeType >( main->m_data.count() );
},
[]( QQmlListProperty< QObject >* property, SizeType index )
{
auto main = static_cast< const QskMain* >( property->object );
return main->m_data.at( index );
},
[]( QQmlListProperty< QObject >* property )
{
auto main = static_cast< QskMain* >( property->object );
main->m_data.clear();
}
);
}
#include "moc_QskMainQml.cpp"

View File

@ -1,66 +0,0 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_SETUP_QML_H
#define QSK_SETUP_QML_H
#include "QskQmlGlobal.h"
#include <QskSetup.h>
#include <qobject.h>
#include <qqmllist.h>
class QskSetupFlagsQml : public QskQuickItem::UpdateFlags
{
Q_GADGET
public:
template< typename ... Args >
QskSetupFlagsQml( Args&&... args )
: QskQuickItem::UpdateFlags( std::forward< Args >( args ) ... )
{
}
Q_INVOKABLE int valueOf() const { return int( *this ); }
};
class QskMain : public QObject
{
public:
Q_OBJECT
Q_PRIVATE_PROPERTY( setup(), QString skin READ skinName
WRITE setSkin NOTIFY skinChanged )
Q_PROPERTY( QStringList skinList READ skinList NOTIFY skinListChanged )
Q_PRIVATE_PROPERTY( setup(), QskSetupFlagsQml itemUpdateFlags
READ itemUpdateFlags WRITE setItemUpdateFlags NOTIFY itemUpdateFlagsChanged )
Q_PROPERTY( QQmlListProperty< QObject > data READ data )
Q_CLASSINFO( "DefaultProperty", "data" )
public:
QskMain( QObject* parent = nullptr );
QStringList skinList() const;
QQmlListProperty< QObject > data();
Q_SIGNALS:
void skinListChanged(); // never emitted
void skinChanged();
void inputPanelChanged();
void itemUpdateFlagsChanged();
private:
static inline QskSetup* setup() { return QskSetup::instance(); }
QObjectList m_data;
};
Q_DECLARE_METATYPE( QskSetupFlagsQml )
#endif

View File

@ -8,7 +8,6 @@
#include "QskLayoutQml.h"
#include "QskShortcutQml.h"
#include "QskMainQml.h"
#include <QskAspect.h>
#include <QskBoxBorderMetrics.h>
@ -196,7 +195,6 @@ void QskQml::registerTypes()
qmlRegisterUncreatableType< QskSkin >( QSK_MODULE_NAME, 1, 0, "Skin", QString() );
qRegisterMetaType< QskSkin* >();
registerObject< QskMain >();
registerObject< QskShortcutQml >( "Shortcut" );
registerObject< QskWindow >();

View File

@ -1,99 +0,0 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "QskFluent2SkinFactory.h"
#include "QskFluent2Skin.h"
#include "QskFluent2Theme.h"
static const QString nameLight = QStringLiteral( "Fluent2 Light" );
static const QString nameDark = QStringLiteral( "Fluent2 Dark" );
namespace
{
inline constexpr QRgb rgbGray( int value )
{
return qRgba( value, value, value, 255 );
}
}
QskFluent2SkinFactory::QskFluent2SkinFactory( QObject* parent )
: QskSkinFactory( parent )
{
}
QskFluent2SkinFactory::~QskFluent2SkinFactory()
{
}
QStringList QskFluent2SkinFactory::skinNames() const
{
return { nameLight, nameDark };
}
QskSkin* QskFluent2SkinFactory::createSkin( const QString& skinName )
{
QskSkin::ColorScheme colorScheme;
if ( QString::compare( skinName, nameLight, Qt::CaseInsensitive ) == 0 )
{
colorScheme = QskSkin::LightScheme;
}
else if ( QString::compare( skinName, nameDark, Qt::CaseInsensitive ) == 0 )
{
colorScheme = QskSkin::DarkScheme;
}
else
{
return nullptr;
}
struct
{
QskSkin::ColorScheme scheme;
QskFluent2Theme::BaseColors baseColors;
QskFluent2Theme::AccentColors accentColors;
QskFluent2Theme theme() const { return { scheme, baseColors, accentColors }; }
} colors[2];
switch( colorScheme )
{
case QskSkin::LightScheme:
{
colors[0].scheme = colorScheme;
colors[0].baseColors = { rgbGray( 243 ), rgbGray( 249 ), rgbGray( 238 ) };
colors[0].accentColors = { 0xff0078d4, 0xff005eb7, 0xff003d92, 0xff001968 };
colors[1].scheme = colorScheme;
colors[1].baseColors = { rgbGray( 249 ), rgbGray( 249 ), rgbGray( 238 ) };
colors[1].accentColors = colors[0].accentColors;
break;
}
case QskSkin::DarkScheme:
{
colors[0].scheme = colorScheme;
colors[0].baseColors = { rgbGray( 32 ), rgbGray( 40 ), rgbGray( 28 ) };
colors[0].accentColors = { 0xff0078d4, 0xff0093f9, 0xff60ccfe, 0xff98ecfe };
colors[1].scheme = colorScheme;
colors[1].baseColors = { rgbGray( 40 ), rgbGray( 44 ), rgbGray( 28 ) };
colors[1].accentColors = colors[0].accentColors;
break;
}
default:;
}
auto skin = new QskFluent2Skin();
skin->addTheme( QskAspect::Body, colors[0].theme() );
skin->addTheme( QskAspect::Header, colors[1].theme() );
skin->addTheme( QskAspect::Footer, colors[1].theme() );
return skin;
}
#include "moc_QskFluent2SkinFactory.cpp"

View File

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

View File

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

View File

@ -1,10 +0,0 @@
############################################################################
# QSkinny - Copyright (C) The authors
# SPDX-License-Identifier: BSD-3-Clause
############################################################################
qsk_add_plugin(squiekskin skins QskSquiekSkinFactory
QskSquiekGlobal.h QskSquiekSkin.h QskSquiekSkin.cpp
QskSquiekSkinFactory.h QskSquiekSkinFactory.cpp
)
set_target_properties(squiekskin PROPERTIES DEFINE_SYMBOL QSK_SQUIEK_MAKEDLL)

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_SQUIEK_SKIN_H
#define QSK_SQUIEK_SKIN_H
#include "QskSquiekGlobal.h"
#include <QskSkin.h>
#include <memory>
class QSK_SQUIEK_EXPORT QskSquiekSkin : public QskSkin
{
Q_OBJECT
using Inherited = QskSkin;
public:
QskSquiekSkin( QObject* parent = nullptr );
~QskSquiekSkin() override;
private:
void resetColors( const QColor& accent ) override;
void addGraphicRole( int role, const QColor& );
class PrivateData;
std::unique_ptr< PrivateData > m_data;
};
#endif

View File

@ -1,33 +0,0 @@
/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "QskSquiekSkinFactory.h"
#include "QskSquiekSkin.h"
static const QString squiekSkinName = QStringLiteral( "Squiek" );
QskSquiekSkinFactory::QskSquiekSkinFactory( QObject* parent )
: QskSkinFactory( parent )
{
}
QskSquiekSkinFactory::~QskSquiekSkinFactory()
{
}
QStringList QskSquiekSkinFactory::skinNames() const
{
return { squiekSkinName };
}
QskSkin* QskSquiekSkinFactory::createSkin( const QString& skinName )
{
if ( QString::compare( skinName, squiekSkinName, Qt::CaseInsensitive ) == 0 )
return new QskSquiekSkin();
return nullptr;
}
#include "moc_QskSquiekSkinFactory.cpp"

View File

@ -1,4 +0,0 @@
{
"FactoryId": "SquiekFactory",
"Skins": [ { "Name": "Squiek", "Scheme": "Unknown" } ]
}

View File

@ -458,6 +458,7 @@ list(APPEND HEADERS
inputpanel/QskInputPanelBox.h
inputpanel/QskInputPredictionBar.h
inputpanel/QskVirtualKeyboard.h
inputpanel/QskVirtualKeyboardLayouts.hpp
)
list(APPEND SOURCES
@ -483,17 +484,14 @@ set(target qskinny)
if(BUILD_QSKDLL)
qsk_add_library(${target} SHARED ${SOURCES} ${HEADERS} ${PRIVATE_HEADERS})
target_compile_definitions(${target} PUBLIC QSK_DLL )
set_target_properties(${target} PROPERTIES DEFINE_SYMBOL QSK_MAKEDLL)
else()
qsk_add_library(${target} STATIC ${SOURCES} ${HEADERS} ${PRIVATE_HEADERS})
endif()
if(BUILD_QSKDLL)
target_compile_definitions(${target} PUBLIC QSK_DLL )
set_target_properties(${target} PROPERTIES DEFINE_SYMBOL QSK_MAKEDLL)
endif()
if (QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qsk_add_shaders( ${target} FILES ${SHADERS} )
qsk_add_shaders( ${target} FILES ${SHADERS} OUTPUT_TARGETS shader_target)
endif()
target_include_directories(${target} PUBLIC
@ -543,8 +541,14 @@ set_target_properties(${target} PROPERTIES
# packaging
set(PACKAGE_NAME ${PROJECT_NAME})
set(exported_targets ${target})
if(NOT BUILD_QSKDLL)
list(APPEND exported_targets ${shader_target})
endif()
# setup destination file paths for qskinny target
install(TARGETS ${target} EXPORT ${PACKAGE_NAME}Targets
install(TARGETS ${exported_targets} EXPORT ${PACKAGE_NAME}Targets
LIBRARY DESTINATION ${QSK_INSTALL_LIBS}
ARCHIVE DESTINATION ${QSK_INSTALL_LIBS}
RUNTIME DESTINATION ${QSK_INSTALL_LIBS}

View File

@ -119,10 +119,6 @@ QskArcMetrics QskArcMetrics::toAbsolute( qreal radius ) const noexcept
QPainterPath QskArcMetrics::painterPath( const QRectF& ellipseRect ) const
{
/*
We might want to have no connecting line between inner and
outer border. F.e. for 360° arcs. TODO ...
*/
const auto sz = qMin( ellipseRect.width(), ellipseRect.height() );
qreal t = m_thickness;
@ -141,31 +137,49 @@ QPainterPath QskArcMetrics::painterPath( const QRectF& ellipseRect ) const
if ( innerRect.isEmpty() )
{
// a pie
path.arcMoveTo( ellipseRect, m_startAngle );
path.arcTo( ellipseRect, m_startAngle, m_spanAngle );
path.lineTo( ellipseRect.center() );
if ( qAbs( m_spanAngle ) >= 360.0 )
{
path.addEllipse( ellipseRect );
}
else
{
// pie
path.arcMoveTo( ellipseRect, m_startAngle );
path.arcTo( ellipseRect, m_startAngle, m_spanAngle );
path.lineTo( ellipseRect.center() );
path.closeSubpath();
}
}
else
{
/*
We need the end point of the inner arc to add the line that connects
the inner/outer arcs. As QPainterPath does not offer such a method
we insert a dummy arcMoveTo and grab the calculated position.
*/
path.arcMoveTo( innerRect, m_startAngle + m_spanAngle );
const auto pos = path.currentPosition();
if ( qAbs( m_spanAngle ) >= 360.0 )
{
path.addEllipse( ellipseRect );
path.arcMoveTo( ellipseRect, m_startAngle ); // replaces the dummy arcMoveTo above
path.arcTo( ellipseRect, m_startAngle, m_spanAngle );
QPainterPath innerPath;
innerPath.addEllipse( innerRect );
path -= innerPath;
}
else
{
/*
We need the end point of the inner arc to add the line that connects
the inner/outer arcs. As QPainterPath does not offer such a method
we insert a dummy arcMoveTo and grab the calculated position.
*/
path.arcMoveTo( innerRect, m_startAngle + m_spanAngle );
const auto pos = path.currentPosition();
path.lineTo( pos );
path.arcTo( innerRect, m_startAngle + m_spanAngle, -m_spanAngle );
path.arcMoveTo( ellipseRect, m_startAngle ); // replaces the dummy arcMoveTo above
path.arcTo( ellipseRect, m_startAngle, m_spanAngle );
path.lineTo( pos );
path.arcTo( innerRect, m_startAngle + m_spanAngle, -m_spanAngle );
path.closeSubpath();
}
}
path.closeSubpath();
return path;
}

View File

@ -7,9 +7,12 @@
#include <qcoreapplication.h>
#include <qobject.h>
#include <qsemaphore.h>
#include <qthread.h>
#if QT_CONFIG(thread)
#include <qsemaphore.h>
#endif
QSK_QT_PRIVATE_BEGIN
#include <private/qobject_p.h>
QSK_QT_PRIVATE_END
@ -204,14 +207,21 @@ void QskMetaFunction::invoke( QObject* object,
return;
}
#if QT_CONFIG(thread)
QSemaphore semaphore;
auto event = new QMetaCallEvent(
m_functionCall, nullptr, 0, argv, &semaphore );
#else
auto event = new QMetaCallEvent(
m_functionCall, nullptr, 0, argv, nullptr );
#endif
QCoreApplication::postEvent( receiver, event );
#if QT_CONFIG(thread)
semaphore.acquire();
#endif
break;
}

View File

@ -9,9 +9,12 @@
#include <qmetaobject.h>
#include <qobject.h>
#include <qcoreapplication.h>
#include <qsemaphore.h>
#include <qthread.h>
#if QT_CONFIG(thread)
#include <qsemaphore.h>
#endif
QSK_QT_PRIVATE_BEGIN
#include <private/qobject_p.h>
QSK_QT_PRIVATE_END
@ -192,14 +195,22 @@ static void qskInvokeMetaCall(
return;
}
#if QT_CONFIG(thread)
QSemaphore semaphore;
auto event = new MetaCallEvent( call, metaObject,
offset, index, args, &semaphore );
#else
auto event = new MetaCallEvent( call, metaObject,
offset, index, args, nullptr );
#endif
QCoreApplication::postEvent( receiver, event );
#if QT_CONFIG(thread)
semaphore.acquire();
#endif
break;
}

View File

@ -8,7 +8,7 @@
#include "QskColorFilter.h"
#include "QskGraphic.h"
#include "QskGraphicProvider.h"
#include "QskSetup.h"
#include "QskSkinManager.h"
#include "QskSkin.h"
QSK_SUBCONTROL( QskGraphicLabel, Panel )
@ -309,7 +309,7 @@ void QskGraphicLabel::changeEvent( QEvent* event )
{
if ( event->type() == QEvent::StyleChange )
{
if ( !m_data->source.isEmpty() && qskSetup->skin()->hasGraphicProvider() )
if ( !m_data->source.isEmpty() && qskSkinManager->skin()->hasGraphicProvider() )
{
// we might need to reload from a different skin
m_data->isSourceDirty = true;

View File

@ -9,7 +9,7 @@
#include "QskBoxShapeMetrics.h"
#include "QskGraphic.h"
#include "QskGraphicProvider.h"
#include "QskSetup.h"
#include "QskSkinManager.h"
#include "QskSkin.h"
#include "QskSkinlet.h"
#include "QskTextOptions.h"
@ -275,7 +275,7 @@ void QskPushButton::changeEvent( QEvent* event )
case QEvent::StyleChange:
{
if ( !m_data->iconSource.isEmpty() &&
qskSetup->skin()->hasGraphicProvider() )
qskSkinManager->skin()->hasGraphicProvider() )
{
// we might need to reload from a different skin
m_data->isIconSourceDirty = true;

View File

@ -8,6 +8,7 @@
#include "QskQuick.h"
#include "QskEvent.h"
#include "QskSetup.h"
#include "QskSkinManager.h"
#include "QskSkin.h"
#include "QskDirtyItemFilter.h"
@ -76,8 +77,11 @@ namespace
We would also need to send QEvent::StyleChange, when
a window has a new skin. TODO ...
*/
QObject::connect( qskSetup, &QskSetup::skinChanged,
qskSetup, [ this ] { updateSkin(); } );
QObject::connect( qskSkinManager, &QskSkinManager::skinChanged,
qskSkinManager, [ this ] { updateSkin(); } );
QObject::connect( qskSkinManager, &QskSkinManager::colorSchemeChanged,
qskSkinManager, [ this ] { updateSkin(); } );
}
inline void insert( QskQuickItem* item )
@ -951,6 +955,19 @@ QSGNode* QskQuickItem::updatePaintNode( QSGNode* node, UpdatePaintNodeData* data
{
delete node;
node = nullptr;
#if 1
/*
controls might find subnodes using qskPaintNode - not good
as d->paintNode is not updated before leaving here. TODO ...
In the initial call we will always have a nullptr - even if
it has already been allocated. When deleting it we have a dangling pointer.
instead of the new one.
To avoid creashes for the second situation we manually clear d->paintNode.
*/
d->paintNode = nullptr;
#endif
d->clearPreviousNodes = false;
}

View File

@ -93,10 +93,12 @@ class QskScrollView::PrivateData
}
else
{
subControls[0] = HorizontalScrollHandle;;
subControls[0] = HorizontalScrollHandle;
subControls[1] = HorizontalScrollBar;
}
const bool wasHovered = hasState( subControls[1], QskScrollView::Hovered );
hoveredSubControl = subControl;
auto oldStates = scrollView->skinStates();
@ -106,7 +108,9 @@ class QskScrollView::PrivateData
qSwap( oldStates, newStates );
scrollView->startHintTransitions( { subControls[0] }, oldStates, newStates );
scrollView->startHintTransitions( { subControls[1] }, oldStates, newStates );
if ( wasHovered != hasState( subControls[1], QskScrollView::Hovered ) )
scrollView->startHintTransitions( { subControls[1] }, oldStates, newStates );
}
bool hasState( QskAspect::Subcontrol subControl, QskAspect::State state ) const
@ -120,6 +124,7 @@ class QskScrollView::PrivateData
if ( subControl == stateSubcontrol )
return true;
// the scroll bar inherits pressed/hovered from the handle
if ( subControl == VerticalScrollBar )
return stateSubcontrol == VerticalScrollHandle;

View File

@ -7,12 +7,11 @@
#include "QskControl.h"
#include "QskControlPrivate.h"
#include "QskGraphicProviderMap.h"
#include "QskSkin.h"
#include "QskSkinManager.h"
#include "QskSkin.h"
#include "QskWindow.h"
#include <qguiapplication.h>
#include <qpointer.h>
#include <qstylehints.h>
QskSetup* QskSetup::s_instance = nullptr;
@ -81,9 +80,6 @@ class QskSetup::PrivateData
{
}
QString skinName;
QPointer< QskSkin > skin;
QskGraphicProviderMap graphicProviders;
QskQuickItem::UpdateFlags itemUpdateFlags;
};
@ -152,53 +148,6 @@ bool QskSetup::testItemUpdateFlag( QskQuickItem::UpdateFlag flag )
return m_data->itemUpdateFlags.testFlag( flag );
}
QskSkin* QskSetup::setSkin( const QString& skinName )
{
if ( m_data->skin && ( skinName == m_data->skinName ) )
return m_data->skin;
auto skin = QskSkinManager::instance()->createSkin( skinName );
if ( skin == nullptr )
return nullptr;
if ( skin->parent() == nullptr )
skin->setParent( this );
const auto oldSkin = m_data->skin;
m_data->skin = skin;
m_data->skinName = skinName;
if ( oldSkin )
{
Q_EMIT skinChanged( skin );
if ( oldSkin->parent() == this )
delete oldSkin;
}
return m_data->skin;
}
QString QskSetup::skinName() const
{
return m_data->skinName;
}
QskSkin* QskSetup::skin()
{
if ( m_data->skin == nullptr )
{
m_data->skin = QskSkinManager::instance()->createSkin( QString() );
Q_ASSERT( m_data->skin );
m_data->skin->setParent( this );
m_data->skinName = m_data->skin->objectName();
}
return m_data->skin;
}
void QskSetup::addGraphicProvider( const QString& providerId, QskGraphicProvider* provider )
{
m_data->graphicProviders.insert( providerId, provider );
@ -206,10 +155,9 @@ void QskSetup::addGraphicProvider( const QString& providerId, QskGraphicProvider
QskGraphicProvider* QskSetup::graphicProvider( const QString& providerId ) const
{
if ( m_data->skin )
if ( auto skin = qskSkinManager->skin() )
{
QskGraphicProvider* provider = m_data->skin->graphicProvider( providerId );
if ( provider )
if ( auto provider = skin->graphicProvider( providerId ) )
return provider;
}
@ -285,10 +233,4 @@ bool QskSetup::eventFilter( QObject* object, QEvent* event )
return false;
}
QskSetup* QskSetup::qmlAttachedProperties( QObject* )
{
return QskSetup::instance();
}
Q_DECLARE_METATYPE( QskSkin* )
#include "moc_QskSetup.cpp"

View File

@ -12,7 +12,6 @@
#include <qobject.h>
#include <memory>
class QskSkin;
class QQuickItem;
class QskGraphicProvider;
@ -38,21 +37,13 @@ class QSK_EXPORT QskSetup : public QObject
void resetItemUpdateFlag( QskQuickItem::UpdateFlag );
bool testItemUpdateFlag( QskQuickItem::UpdateFlag );
QskSkin* setSkin( const QString& );
QString skinName() const;
QskSkin* skin();
void addGraphicProvider( const QString& providerId, QskGraphicProvider* );
QskGraphicProvider* graphicProvider( const QString& providerId ) const;
static void setup();
static void cleanup();
static QskSetup* qmlAttachedProperties( QObject* );
Q_SIGNALS:
void skinChanged( QskSkin* );
void itemUpdateFlagsChanged();
private:

View File

@ -13,6 +13,8 @@
#include "QskSkinHintTable.h"
#include "QskStandardSymbol.h"
#include "QskPlatform.h"
#include "QskSkinManager.h"
#include "QskSkinTransition.h"
#include "QskMargins.h"
@ -21,7 +23,6 @@
#include <qpa/qplatformtheme.h>
#include <cmath>
#include <unordered_map>
#include "QskBox.h"
#include "QskBoxSkinlet.h"
@ -104,6 +105,8 @@
#include "QskStatusIndicator.h"
#include "QskStatusIndicatorSkinlet.h"
#include <qhash.h>
static inline QskSkinlet* qskNewSkinlet( const QMetaObject* metaObject, QskSkin* skin )
{
const QByteArray signature = metaObject->className() + QByteArrayLiteral( "(QskSkin*)" );
@ -137,21 +140,23 @@ namespace
}
const QMetaObject* metaObject;
QskSkinlet* skinlet;
QskSkinlet* skinlet; // mutable ???
};
}
class QskSkin::PrivateData
{
public:
std::unordered_map< const QMetaObject*, SkinletData > skinletMap;
QHash< const QMetaObject*, SkinletData > skinletMap;
QskSkinHintTable hintTable;
std::unordered_map< int, QFont > fonts;
std::unordered_map< int, QskColorFilter > graphicFilters;
QHash< int, QFont > fonts;
QHash< int, QskColorFilter > graphicFilters;
QskGraphicProviderMap graphicProviders;
int colorScheme = -1; // uninitialized
};
QskSkin::QskSkin( QObject* parent )
@ -212,6 +217,42 @@ QskSkin::~QskSkin()
{
}
QskSkin::ColorScheme QskSkin::colorScheme() const
{
if ( m_data->colorScheme < 0 )
return QskSkin::UnknownScheme;
return static_cast< QskSkin::ColorScheme >( m_data->colorScheme );
}
void QskSkin::setColorScheme( ColorScheme colorScheme )
{
if ( colorScheme == m_data->colorScheme )
return;
m_data->colorScheme = colorScheme;
const auto transitionHint = qskSkinManager->transitionHint();
if ( transitionHint.isValid() )
{
QskSkinTransition transition;
transition.setSourceSkin( this );
clearHints();
initHints();
transition.setTargetSkin( this );
transition.run( transitionHint );
}
else
{
clearHints();
initHints();
}
Q_EMIT colorSchemeChanged( colorScheme );
}
void QskSkin::setSkinHint( QskAspect aspect, const QVariant& skinHint )
{
m_data->hintTable.setHint( aspect, skinHint );
@ -229,9 +270,9 @@ void QskSkin::declareSkinlet( const QMetaObject* metaObject,
const auto it = m_data->skinletMap.find( metaObject );
if ( it != m_data->skinletMap.cend() )
if ( it != m_data->skinletMap.end() )
{
auto& entry = it->second;
auto& entry = it.value();
if ( entry.metaObject != skinletMetaObject )
{
entry.metaObject = skinletMetaObject;
@ -242,7 +283,7 @@ void QskSkin::declareSkinlet( const QMetaObject* metaObject,
}
else
{
m_data->skinletMap.emplace( metaObject, skinletMetaObject );
m_data->skinletMap.insert( metaObject, skinletMetaObject );
}
}
@ -276,18 +317,18 @@ void QskSkin::setFont( int fontRole, const QFont& font )
void QskSkin::resetFont( int fontRole )
{
m_data->fonts.erase( fontRole );
m_data->fonts.remove( fontRole );
}
QFont QskSkin::font( int fontRole ) const
{
auto it = m_data->fonts.find( fontRole );
if ( it != m_data->fonts.cend() )
return it->second;
auto it = m_data->fonts.constFind( fontRole );
if ( it != m_data->fonts.constEnd() )
return it.value();
it = m_data->fonts.find( QskSkin::DefaultFont );
if ( it != m_data->fonts.cend() )
return it->second;
it = m_data->fonts.constFind( QskSkin::DefaultFont );
if ( it != m_data->fonts.constEnd() )
return it.value();
return QGuiApplication::font();
}
@ -299,16 +340,12 @@ void QskSkin::setGraphicFilter( int graphicRole, const QskColorFilter& colorFilt
void QskSkin::resetGraphicFilter( int graphicRole )
{
m_data->graphicFilters.erase( graphicRole );
m_data->graphicFilters.remove( graphicRole );
}
QskColorFilter QskSkin::graphicFilter( int graphicRole ) const
{
auto it = m_data->graphicFilters.find( graphicRole );
if ( it != m_data->graphicFilters.cend() )
return it->second;
return QskColorFilter();
return m_data->graphicFilters.value( graphicRole );
}
const QskSkinHintTable& QskSkin::hintTable() const
@ -321,12 +358,12 @@ QskSkinHintTable& QskSkin::hintTable()
return m_data->hintTable;
}
const std::unordered_map< int, QFont >& QskSkin::fonts() const
const QHash< int, QFont >& QskSkin::fonts() const
{
return m_data->fonts;
}
const std::unordered_map< int, QskColorFilter >& QskSkin::graphicFilters() const
const QHash< int, QskColorFilter >& QskSkin::graphicFilters() const
{
return m_data->graphicFilters;
}
@ -347,6 +384,14 @@ bool QskSkin::hasGraphicProvider() const
return m_data->graphicProviders.size() > 0;
}
void QskSkin::clearHints()
{
m_data->hintTable.clear();
m_data->fonts.clear();
m_data->graphicFilters.clear();
m_data->graphicProviders.clear();
}
QString QskSkin::dialogButtonText( int action ) const
{
const auto theme = qskPlatformTheme();
@ -375,9 +420,9 @@ const QMetaObject* QskSkin::skinletMetaObject( const QMetaObject* metaObject ) c
{
while ( metaObject )
{
auto it = m_data->skinletMap.find( metaObject );
if ( it != m_data->skinletMap.cend() )
return it->second.metaObject;
auto it = m_data->skinletMap.constFind( metaObject );
if ( it != m_data->skinletMap.constEnd() )
return it.value().metaObject;
metaObject = metaObject->superClass();
}
@ -390,9 +435,9 @@ QskSkinlet* QskSkin::skinlet( const QMetaObject* metaObject )
while ( metaObject )
{
auto it = m_data->skinletMap.find( metaObject );
if ( it != m_data->skinletMap.cend() )
if ( it != m_data->skinletMap.end() )
{
auto& entry = it->second;
auto& entry = it.value();
if ( entry.skinlet == nullptr )
entry.skinlet = qskNewSkinlet( entry.metaObject, this );
@ -407,8 +452,4 @@ QskSkinlet* QskSkin::skinlet( const QMetaObject* metaObject )
return &defaultSkinlet;
}
void QskSkin::resetColors( const QColor& )
{
}
#include "moc_QskSkin.cpp"

View File

@ -13,7 +13,6 @@
#include <memory>
#include <type_traits>
#include <unordered_map>
class QskSkinnable;
class QskSkinlet;
@ -25,6 +24,7 @@ class QskGraphicProvider;
class QskSkinHintTable;
class QVariant;
template< typename Key, typename T > class QHash;
class QSK_EXPORT QskSkin : public QObject
{
@ -64,8 +64,6 @@ class QSK_EXPORT QskSkin : public QObject
template< typename Control, typename Skinlet >
void declareSkinlet();
virtual void resetColors( const QColor& accent );
void setSkinHint( QskAspect, const QVariant& hint );
const QVariant& skinHint( QskAspect ) const;
@ -93,8 +91,20 @@ class QSK_EXPORT QskSkin : public QObject
const QskSkinHintTable& hintTable() const;
QskSkinHintTable& hintTable();
const std::unordered_map< int, QFont >& fonts() const;
const std::unordered_map< int, QskColorFilter >& graphicFilters() const;
const QHash< int, QFont >& fonts() const;
const QHash< int, QskColorFilter >& graphicFilters() const;
ColorScheme colorScheme() const;
public Q_SLOTS:
void setColorScheme( ColorScheme );
Q_SIGNALS:
void colorSchemeChanged( ColorScheme );
protected:
void clearHints();
virtual void initHints() = 0;
private:
void declareSkinlet( const QMetaObject* metaObject,

View File

@ -11,20 +11,19 @@
const QVariant QskSkinHintTable::invalidHint;
inline const QVariant* qskResolvedHint( QskAspect aspect,
const std::unordered_map< QskAspect, QVariant >& hints,
QskAspect* resolvedAspect )
const QHash< QskAspect, QVariant >& hints, QskAspect* resolvedAspect )
{
auto a = aspect;
Q_FOREVER
{
auto it = hints.find( aspect );
if ( it != hints.cend() )
auto it = hints.constFind( aspect );
if ( it != hints.constEnd() )
{
if ( resolvedAspect )
*resolvedAspect = aspect;
return &it->second;
return &it.value();
}
#if 1
@ -74,17 +73,53 @@ QskSkinHintTable::QskSkinHintTable()
{
}
QskSkinHintTable::QskSkinHintTable( const QskSkinHintTable& other )
: m_animatorCount( other.m_animatorCount )
, m_states( other.m_states )
{
if ( other.m_hints )
{
/*
A previous implementation was using STL containers - however:
according to https://tessil.github.io/2016/08/29/benchmark-hopscotch-map.html
QHash does slightly faster lookups than std::unordered_map in the category
"Random full reads: execution time (integers)", that is the most relevant one
in our use case.
Considering, that the "copy on write" strategy of QHash makes the implementation
of copy/assignment operators much easier ( needed in QskSkinTransition ) we prefer
using the Qt container over the STL counterparts.
*/
m_hints = new QHash< QskAspect, QVariant >( *other.m_hints );
}
}
QskSkinHintTable::~QskSkinHintTable()
{
delete m_hints;
}
const std::unordered_map< QskAspect, QVariant >& QskSkinHintTable::hints() const
QskSkinHintTable& QskSkinHintTable::operator=( const QskSkinHintTable& other )
{
m_animatorCount = ( other.m_animatorCount );
m_states = other.m_states;
delete m_hints;
m_hints = nullptr;
if ( other.m_hints )
m_hints = new QHash< QskAspect, QVariant >( *other.m_hints );
return *this;
}
const QHash< QskAspect, QVariant >& QskSkinHintTable::hints() const
{
if ( m_hints )
return *m_hints;
static std::unordered_map< QskAspect, QVariant > dummyHints;
static QHash< QskAspect, QVariant > dummyHints;
return dummyHints;
}
@ -93,12 +128,12 @@ const std::unordered_map< QskAspect, QVariant >& QskSkinHintTable::hints() const
bool QskSkinHintTable::setHint( QskAspect aspect, const QVariant& skinHint )
{
if ( m_hints == nullptr )
m_hints = new HintMap();
m_hints = new QHash< QskAspect, QVariant >();
auto it = m_hints->find( aspect );
if ( it == m_hints->end() )
{
m_hints->emplace( aspect, skinHint );
m_hints->insert( aspect, skinHint );
if ( aspect.isAnimator() )
{
@ -111,9 +146,9 @@ bool QskSkinHintTable::setHint( QskAspect aspect, const QVariant& skinHint )
return true;
}
if ( it->second != skinHint )
if ( it.value() != skinHint )
{
it->second = skinHint;
it.value() = skinHint;
return true;
}
@ -127,7 +162,7 @@ bool QskSkinHintTable::removeHint( QskAspect aspect )
if ( m_hints == nullptr )
return false;
const bool erased = m_hints->erase( aspect );
const bool erased = m_hints->remove( aspect );
if ( erased )
{
@ -153,7 +188,7 @@ QVariant QskSkinHintTable::takeHint( QskAspect aspect )
auto it = m_hints->find( aspect );
if ( it != m_hints->end() )
{
const auto value = it->second;
const auto value = it.value();
m_hints->erase( it );
if ( aspect.isAnimator() )
@ -214,7 +249,7 @@ QskAspect QskSkinHintTable::resolvedAnimator(
auto it = m_hints->find( aspect );
if ( it != m_hints->cend() )
{
hint = it->second.value< QskAnimationHint >();
hint = it.value().value< QskAnimationHint >();
return aspect;
}

Some files were not shown because too many files have changed in this diff Show More