From 105fdec8d7f31cbddd08d651520d8501d9765586 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Mon, 28 Mar 2022 20:15:54 +0200 Subject: [PATCH] no more page backgrounds - preparation for better themeing --- examples/gallery/Page.cpp | 18 ---------------- examples/gallery/Page.h | 7 ------- examples/gallery/label/LabelPage.cpp | 1 - examples/gallery/main.cpp | 21 ------------------- .../gallery/progressbar/ProgressBarPage.cpp | 2 -- examples/gallery/slider/SliderPage.cpp | 2 -- .../gallery/switchbutton/SwitchButtonPage.cpp | 2 -- 7 files changed, 53 deletions(-) diff --git a/examples/gallery/Page.cpp b/examples/gallery/Page.cpp index 0dbbfcf3..078d96b3 100644 --- a/examples/gallery/Page.cpp +++ b/examples/gallery/Page.cpp @@ -4,29 +4,11 @@ *****************************************************************************/ #include "Page.h" -#include 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; -} diff --git a/examples/gallery/Page.h b/examples/gallery/Page.h index f0404294..f8f8bf83 100644 --- a/examples/gallery/Page.h +++ b/examples/gallery/Page.h @@ -6,16 +6,9 @@ #pragma once #include -#include class Page : public QskLinearBox { public: Page( Qt::Orientation, QQuickItem* parent = nullptr ); - - void setGradient( const QskGradient& ); - QskGradient gradient() const; - - private: - QskGradient m_gradient; }; diff --git a/examples/gallery/label/LabelPage.cpp b/examples/gallery/label/LabelPage.cpp index 84f2c438..8e4a2813 100644 --- a/examples/gallery/label/LabelPage.cpp +++ b/examples/gallery/label/LabelPage.cpp @@ -67,7 +67,6 @@ namespace LabelPage::LabelPage( QQuickItem* parent ) : Page( Qt::Vertical, parent ) { - setGradient( QskRgb::AliceBlue ); setSpacing( 40 ); (void) new TextBox( this ); diff --git a/examples/gallery/main.cpp b/examples/gallery/main.cpp index 58e52f7a..838d9106 100644 --- a/examples/gallery/main.cpp +++ b/examples/gallery/main.cpp @@ -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() ); } }; } diff --git a/examples/gallery/progressbar/ProgressBarPage.cpp b/examples/gallery/progressbar/ProgressBarPage.cpp index 75fad19e..18985ecf 100644 --- a/examples/gallery/progressbar/ProgressBarPage.cpp +++ b/examples/gallery/progressbar/ProgressBarPage.cpp @@ -45,9 +45,7 @@ namespace ProgressBarPage::ProgressBarPage( QQuickItem* parent ) : Page( Qt::Horizontal, parent ) { - setGradient( QskRgb::AliceBlue ); setSpacing( 40 ); - populate(); } diff --git a/examples/gallery/slider/SliderPage.cpp b/examples/gallery/slider/SliderPage.cpp index 4de7c647..8e164a5c 100644 --- a/examples/gallery/slider/SliderPage.cpp +++ b/examples/gallery/slider/SliderPage.cpp @@ -13,8 +13,6 @@ SliderPage::SliderPage( QQuickItem* parentItem ) : Page( Qt::Vertical, parentItem ) { - setGradient( QskRgb::PeachPuff ); - setMargins( 10 ); setSpacing( 20 ); diff --git a/examples/gallery/switchbutton/SwitchButtonPage.cpp b/examples/gallery/switchbutton/SwitchButtonPage.cpp index 169dac95..1fab35b1 100644 --- a/examples/gallery/switchbutton/SwitchButtonPage.cpp +++ b/examples/gallery/switchbutton/SwitchButtonPage.cpp @@ -15,9 +15,7 @@ SwitchButtonPage::SwitchButtonPage( QQuickItem* parent ) : Page( Qt::Horizontal, parent ) { - setGradient( QskRgb::AliceBlue ); setSpacing( 40 ); - populate(); }