QskMenu::cascading added
This commit is contained in:
parent
26336fa5dc
commit
a4d34dfa54
@ -311,6 +311,9 @@ void Editor::setupMenu()
|
||||
setBoxShape( Q::Panel, 4 );
|
||||
setVGradient( Q::Panel, c1, c2 );
|
||||
|
||||
const bool isCascading = qskMaybeDesktopPlatform();
|
||||
setFlagHint( Q::Panel | QskAspect::Style, isCascading );
|
||||
|
||||
#if 0
|
||||
setPadding( Q::Separator, QMarginsF( 10, 0, 10, 0 ) );
|
||||
setMetric( Q::Separator | QskAspect::Size, 3 );
|
||||
|
@ -48,6 +48,23 @@ QskMenu::~QskMenu()
|
||||
{
|
||||
}
|
||||
|
||||
bool QskMenu::isCascading() const
|
||||
{
|
||||
return flagHint( QskMenu::Panel | QskAspect::Style );
|
||||
}
|
||||
|
||||
void QskMenu::setCascading( bool on )
|
||||
{
|
||||
if ( setFlagHint( QskMenu::Panel | QskAspect::Style, on ) )
|
||||
Q_EMIT cascadingChanged( on );
|
||||
}
|
||||
|
||||
void QskMenu::resetCascading()
|
||||
{
|
||||
if ( resetFlagHint( QskMenu::Panel | QskAspect::Style ) )
|
||||
Q_EMIT cascadingChanged( isCascading() );
|
||||
}
|
||||
|
||||
void QskMenu::setOrigin( const QPointF& origin )
|
||||
{
|
||||
if ( origin != m_data->origin )
|
||||
|
@ -21,6 +21,9 @@ class QSK_EXPORT QskMenu : public QskPopup
|
||||
Q_PROPERTY( QPointF origin READ origin
|
||||
WRITE setOrigin NOTIFY originChanged )
|
||||
|
||||
Q_PROPERTY( bool cascading READ isCascading WRITE setCascading
|
||||
RESET resetCascading NOTIFY cascadingChanged )
|
||||
|
||||
Q_PROPERTY( int count READ count )
|
||||
|
||||
Q_PROPERTY( int currentIndex READ currentIndex
|
||||
@ -41,6 +44,10 @@ class QSK_EXPORT QskMenu : public QskPopup
|
||||
QskMenu( QQuickItem* parentItem = nullptr );
|
||||
~QskMenu() override;
|
||||
|
||||
bool isCascading() const;
|
||||
void setCascading( bool );
|
||||
void resetCascading();
|
||||
|
||||
void setOrigin( const QPointF& );
|
||||
QPointF origin() const;
|
||||
|
||||
@ -50,7 +57,6 @@ class QSK_EXPORT QskMenu : public QskPopup
|
||||
|
||||
void addSeparator();
|
||||
|
||||
|
||||
Entry entryAt( int index ) const;
|
||||
QskGraphic graphicAt( int index ) const;
|
||||
|
||||
@ -67,9 +73,11 @@ class QSK_EXPORT QskMenu : public QskPopup
|
||||
int indexAtPosition( const QPointF& ) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void cascadingChanged( bool );
|
||||
void originChanged( const QPointF& );
|
||||
|
||||
void triggered( int index );
|
||||
void currentIndexChanged( int index );
|
||||
void originChanged( const QPointF& );
|
||||
|
||||
public Q_SLOTS:
|
||||
void setCurrentIndex( int index );
|
||||
|
Loading…
x
Reference in New Issue
Block a user