minor improvements
This commit is contained in:
parent
0ed89c111d
commit
0b5b622d1a
|
@ -138,9 +138,15 @@ QskPopup::QskPopup( QQuickItem* parent )
|
||||||
Inherited::setVisible( false );
|
Inherited::setVisible( false );
|
||||||
setSkinStateFlag( QskPopup::Closed );
|
setSkinStateFlag( QskPopup::Closed );
|
||||||
|
|
||||||
// we need to stop event propagation
|
/*
|
||||||
setAcceptedMouseButtons( Qt::AllButtons );
|
We need to stop event propagation.
|
||||||
setWheelEnabled( true );
|
|
||||||
|
Unfortunatly derived classes can't use setAcceptedMouseButtons anymore.
|
||||||
|
Need to think about a solution TODO ...
|
||||||
|
*/
|
||||||
|
|
||||||
|
Inherited::setAcceptedMouseButtons( Qt::AllButtons );
|
||||||
|
Inherited::setWheelEnabled( true );
|
||||||
|
|
||||||
// we don't want to be resized by layout code
|
// we don't want to be resized by layout code
|
||||||
setTransparentForPositioner( true );
|
setTransparentForPositioner( true );
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef QSK_POPUP_H
|
#ifndef QSK_POPUP_H
|
||||||
#define QSK_POPUP_H 1
|
#define QSK_POPUP_H
|
||||||
|
|
||||||
#include "QskControl.h"
|
#include "QskControl.h"
|
||||||
|
|
||||||
|
@ -69,6 +69,10 @@ class QSK_EXPORT QskPopup : public QskControl
|
||||||
bool isOpen() const;
|
bool isOpen() const;
|
||||||
bool isFading() const;
|
bool isFading() const;
|
||||||
|
|
||||||
|
// we always need to accept all inputs, to stop further propagation
|
||||||
|
void setAcceptedMouseButtons( Qt::MouseButtons ) = delete;
|
||||||
|
void setWheelEnabled( bool ) = delete;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void open();
|
void open();
|
||||||
void close();
|
void close();
|
||||||
|
|
|
@ -19,7 +19,8 @@ class QSK_EXPORT QskPopupSkinlet : public QskSkinlet
|
||||||
public:
|
public:
|
||||||
enum NodeRole
|
enum NodeRole
|
||||||
{
|
{
|
||||||
OverlayRole
|
OverlayRole,
|
||||||
|
RoleCount
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_INVOKABLE QskPopupSkinlet( QskSkin* = nullptr );
|
Q_INVOKABLE QskPopupSkinlet( QskSkin* = nullptr );
|
||||||
|
|
|
@ -24,21 +24,23 @@ QskSubWindowSkinlet::~QskSubWindowSkinlet() = default;
|
||||||
QRectF QskSubWindowSkinlet::subControlRect( const QskSkinnable* skinnable,
|
QRectF QskSubWindowSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||||
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
|
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
|
||||||
{
|
{
|
||||||
|
using Q = QskSubWindow;
|
||||||
|
|
||||||
const auto subWindow = static_cast< const QskSubWindow* >( skinnable );
|
const auto subWindow = static_cast< const QskSubWindow* >( skinnable );
|
||||||
|
|
||||||
if ( subControl == QskSubWindow::Panel )
|
if ( subControl == Q::Panel )
|
||||||
{
|
{
|
||||||
return contentsRect;
|
return contentsRect;
|
||||||
}
|
}
|
||||||
else if ( subControl == QskSubWindow::TitleBarPanel )
|
else if ( subControl == Q::TitleBarPanel )
|
||||||
{
|
{
|
||||||
return titleBarRect( subWindow, contentsRect );
|
return titleBarRect( subWindow, contentsRect );
|
||||||
}
|
}
|
||||||
else if ( subControl == QskSubWindow::TitleBarSymbol )
|
else if ( subControl == Q::TitleBarSymbol )
|
||||||
{
|
{
|
||||||
return symbolRect( subWindow, contentsRect );
|
return symbolRect( subWindow, contentsRect );
|
||||||
}
|
}
|
||||||
else if ( subControl == QskSubWindow::TitleBarText )
|
else if ( subControl == Q::TitleBarText )
|
||||||
{
|
{
|
||||||
return titleRect( subWindow, contentsRect );
|
return titleRect( subWindow, contentsRect );
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ class QSK_EXPORT QskSubWindowSkinlet : public QskPopupSkinlet
|
||||||
public:
|
public:
|
||||||
enum NodeRole
|
enum NodeRole
|
||||||
{
|
{
|
||||||
PanelRole = QskPopupSkinlet::OverlayRole + 1,
|
PanelRole = QskPopupSkinlet::RoleCount,
|
||||||
TitleBarRole,
|
TitleBarRole,
|
||||||
SymbolRole,
|
SymbolRole,
|
||||||
TitleRole
|
TitleRole
|
||||||
|
|
|
@ -72,6 +72,15 @@ namespace QskSGNode
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template< typename Node >
|
||||||
|
inline Node* ensureNode( QSGNode* node )
|
||||||
|
{
|
||||||
|
if ( node == nullptr )
|
||||||
|
node = new Node();
|
||||||
|
|
||||||
|
return static_cast< Node* >( node );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue