diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index e24e80472..e31130520 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -78,8 +78,8 @@ const QStringList Branding::s_styleEntryStrings = "sidebarTextHighlight" }; -static const NamedEnumTable& -windowDimensions() +const NamedEnumTable& +Branding::WindowDimension::suffixes() { using Unit = Branding::WindowDimensionUnit; static const NamedEnumTable names{ @@ -323,11 +323,6 @@ Branding::initSimpleSettings( const YAML::Node& doc ) { QStringLiteral( "fullscreen" ), WindowExpansion::Fullscreen }, { QStringLiteral( "noexpand" ), WindowExpansion::Fixed } }; - static const NamedEnumTable< WindowDimensionUnit > dimensionNames{ - { QStringLiteral( "px" ), WindowDimensionUnit::Pixies }, - { QStringLiteral( "em" ), WindowDimensionUnit::Fonties } - }; - bool ok = false; m_welcomeStyleCalamares = doc[ "welcomeStyleCalamares" ].as< bool >( false ); @@ -342,8 +337,8 @@ Branding::initSimpleSettings( const YAML::Node& doc ) auto l = windowSize.split( ',' ); if ( l.count() == 2 ) { - m_windowWidth = WindowDimension( dimensionNames, l[0] ); - m_windowHeight = WindowDimension( dimensionNames, l[1] ); + m_windowWidth = WindowDimension( l[0] ); + m_windowHeight = WindowDimension( l[1] ); } } if ( !m_windowWidth.isValid() ) diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index 5063a1df1..197cb8ee2 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -89,8 +89,11 @@ public: class WindowDimension : public NamedSuffix { public: - using NamedSuffix::NamedSuffix; + static const NamedEnumTable< WindowDimensionUnit >& suffixes(); bool isValid() const; + + using NamedSuffix::NamedSuffix; + WindowDimension( const QString& s ) : NamedSuffix( suffixes(), s ) {} } ; static Branding* instance();