From e5d4c02b4a48ffb305e5a826b7bfd8c595015558 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 19 Mar 2015 17:59:14 +0100 Subject: [PATCH] Use Branding styleStrings instead of CalamaresStyle constants. --- src/calamares/CalamaresWindow.cpp | 7 ++++--- src/calamares/progresstree/ProgressTreeDelegate.cpp | 11 +++++++---- src/calamares/progresstree/ProgressTreeView.cpp | 5 +++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index c0563bf45..63f28f9c2 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -21,7 +21,6 @@ #include "ViewManager.h" #include "progresstree/ProgressTreeView.h" #include "utils/CalamaresUtilsGui.h" -#include "utils/CalamaresStyle.h" #include "utils/Logger.h" #include "utils/DebugWindow.h" #include "utils/Retranslator.h" @@ -71,8 +70,10 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) { QPalette plt = sideBox->palette(); sideBox->setAutoFillBackground( true ); - plt.setColor( sideBox->backgroundRole(), CalamaresStyle::SIDEBAR_BACKGROUND ); - plt.setColor( sideBox->foregroundRole(), CalamaresStyle::SIDEBAR_TEXT ); + plt.setColor( sideBox->backgroundRole(), Calamares::Branding::instance()-> + styleString( Calamares::Branding::SidebarBackground ) ); + plt.setColor( sideBox->foregroundRole(), Calamares::Branding::instance()-> + styleString( Calamares::Branding::SidebarText ) ); sideBox->setPalette( plt ); logoLabel->setPalette( plt ); } diff --git a/src/calamares/progresstree/ProgressTreeDelegate.cpp b/src/calamares/progresstree/ProgressTreeDelegate.cpp index 9270ecd6f..ccc8f9a58 100644 --- a/src/calamares/progresstree/ProgressTreeDelegate.cpp +++ b/src/calamares/progresstree/ProgressTreeDelegate.cpp @@ -23,7 +23,7 @@ #include "ViewStepItem.h" #include "ProgressTreeModel.h" #include "ViewManager.h" -#include "utils/CalamaresStyle.h" +#include "Branding.h" #include "utils/CalamaresUtilsGui.h" #include @@ -82,8 +82,10 @@ ProgressTreeDelegate::paint( QPainter* painter, initStyleOption( &opt, index ); opt.text.clear(); - painter->setBrush( CalamaresStyle::SIDEBAR_BACKGROUND ); - painter->setPen( CalamaresStyle::SIDEBAR_TEXT ); + painter->setBrush( QColor( Calamares::Branding::instance()-> + styleString( Calamares::Branding::SidebarBackground ) ) ); + painter->setPen( QColor( Calamares::Branding::instance()-> + styleString( Calamares::Branding::SidebarText ) ) ); if ( isFirstLevel ) paintCategory( painter, opt, index ); @@ -135,7 +137,8 @@ ProgressTreeDelegate::paintViewStep( QPainter* painter, if ( isCurrent ) { - painter->setPen( CalamaresStyle::SIDEBAR_TEXT_SELECT ); + painter->setPen( Calamares::Branding::instance()-> + styleString( Calamares::Branding::SidebarTextSelect ) ); painter->setBrush( APP->mainWindow()->palette().background() ); } diff --git a/src/calamares/progresstree/ProgressTreeView.cpp b/src/calamares/progresstree/ProgressTreeView.cpp index 37b47cf0e..7fc44d146 100644 --- a/src/calamares/progresstree/ProgressTreeView.cpp +++ b/src/calamares/progresstree/ProgressTreeView.cpp @@ -20,7 +20,7 @@ #include "ProgressTreeDelegate.h" #include "ViewManager.h" -#include "utils/CalamaresStyle.h" +#include "Branding.h" ProgressTreeView* ProgressTreeView::s_instance = nullptr; @@ -54,7 +54,8 @@ ProgressTreeView::ProgressTreeView( QWidget* parent ) setItemDelegate( m_delegate ); QPalette plt = palette(); - plt.setColor( QPalette::Base, CalamaresStyle::SIDEBAR_BACKGROUND ); + plt.setColor( QPalette::Base, Calamares::Branding::instance()-> + styleString( Calamares::Branding::SidebarBackground ) ); setPalette( plt ); }