API adjustments

This commit is contained in:
Uwe Rathmann 2023-10-19 09:51:38 +02:00
parent d693acfc28
commit a6254a8ade
1 changed files with 17 additions and 3 deletions

View File

@ -24,7 +24,7 @@ namespace
: QskDrawer( parent ) : QskDrawer( parent )
{ {
#if 1 #if 1
setAnimationHint( faderAspect(), 1000 ); setAnimationHint( transitionAspect(), 1000 );
#endif #endif
setEdge( edge ); setEdge( edge );
@ -71,7 +71,6 @@ namespace
for ( int i = 0; i < 4; i++ ) for ( int i = 0; i < 4; i++ )
{ {
const auto edge = static_cast< Qt::Edge >( 1 << i ); const auto edge = static_cast< Qt::Edge >( 1 << i );
m_drawers[i] = new Drawer( edge, this );
auto dragMargin = 30; // the default setting is pretty small auto dragMargin = 30; // the default setting is pretty small
if ( edge == Qt::TopEdge ) if ( edge == Qt::TopEdge )
@ -80,7 +79,13 @@ namespace
dragMargin = 120; dragMargin = 120;
} }
m_drawers[i]->setDragMargin( dragMargin ); 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 ); auto button = new QskPushButton( "Push Me", this );
@ -88,6 +93,15 @@ namespace
} }
private: private:
void setDrawersLocked( bool locked )
{
for ( auto drawer : m_drawers )
{
if ( !drawer->isOpen() )
drawer->setInteractive( !locked );
}
}
Drawer* m_drawers[4]; Drawer* m_drawers[4];
}; };