no more page backgrounds - preparation for better themeing

This commit is contained in:
Uwe Rathmann 2022-03-28 20:15:54 +02:00
parent 60e27536e8
commit 105fdec8d7
7 changed files with 0 additions and 53 deletions

View File

@ -4,29 +4,11 @@
*****************************************************************************/
#include "Page.h"
#include <QskRgbValue.h>
Page::Page( Qt::Orientation orientation, QQuickItem* parent )
: QskLinearBox( orientation, parent )
, m_gradient( QskRgb::GhostWhite )
{
setMargins( 20 );
setPadding( 10 );
setSpacing( 10 );
}
void Page::setGradient( const QskGradient& gradient )
{
if ( gradient != m_gradient )
{
m_gradient = gradient;
if ( parentItem() && isVisibleToParent() )
parentItem()->update();
}
}
QskGradient Page::gradient() const
{
return m_gradient;
}

View File

@ -6,16 +6,9 @@
#pragma once
#include <QskLinearBox.h>
#include <QskGradient.h>
class Page : public QskLinearBox
{
public:
Page( Qt::Orientation, QQuickItem* parent = nullptr );
void setGradient( const QskGradient& );
QskGradient gradient() const;
private:
QskGradient m_gradient;
};

View File

@ -67,7 +67,6 @@ namespace
LabelPage::LabelPage( QQuickItem* parent )
: Page( Qt::Vertical, parent )
{
setGradient( QskRgb::AliceBlue );
setSpacing( 40 );
(void) new TextBox( this );

View File

@ -30,27 +30,6 @@ namespace
setMargins( 10 );
setTabPosition( Qsk::Left );
setAutoFitTabs( true );
connect( this, &QskTabView::currentIndexChanged,
this, &TabView::updateViewPanel );
}
protected:
void aboutToShow() override
{
updateViewPanel();
}
private:
void updateViewPanel()
{
/*
We should have a better way to set individual colors
for each tab page background
*/
if ( auto page = dynamic_cast< const ::Page* >( currentItem() ) )
setGradientHint( QskTabView::Page, page->gradient() );
}
};
}

View File

@ -45,9 +45,7 @@ namespace
ProgressBarPage::ProgressBarPage( QQuickItem* parent )
: Page( Qt::Horizontal, parent )
{
setGradient( QskRgb::AliceBlue );
setSpacing( 40 );
populate();
}

View File

@ -13,8 +13,6 @@
SliderPage::SliderPage( QQuickItem* parentItem )
: Page( Qt::Vertical, parentItem )
{
setGradient( QskRgb::PeachPuff );
setMargins( 10 );
setSpacing( 20 );

View File

@ -15,9 +15,7 @@
SwitchButtonPage::SwitchButtonPage( QQuickItem* parent )
: Page( Qt::Horizontal, parent )
{
setGradient( QskRgb::AliceBlue );
setSpacing( 40 );
populate();
}