heuristic for initializing the cascading property moved from skin to

QskMenu
This commit is contained in:
Uwe Rathmann 2022-04-16 12:25:39 +02:00
parent c4f5a4bc93
commit d52453311f
3 changed files with 5 additions and 11 deletions

View File

@ -237,8 +237,7 @@ void Editor::setupMenu()
setGradient( Q::Panel, m_pal.baseColor );
const bool isCascading = qskMaybeDesktopPlatform();
setFlagHint( Q::Panel | A::Style, isCascading );
setFlagHint( Q::Panel | A::Style, false ); // not cascading
#if 0
setPadding( Q::Separator, QMarginsF( 10, 0, 10, 0 ) );

View File

@ -42,16 +42,10 @@ const QPlatformIntegration* qskPlatformIntegration()
bool qskMaybeDesktopPlatform()
{
// this is what QC2 is doing for menus ?
#if QT_VERSION >= QT_VERSION_CHECK( 5, 15, 0 )
#if !QT_CONFIG(cursor)
return false;
#endif
#endif
#if QT_CONFIG(cursor)
if ( const auto platform = QGuiApplicationPrivate::platformIntegration() )
return platform->hasCapability( QPlatformIntegration::MultipleWindows );
#endif
return false;
}

View File

@ -6,6 +6,7 @@
#include <QskColorFilter.h>
#include <QskSkinlet.h>
#include <QskEvent.h>
#include <QskPlatform.h>
#include <qvector.h>
#include <qvariant.h>
@ -85,7 +86,7 @@ QskMenu::~QskMenu()
// has no effect as we do not offer submenus yet. TODO ...
bool QskMenu::isCascading() const
{
return flagHint( QskMenu::Panel | QskAspect::Style );
return flagHint( QskMenu::Panel | QskAspect::Style, qskMaybeDesktopPlatform() );
}
void QskMenu::setCascading( bool on )