diff --git a/examples/buttons/buttons.qml b/examples/buttons/buttons.qml index 0dfe19f0..8ac52c30 100644 --- a/examples/buttons/buttons.qml +++ b/examples/buttons/buttons.qml @@ -9,7 +9,6 @@ Qsk.Window width: 600 height: 600 - color: "Beige" Component.onCompleted: { @@ -30,9 +29,10 @@ Qsk.Window { orientation: Qt.Horizontal dimension: 3 + panel : true // to have a themed background - //margins: 10 // only possible with Qt <= 6.1 - margins { left: 10; top: 10; right: 10; bottom: 10 } + // padding: 10 // only possible with Qt <= 6.1 + padding { left: 10; top: 10; right: 10; bottom: 10 } spacing: 10 TestButton diff --git a/examples/gallery/main.cpp b/examples/gallery/main.cpp index 42e8b280..fd2f41ad 100644 --- a/examples/gallery/main.cpp +++ b/examples/gallery/main.cpp @@ -271,8 +271,11 @@ int main( int argc, char* argv[] ) Qsk::addGraphicProvider( QString(), new GraphicProvider() ); Qsk::addGraphicProvider( "shapes", new SkinnyShapeProvider() ); - // dialogs in faked windows -> QskSubWindow - QskDialog::instance()->setPolicy( QskDialog::EmbeddedBox ); + if ( true ) // environment variable, TODO ... + { + // dialogs in faked windows -> QskSubWindow + QskDialog::instance()->setPolicy( QskDialog::EmbeddedBox ); + } QGuiApplication app( argc, argv ); diff --git a/examples/glabels/glabels.qml b/examples/glabels/glabels.qml index 096a4003..0bf32278 100644 --- a/examples/glabels/glabels.qml +++ b/examples/glabels/glabels.qml @@ -8,15 +8,15 @@ Qsk.Window width: 600 height: 600 - color: "Beige" - Qsk.LinearBox { orientation: Qt.Horizontal + panel: true + dimension: 3 - //margins: 10 - margins { left: 10; top: 10; right: 10; bottom: 10 } + //padding: 10 + padding { left: 10; top: 10; right: 10; bottom: 10 } spacing: 20 Repeater diff --git a/examples/layouts/main.cpp b/examples/layouts/main.cpp index e14cf38f..66ba5509 100644 --- a/examples/layouts/main.cpp +++ b/examples/layouts/main.cpp @@ -20,6 +20,29 @@ #include +namespace +{ + class TabView : public QskTabView + { + public: + TabView( QQuickItem* parent = nullptr ) + : QskTabView( parent ) + { + setMargins( 10 ); + setTabBarEdge( Qt::LeftEdge ); + setAutoFitTabs( true ); + + addTab( "Grid Layout", new GridLayoutPage() ); + addTab( "Flow Layout", new FlowLayoutPage() ); + addTab( "Linear Layout", new LinearLayoutPage() ); + addTab( "Dynamic\nConstraints", new DynamicConstraintsPage() ); + addTab( "Stack Layout", new StackLayoutPage() ); + + setCurrentIndex( 0 ); + } + }; +} + int main( int argc, char* argv[] ) { #ifdef ITEM_STATISTICS @@ -32,25 +55,16 @@ int main( int argc, char* argv[] ) SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts ); - auto tabView = new QskTabView(); + auto box = new QskBox(); // to have a themed application background + box->setAutoLayoutChildren( true ); - tabView->setMargins( 10 ); - tabView->setTabBarEdge( Qt::LeftEdge ); - tabView->setAutoFitTabs( true ); - - tabView->addTab( "Grid Layout", new GridLayoutPage() ); - tabView->addTab( "Flow Layout", new FlowLayoutPage() ); - tabView->addTab( "Linear Layout", new LinearLayoutPage() ); - tabView->addTab( "Dynamic\nConstraints", new DynamicConstraintsPage() ); - tabView->addTab( "Stack Layout", new StackLayoutPage() ); - - tabView->setCurrentIndex( 0 ); + (void) new TabView( box ); QSize size( 800, 600 ); - size = size.expandedTo( tabView->sizeHint().toSize() ); + size = size.expandedTo( box->sizeHint().toSize() ); QskWindow window; - window.addItem( tabView ); + window.addItem( box ); window.addItem( new QskFocusIndicator() ); window.resize( size ); diff --git a/examples/qvgviewer/MainWindow.cpp b/examples/qvgviewer/MainWindow.cpp index d53eabdf..1a53bef4 100644 --- a/examples/qvgviewer/MainWindow.cpp +++ b/examples/qvgviewer/MainWindow.cpp @@ -28,7 +28,7 @@ class GraphicLabel : public QskGraphicLabel public: enum Role { - Normal, + Normal = 1000, Inverted }; @@ -94,7 +94,8 @@ MainWindow::MainWindow() invertButton->setLayoutAlignmentHint( Qt::AlignRight ); auto box = new QskLinearBox( Qt::Vertical ); - box->setMargins( 5 ); + box->setPanel( true ); + box->setPadding( 5 ); box->addItem( invertButton ); box->addItem( m_tabView ); diff --git a/examples/qvgviewer/main.cpp b/examples/qvgviewer/main.cpp index 58a2c338..b5b6af36 100644 --- a/examples/qvgviewer/main.cpp +++ b/examples/qvgviewer/main.cpp @@ -20,7 +20,8 @@ int main( int argc, char* argv[] ) QGuiApplication app( argc, argv ); - SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts ); + SkinnyShortcut::enable( SkinnyShortcut::DebugBackground | + SkinnyShortcut::DebugStatistics | SkinnyShortcut::Quit ); auto focusIndicator = new QskFocusIndicator(); focusIndicator->setObjectName( "FocusIndicator" ); diff --git a/examples/tabview/main.cpp b/examples/tabview/main.cpp index b352ed96..020fe49f 100644 --- a/examples/tabview/main.cpp +++ b/examples/tabview/main.cpp @@ -160,8 +160,9 @@ int main( int argc, char* argv[] ) auto layoutBox = new QskLinearBox( Qt::Vertical ); layoutBox->setDefaultAlignment( Qt::AlignLeft ); - layoutBox->setMargins( 20 ); + layoutBox->setPadding( 20 ); layoutBox->setSpacing( 10 ); + layoutBox->setPanel( true ); layoutBox->addItem( buttonBox ); layoutBox->addItem( tabView ); diff --git a/examples/thumbnails/main.cpp b/examples/thumbnails/main.cpp index afac5d69..e0a7c7e3 100644 --- a/examples/thumbnails/main.cpp +++ b/examples/thumbnails/main.cpp @@ -77,8 +77,6 @@ class Thumbnail : public QskPushButton setBoxShapeHint( QskPushButton::Panel, QskBoxShapeMetrics( 20, Qt::RelativeSize ) ); setStrutSizeHint( QskPushButton::Icon, -1, -1 ); - - setSection( QskAspect::Header ); // to make them flat } private: @@ -191,7 +189,8 @@ class ScrollArea : public QskScrollArea { // settings usually done in the skins setBoxBorderMetricsHint( Viewport, 2 ); - setBoxShapeHint( Viewport, 20 ); + setBoxBorderColorsHint( Viewport, Qt::gray ); // works with most color schemes + setBoxShapeHint( Viewport, 40 ); // a radius to see that clipping works for ( auto subControl : { HorizontalScrollBar, VerticalScrollBar } ) setMetric( subControl | QskAspect::Size, 20 ); @@ -257,7 +256,8 @@ int main( int argc, char* argv[] ) */ auto box = new QskLinearBox( Qt::Vertical ); - box->setMargins( 20 ); + box->setPanel( true ); + box->setPadding( 20 ); auto buttonBox = new QskLinearBox( Qt::Horizontal, box ); buttonBox->setSizePolicy( Qt::Vertical, QskSizePolicy::Fixed ); @@ -280,7 +280,6 @@ int main( int argc, char* argv[] ) QskWindow window; window.resize( 600, 600 ); - window.setColor( "SteelBlue" ); window.addItem( box ); window.addItem( focusIndicator ); diff --git a/playground/dialogbuttons/Window.cpp b/playground/dialogbuttons/Window.cpp index e53cd480..0db8b6cb 100644 --- a/playground/dialogbuttons/Window.cpp +++ b/playground/dialogbuttons/Window.cpp @@ -14,7 +14,8 @@ Window::Window( Qt::Orientation orientation ) { m_layoutBox = new QskLinearBox( invertedOrientation() ); m_layoutBox->setObjectName( "MainBox" ); - m_layoutBox->setMargins( 10 ); + m_layoutBox->setPanel( true ); + m_layoutBox->setPadding( 10 ); m_layoutBox->setExtraSpacingAt( Qt::BottomEdge | Qt::RightEdge ); addBox( QskDialog::Ok ); diff --git a/playground/inputpanel/main.cpp b/playground/inputpanel/main.cpp index 6cd7facc..6f611a25 100644 --- a/playground/inputpanel/main.cpp +++ b/playground/inputpanel/main.cpp @@ -329,7 +329,8 @@ class Window : public QskWindow { auto box = new QskLinearBox( Qt::Horizontal ); box->setSpacing( 10 ); - box->setMargins( 20 ); + box->setPadding( 10 ); + box->setPanel( true ); auto listView = new LocaleListView( box ); auto inputBox = new InputBox( box ); @@ -367,14 +368,14 @@ int main( int argc, char* argv[] ) Window window1; window1.setObjectName( "Window 1" ); - window1.setColor( "PapayaWhip" ); + window1.setTitle( "Window 1" ); window1.resize( 600, 600 ); window1.show(); #if 1 Window window2; window2.setObjectName( "Window 2" ); - window2.setColor( "Pink" ); + window2.setTitle( "Window 2" ); window2.setX( window1.x() + 100 ); window2.resize( 600, 600 ); window2.show(); diff --git a/playground/shadows/main.cpp b/playground/shadows/main.cpp index 44d24bd3..2d6d6de9 100644 --- a/playground/shadows/main.cpp +++ b/playground/shadows/main.cpp @@ -65,7 +65,8 @@ class GridBox : public QskGridBox GridBox( QQuickItem* parent = nullptr ) : QskGridBox( parent ) { - setMargins( 5 ); + setPanel( true ); + setPadding( 5 ); setColumnStretchFactor( 1, 1 ); auto sliderX = new Slider( -50, 50, 1, 10 );