no more page backgrounds - preparation for better themeing
This commit is contained in:
parent
60e27536e8
commit
105fdec8d7
|
@ -4,29 +4,11 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "Page.h"
|
#include "Page.h"
|
||||||
#include <QskRgbValue.h>
|
|
||||||
|
|
||||||
Page::Page( Qt::Orientation orientation, QQuickItem* parent )
|
Page::Page( Qt::Orientation orientation, QQuickItem* parent )
|
||||||
: QskLinearBox( orientation, parent )
|
: QskLinearBox( orientation, parent )
|
||||||
, m_gradient( QskRgb::GhostWhite )
|
|
||||||
{
|
{
|
||||||
setMargins( 20 );
|
setMargins( 20 );
|
||||||
setPadding( 10 );
|
setPadding( 10 );
|
||||||
setSpacing( 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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,16 +6,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QskLinearBox.h>
|
#include <QskLinearBox.h>
|
||||||
#include <QskGradient.h>
|
|
||||||
|
|
||||||
class Page : public QskLinearBox
|
class Page : public QskLinearBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Page( Qt::Orientation, QQuickItem* parent = nullptr );
|
Page( Qt::Orientation, QQuickItem* parent = nullptr );
|
||||||
|
|
||||||
void setGradient( const QskGradient& );
|
|
||||||
QskGradient gradient() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
QskGradient m_gradient;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -67,7 +67,6 @@ namespace
|
||||||
LabelPage::LabelPage( QQuickItem* parent )
|
LabelPage::LabelPage( QQuickItem* parent )
|
||||||
: Page( Qt::Vertical, parent )
|
: Page( Qt::Vertical, parent )
|
||||||
{
|
{
|
||||||
setGradient( QskRgb::AliceBlue );
|
|
||||||
setSpacing( 40 );
|
setSpacing( 40 );
|
||||||
|
|
||||||
(void) new TextBox( this );
|
(void) new TextBox( this );
|
||||||
|
|
|
@ -30,27 +30,6 @@ namespace
|
||||||
setMargins( 10 );
|
setMargins( 10 );
|
||||||
setTabPosition( Qsk::Left );
|
setTabPosition( Qsk::Left );
|
||||||
setAutoFitTabs( true );
|
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() );
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,7 @@ namespace
|
||||||
ProgressBarPage::ProgressBarPage( QQuickItem* parent )
|
ProgressBarPage::ProgressBarPage( QQuickItem* parent )
|
||||||
: Page( Qt::Horizontal, parent )
|
: Page( Qt::Horizontal, parent )
|
||||||
{
|
{
|
||||||
setGradient( QskRgb::AliceBlue );
|
|
||||||
setSpacing( 40 );
|
setSpacing( 40 );
|
||||||
|
|
||||||
populate();
|
populate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
SliderPage::SliderPage( QQuickItem* parentItem )
|
SliderPage::SliderPage( QQuickItem* parentItem )
|
||||||
: Page( Qt::Vertical, parentItem )
|
: Page( Qt::Vertical, parentItem )
|
||||||
{
|
{
|
||||||
setGradient( QskRgb::PeachPuff );
|
|
||||||
|
|
||||||
setMargins( 10 );
|
setMargins( 10 );
|
||||||
setSpacing( 20 );
|
setSpacing( 20 );
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,7 @@
|
||||||
SwitchButtonPage::SwitchButtonPage( QQuickItem* parent )
|
SwitchButtonPage::SwitchButtonPage( QQuickItem* parent )
|
||||||
: Page( Qt::Horizontal, parent )
|
: Page( Qt::Horizontal, parent )
|
||||||
{
|
{
|
||||||
setGradient( QskRgb::AliceBlue );
|
|
||||||
setSpacing( 40 );
|
setSpacing( 40 );
|
||||||
|
|
||||||
populate();
|
populate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue