parent
7cf88e7b45
commit
66b40cb198
|
@ -1877,6 +1877,8 @@ void Editor::setupSubWindow( const QskFluent2Theme& theme )
|
||||||
using Q = QskSubWindow;
|
using Q = QskSubWindow;
|
||||||
const auto& pal = theme.palette;
|
const auto& pal = theme.palette;
|
||||||
|
|
||||||
|
setAnimation( Q::Panel | QskAspect::Position, 150 );
|
||||||
|
|
||||||
setPadding( Q::Panel, { 0, 31, 0, 0 } );
|
setPadding( Q::Panel, { 0, 31, 0, 0 } );
|
||||||
setBoxShape( Q::Panel, 7 );
|
setBoxShape( Q::Panel, 7 );
|
||||||
setBoxBorderMetrics( Q::Panel, 1 );
|
setBoxBorderMetrics( Q::Panel, 1 );
|
||||||
|
|
|
@ -1236,6 +1236,8 @@ void Editor::setupSubWindow()
|
||||||
using A = QskAspect;
|
using A = QskAspect;
|
||||||
using Q = QskSubWindow;
|
using Q = QskSubWindow;
|
||||||
|
|
||||||
|
setAnimation( Q::Panel | QskAspect::Position, 150 );
|
||||||
|
|
||||||
// Panel
|
// Panel
|
||||||
|
|
||||||
setPadding( Q::Panel, { 24_dp, 0, 24_dp, 24_dp } );
|
setPadding( Q::Panel, { 24_dp, 0, 24_dp, 24_dp } );
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "QskPopup.h"
|
#include "QskPopup.h"
|
||||||
|
#include "QskAnimationHint.h"
|
||||||
#include "QskAspect.h"
|
#include "QskAspect.h"
|
||||||
#include "QskInputGrabber.h"
|
#include "QskInputGrabber.h"
|
||||||
#include "QskQuick.h"
|
#include "QskQuick.h"
|
||||||
|
@ -638,8 +639,23 @@ int QskPopup::execPopup()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
connect( popup, &QObject::destroyed, this, &EventLoop::reject );
|
connect( popup, &QObject::destroyed, this, &EventLoop::reject );
|
||||||
connect( popup, &QskPopup::fadingChanged, this, &EventLoop::maybeQuit );
|
|
||||||
connect( popup, &QskPopup::openChanged, this, &EventLoop::maybeQuit );
|
connect( popup, &QskPopup::fadingChanged, this, [this, popup]()
|
||||||
|
{
|
||||||
|
if ( !popup->isOpen() && !popup->isFading() )
|
||||||
|
{
|
||||||
|
QEventLoop::exit( 0 );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect( popup, &QskPopup::openChanged, this, [this, popup]()
|
||||||
|
{
|
||||||
|
if( popup->faderAspect().value() == 0
|
||||||
|
|| popup->animationHint( popup->faderAspect().subControl() | QskAspect::Position ).duration <= 0 )
|
||||||
|
{
|
||||||
|
QEventLoop::exit( 0 );
|
||||||
|
} // otherwise wait for the fading to finish
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -648,17 +664,6 @@ int QskPopup::execPopup()
|
||||||
setParent( nullptr );
|
setParent( nullptr );
|
||||||
QEventLoop::exit( 1 );
|
QEventLoop::exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void maybeQuit()
|
|
||||||
{
|
|
||||||
if ( auto popup = qobject_cast< const QskPopup* >( parent() ) )
|
|
||||||
{
|
|
||||||
if ( popup->isOpen() || popup->isFading() )
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QEventLoop::exit( 0 );
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( isOpen() || isFading() )
|
if ( isOpen() || isFading() )
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "QskSubWindow.h"
|
#include "QskSubWindow.h"
|
||||||
|
#include "QskAnimationHint.h"
|
||||||
#include "QskAspect.h"
|
#include "QskAspect.h"
|
||||||
#include "QskPlatform.h"
|
#include "QskPlatform.h"
|
||||||
#include "QskGraphic.h"
|
#include "QskGraphic.h"
|
||||||
|
@ -49,7 +50,15 @@ QskSubWindow::QskSubWindow( QQuickItem* parent )
|
||||||
setMargins( 0 );
|
setMargins( 0 );
|
||||||
initSizePolicy( QskSizePolicy::MinimumExpanding, QskSizePolicy::MinimumExpanding );
|
initSizePolicy( QskSizePolicy::MinimumExpanding, QskSizePolicy::MinimumExpanding );
|
||||||
|
|
||||||
|
setFaderAspect( Panel | QskAspect::Metric );
|
||||||
|
|
||||||
setAutoLayoutChildren( true );
|
setAutoLayoutChildren( true );
|
||||||
|
|
||||||
|
connect(this, &QskSubWindow::closed, this, [this]() {
|
||||||
|
startTransition( Panel | QskAspect::Metric,
|
||||||
|
animationHint( Panel | QskAspect::Position ),
|
||||||
|
0.0, 1.0 );
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QskSubWindow::~QskSubWindow()
|
QskSubWindow::~QskSubWindow()
|
||||||
|
@ -189,6 +198,12 @@ bool QskSubWindow::event( QEvent* event )
|
||||||
|
|
||||||
void QskSubWindow::updateLayout()
|
void QskSubWindow::updateLayout()
|
||||||
{
|
{
|
||||||
|
if( isFading() )
|
||||||
|
{
|
||||||
|
const auto opacity = 1 - metric( faderAspect() );
|
||||||
|
setOpacity( opacity );
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_data->isWindowIconSourceDirty )
|
if ( m_data->isWindowIconSourceDirty )
|
||||||
{
|
{
|
||||||
if ( !m_data->windowIconSource.isEmpty() )
|
if ( !m_data->windowIconSource.isEmpty() )
|
||||||
|
|
Loading…
Reference in New Issue