FluentUI/src/controls/FluMenu.qml

42 lines
1.1 KiB
QML
Raw Normal View History

2023-03-02 18:21:43 +08:00
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.impl 2.15
import QtQuick.Templates 2.15 as T
import QtQuick.Window 2.15
import QtGraphicalEffects 1.15
T.Menu {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)
margins: 0
delegate: FluMenuItem { }
contentItem: ListView {
implicitHeight: contentHeight
model: control.contentModel
interactive: Window.window ? contentHeight > Window.window.height : false
clip: true
currentIndex: control.currentIndex
ScrollIndicator.vertical: ScrollIndicator {}
}
background: Item {
implicitWidth: 122
implicitHeight: 30
Rectangle{
anchors.fill: parent
color: "#FFFFFF"
layer.effect: FluDropShadow{}
layer.enabled: true
}
}
}