QskMenu: Add own subcontrol Overlay
... so we can style it differently from the one of the QskPopup
This commit is contained in:
parent
8df1551701
commit
cf2e17def5
|
@ -324,6 +324,8 @@ void Editor::setupMenu()
|
|||
setBoxBorderMetrics( Q::Panel, 0 );
|
||||
setPadding( Q::Panel, 0 );
|
||||
|
||||
setGradient( Q::Overlay, Qt::transparent );
|
||||
|
||||
// The color here is primary with an opacity of 8% - we blend that
|
||||
// with the background, because we don't want the menu to have transparency:
|
||||
const auto panel = flattenedColor( m_pal.primary, m_pal.background, 0.08 );
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <qvariant.h>
|
||||
#include <qeventloop.h>
|
||||
|
||||
QSK_SUBCONTROL( QskMenu, Overlay )
|
||||
QSK_SUBCONTROL( QskMenu, Panel )
|
||||
QSK_SUBCONTROL( QskMenu, Segment )
|
||||
QSK_SUBCONTROL( QskMenu, Cursor )
|
||||
|
@ -81,6 +82,8 @@ QskMenu::QskMenu( QQuickItem* parent )
|
|||
setPopupFlag( QskPopup::CloseOnPressOutside, true );
|
||||
setPopupFlag( QskPopup::DeleteOnClose, true );
|
||||
|
||||
setSubcontrolProxy( Inherited::Overlay, Overlay );
|
||||
|
||||
initSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class QSK_EXPORT QskMenu : public QskPopup
|
|||
using Inherited = QskPopup;
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Segment, Cursor, Text, Graphic, Separator )
|
||||
QSK_SUBCONTROLS( Overlay, Panel, Segment, Cursor, Text, Graphic, Separator )
|
||||
QSK_STATES( Selected )
|
||||
|
||||
QskMenu( QQuickItem* parentItem = nullptr );
|
||||
|
|
Loading…
Reference in New Issue