Compare commits

...

55 Commits

Author SHA1 Message Date
Uwe Rathmann 9bd8b6e0e5 Merge branch 'master' into features/drawer 2025-02-28 09:21:53 +01:00
Uwe Rathmann 3244e6e7e2 Merge branch 'master' into features/drawer 2025-02-06 13:51:28 +01:00
Uwe Rathmann c31b769bfd Merge branch 'master' into features/drawer 2025-02-06 10:18:38 +01:00
Uwe Rathmann 7ca2e5df1a Merge branch 'master' into features/drawer 2024-12-10 14:12:16 +01:00
Uwe Rathmann 21b7ff6ebd Merge branch 'master' into features/drawer 2024-12-02 10:09:17 +01:00
Uwe Rathmann 35e6cda013 Merge branch 'master' into features/drawer 2024-09-17 17:41:52 +02:00
Uwe Rathmann 877ebe3a72 Merge branch 'master' into features/drawer 2024-09-11 18:18:32 +02:00
Uwe Rathmann 252477b8be Merge branch 'master' into features/drawer 2024-01-30 17:10:12 +01:00
Uwe Rathmann e8f649626e Merge branch 'master' into features/drawer 2024-01-17 16:07:22 +01:00
Uwe Rathmann 757880eb43 Merge branch 'master' into features/drawer 2023-11-28 15:32:50 +01:00
Uwe Rathmann d7425ac541 Merge branch 'master' into features/drawer 2023-11-23 16:59:20 +01:00
Uwe Rathmann c254ca585b Merge branch 'master' into features/drawer 2023-11-15 11:55:15 +01:00
Uwe Rathmann fb2754ee49 Merge branch 'master' into features/drawer 2023-11-06 09:20:33 +01:00
Uwe Rathmann 8248ecdd90 harmonized with master 2023-11-05 13:40:07 +01:00
Uwe Rathmann e14c72eca4 Merge branch 'master' into features/drawer 2023-11-05 13:39:19 +01:00
Uwe Rathmann 0c6974adbc Merge branch 'master' into features/drawer 2023-11-05 13:07:42 +01:00
Uwe Rathmann 408f38e96e Merge branch 'master' into features/drawer 2023-11-03 18:21:45 +01:00
Uwe Rathmann f47e96e9ce QskDrawerSkinlet introduced 2023-11-03 17:49:26 +01:00
Uwe Rathmann 4102276f79 fading implemented 2023-11-03 10:12:35 +01:00
Uwe Rathmann 615fcffe44 transitioning for QskSubWindow added 2023-10-31 08:08:08 +01:00
Uwe Rathmann 6a11179cc9 Merge branch 'master' into features/drawer 2023-10-30 17:10:03 +01:00
Uwe Rathmann 2dd5f34948 QskMenu using position for transitioning, QskSlideIn code removed 2023-10-30 16:59:17 +01:00
Uwe Rathmann 4afe56990b much easier implementation used - the only hack is about updating the
clip node manually for each updatePaintNode
2023-10-27 07:58:27 +02:00
Uwe Rathmann a9621f19ed obsolete code removed 2023-10-26 13:29:16 +02:00
Uwe Rathmann 78f92bada0 useless code removed 2023-10-25 10:15:09 +02:00
Uwe Rathmann 8cf2cb9e6f Merge branch 'master' into features/drawer 2023-10-25 10:12:48 +02:00
Uwe Rathmann 1b8ac518e2 Merge branch 'master' into features/drawer 2023-10-25 09:46:09 +02:00
Uwe Rathmann b33da588e1 popup duration changed 2023-10-24 11:40:00 +02:00
Uwe Rathmann e4b9b8bd1b Squashed commit of the following:
commit c6aec22cbdbed31955e70ea73fc6863d9369ba22
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 24 11:34:55 2023 +0200

    wip

commit 473946633e150129a3ba67ea321bda23fcd0f5a7
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 24 11:28:23 2023 +0200

    wip

commit 368f6edac32457d6a060c2f2e8a722c0d15bf35c
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 24 11:26:46 2023 +0200

    wip

commit eccffafec006d471cc691f3d10143219ec263c63
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 24 11:22:01 2023 +0200

    wip

commit c5ae5025d4ed0ea7184fb8b4fa97df7f3ca54c0e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 24 10:53:09 2023 +0200

    wip

commit 174b1d946067c5b5c0bf4a9982d7b3f7f717d263
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 24 10:51:54 2023 +0200

    wip

commit 3e89f17ea971adc19c89cca0eb38dc3e973a090e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 24 10:15:17 2023 +0200

    wip

commit 499a13ab74501c24f1e0effe56dfb9cf9ff9bf63
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 24 10:03:55 2023 +0200

    wip

commit 935ffc6d23dcd20a2c70898f28063fcdffea0795
Merge: 82f44d41 0cf60b41
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Oct 23 10:49:32 2023 +0200

    Merge branch 'drawer' into Overlay

commit 0cf60b414cee9a26fa5a53f05938e69ab39294d7
Merge: da76eb6d 2013338d
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Oct 23 10:49:13 2023 +0200

    Merge branch 'features/drawer' into drawer

commit 82f44d41c03f8cedab8b1bf3f1c164dfa65200cf
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Sun Oct 22 10:44:50 2023 +0200

    wip

commit 3b254ff4551d457e1581b5dbb85fae2dcf55e2cc
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Sun Oct 22 10:43:15 2023 +0200

    wip

commit 81e2bd8b35fb4a361e67f8a56870d99ea05ffa4d
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Sun Oct 22 09:50:07 2023 +0200

    wip

commit 916f5ca888f675bdded0b97b763de02c8c6c12ff
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 17:08:53 2023 +0200

    wip

commit b3e8fd4d7cf4eab710b7781bb1e9dc730548d51b
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 17:03:12 2023 +0200

    wip

commit da76eb6df5353029856084e6306db32cb2712b6b
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 16:05:19 2023 +0200

    wip

commit 72fbd0b6fad4b33e09643e5a2c67833f6e2c4abd
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 15:21:14 2023 +0200

    wip

commit 7f899d67d6c8f7f98212030ac0e83e86581cefff
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 15:00:42 2023 +0200

    wip

commit 72872cad2a0749afe9c901775c18459ac4cd956a
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 13:49:05 2023 +0200

    wip

commit f16572e29a5fe8851479e2be6e04ff2d991e9ebd
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 13:40:47 2023 +0200

    wip

commit 4300a2cf225554f93cb492062f89af51dcc5df64
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 13:34:37 2023 +0200

    wip

commit c85150bcb98934b144e4453f12fbe37c4900049f
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 13:32:44 2023 +0200

    wip

commit 00d069d134319b0c3fb6d192cba32c31640e161f
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 13:21:45 2023 +0200

    wip

commit 36b4a203a3d761d4a3a5e17e1ba2deb7f9b37740
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 12:52:52 2023 +0200

    wip

commit e27fa8af6ddc233862ec431e2c129299e24f4ee0
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 11:12:42 2023 +0200

    wip

commit 579a45149a92ffef72c569c79456a3a2c753e37c
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Oct 20 10:57:51 2023 +0200

    QskSlideIn added
2023-10-24 11:39:32 +02:00
Uwe Rathmann 2013338dd4 Merge branch 'master' into features/drawer 2023-10-23 10:45:51 +02:00
Uwe Rathmann a6254a8ade API adjustments 2023-10-19 09:51:38 +02:00
Uwe Rathmann d693acfc28 QskPopup::fading renamed to QskPopup::transitioning 2023-10-19 09:49:26 +02:00
Uwe Rathmann d5619d449e Merge branch 'master' into features/drawer 2023-10-18 15:12:46 +02:00
Uwe Rathmann 22373861e5 keyEvents 2023-10-18 13:50:51 +02:00
Uwe Rathmann 8015580f55 using the clip node of the drawer ( instead the one of the parentItem() ) 2023-10-18 09:30:01 +02:00
Uwe Rathmann aa9235166a Merge branch 'master' into features/drawer 2023-10-17 17:07:16 +02:00
Uwe Rathmann c57f0adfb0 QskDrawer::setInteractive added 2023-10-17 17:03:06 +02:00
Uwe Rathmann 79924aeebe gesture also used for closing 2023-10-17 16:37:25 +02:00
Uwe Rathmann 930cb321a1 Merge branch 'master' into features/drawer 2023-10-17 15:56:01 +02:00
Uwe Rathmann ea1f342771 using autoLayoutChildren 2023-10-17 15:46:41 +02:00
Uwe Rathmann 03e37b78f0 Merge branch 'master' into features/drawer 2023-10-17 14:37:21 +02:00
Uwe Rathmann 18677a799d layout issues fixed 2023-10-17 14:32:22 +02:00
Uwe Rathmann b9747675c9 wip 2023-10-17 14:21:57 +02:00
Uwe Rathmann 93f8b883b5 Squashed commit of the following:
commit 5f31eb1e78
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Oct 17 12:14:42 2023 +0200

    QskDrawer reimplemented, can be open by a swipe gesture now. more work
    to do
2023-10-17 12:19:30 +02:00
Uwe Rathmann b2feda16e2 beautified 2023-10-17 11:59:21 +02:00
Uwe Rathmann 77f4e17b4c Merge branch 'master' into features/drawer 2023-10-17 11:58:28 +02:00
Uwe Rathmann 79d0f08eb6 implementation with basic functionality 2023-10-17 11:55:50 +02:00
Uwe Rathmann 48c170bfbf property added 2023-10-09 10:38:57 +02:00
Uwe Rathmann 4789f0ebb1 Merge branch 'master' into features/drawer 2023-10-09 10:37:42 +02:00
Uwe Rathmann f8cf5e072b crash fixed 2023-10-09 10:26:36 +02:00
Uwe Rathmann bfff8c3fe1 using gestures to open the drawer 2023-10-09 09:02:36 +02:00
Uwe Rathmann ef68c66b10 drawer example added 2023-10-06 12:41:23 +02:00
Uwe Rathmann f5de9d4249 using autoLayoutChildren instead of setting a contentItem explicitly 2023-10-05 16:05:40 +02:00
Uwe Rathmann 1132c7f878 internal QskBox eliminated 2023-10-05 15:24:17 +02:00
Uwe Rathmann 7294d5a01e ongoing work on QskDrawer 2023-10-05 15:13:47 +02:00
3 changed files with 151 additions and 0 deletions

View File

@ -9,6 +9,7 @@ add_subdirectory(shadows)
add_subdirectory(shapes) add_subdirectory(shapes)
add_subdirectory(charts) add_subdirectory(charts)
add_subdirectory(plots) add_subdirectory(plots)
add_subdirectory(drawer)
if (BUILD_INPUTCONTEXT) if (BUILD_INPUTCONTEXT)
add_subdirectory(inputpanel) add_subdirectory(inputpanel)

View File

@ -0,0 +1,6 @@
############################################################################
# QSkinny - Copyright (C) 2016 Uwe Rathmann
# SPDX-License-Identifier: BSD-3-Clause
############################################################################
qsk_add_example(drawer main.cpp)

144
playground/drawer/main.cpp Normal file
View File

@ -0,0 +1,144 @@
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "SkinnyShortcut.h"
#include <QskRgbValue.h>
#include <QskControl.h>
#include <QskDrawer.h>
#include <QskPushButton.h>
#include <QskFocusIndicator.h>
#include <QskWindow.h>
#include <QskEvent.h>
#include <QskAnimationHint.h>
#include <QGuiApplication>
namespace
{
class Drawer : public QskDrawer
{
public:
Drawer( Qt::Edge edge, QQuickItem* parent )
: QskDrawer( parent )
{
setEdge( edge );
auto content = new QskControl( this );
content->setObjectName( "Content" );
content->setAutoLayoutChildren( true );
content->setMargins( 20 );
auto button = new QskPushButton( "Push Me", content );
button->setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
button->setLayoutAlignmentHint( Qt::AlignCenter );
const auto size = content->sizeHint();
switch( edge )
{
case Qt::LeftEdge:
setPanel( QskRgb::Tomato );
break;
case Qt::RightEdge:
setPanel( QskRgb::Orchid );
content->setFixedWidth( 1.5 * size.width() );
break;
case Qt::TopEdge:
setPanel( QskRgb::Chartreuse );
break;
case Qt::BottomEdge:
setPanel( QskRgb::Wheat );
content->setFixedHeight( 2 * size.height() );
break;
}
}
private:
void setPanel( const QColor& color )
{
setGradientHint( Panel, color );
}
};
class DrawerBox : public QskControl
{
public:
DrawerBox( QQuickItem* parent = nullptr )
: QskControl( parent )
{
setBackgroundColor( QskRgb::LightSteelBlue );
setMargins( 10 );
setAutoLayoutChildren( true );
for ( int i = 0; i < 4; i++ )
{
const auto edge = static_cast< Qt::Edge >( 1 << i );
auto dragMargin = 30; // the default setting is pretty small
if ( edge == Qt::TopEdge )
{
// to check if dragging works above the button
dragMargin = 120;
}
auto drawer = new Drawer( edge, this );
drawer->setDragMargin( dragMargin );
connect( drawer, &QskPopup::openChanged,
this, &DrawerBox::setDrawersLocked );
m_drawers[i] = drawer;
}
auto button = new QskPushButton( "Push Me", this );
button->setPreferredHeight( 100 );
}
private:
void setDrawersLocked( bool locked )
{
for ( auto drawer : m_drawers )
{
if ( !drawer->isOpen() )
drawer->setInteractive( !locked );
}
}
Drawer* m_drawers[4];
};
class MainBox : public QskControl
{
public:
MainBox( QQuickItem* parent = nullptr )
: QskControl( parent )
{
setMargins( 40 );
setAutoLayoutChildren( true );
( void ) new DrawerBox( this );
}
};
}
int main( int argc, char* argv[] )
{
QGuiApplication app( argc, argv );
SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts );
QskWindow window;
window.addItem( new QskFocusIndicator() );
window.addItem( new MainBox() );
window.resize( 600, 600 );
window.show();
return app.exec();
}